On Thu, May 11, 2006 at 08:24:02AM -0400, Douglas McNaught wrote: > Martijn van Oosterhout <[email protected]> writes: > > > Running unsafe functions within a signal handler is not unsafe per-se. > > It's only unsafe if the main program could also be running unsafe > > functions. > > I don't disagree with your reasoning, but does POSIX actually say > this?
On my machine, signal(2) has the following:
The routine handler must be very careful, since processing
elsewhere was interrupted at some arbitrary point. POSIX has the
concept of "safe function". If a signal interrupts an unsafe
function, and handler calls an unsafe function, then the
behavior is undefined. Safe functions are listed explicitly in
the various standards. The POSIX 1003.1-2003 list is
<long list including select(), signal() and sigaction()>
I havn't read POSIX myself though...
Have a nice day,
--
Martijn van Oosterhout <[email protected]> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to
> litigate.
signature.asc
Description: Digital signature
