Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Sep 2001 00:59:15 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Mikhail Teterin <mi@aldan.algebra.com>
Cc:        asmodai@wxs.nl, current@freebsd.org, arch@freebsd.org
Subject:   Re: proctitle progress reporting for dump(8)
Message-ID:  <3B95DB53.13AE8B42@mindspring.com>
References:  <200109041851.f84Ipfo55193@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B95DB53.13AE8B42>