From owner-freebsd-arch Wed Sep 5 0:59: 1 2001 Delivered-To: freebsd-arch@freebsd.org Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 05EC637B403; Wed, 5 Sep 2001 00:58:57 -0700 (PDT) Received: from mindspring.com (dialup-209.245.138.192.Dial1.SanJose1.Level3.net [209.245.138.192]) by swan.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id AAA03365; Wed, 5 Sep 2001 00:58:30 -0700 (PDT) Message-ID: <3B95DB53.13AE8B42@mindspring.com> Date: Wed, 05 Sep 2001 00:59:15 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mikhail Teterin Cc: asmodai@wxs.nl, current@freebsd.org, arch@freebsd.org Subject: Re: proctitle progress reporting for dump(8) References: <200109041851.f84Ipfo55193@aldan.algebra.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mikhail Teterin wrote: > > Also, printf() allocates memory for floating point, so if that > > percentage is a floating point calculation, then you are in double > > trouble, since you are not allowed to call malloc() in a signal > > handler. > > That's interesting... I can modify it a bit, to round the percentage to > fit the %d if called as a signal handler. Thanks. Anything else? If setproctitle() calls malloc/strsave/etc., it is not safe to call in a signal handler. I'm not saying it does, I'm saying I haven't looked at the code in libc for the function, and you should, before using it in a signal handler... -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message