Re: Bug in signal handler - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Bug in signal handler
Date
Msg-id 20060511140316.GG30113@svana.org
Whole thread Raw
In response to Re: Bug in signal handler  (Douglas McNaught <doug@mcnaught.org>)
List pgsql-hackers
On Thu, May 11, 2006 at 08:24:02AM -0400, Douglas McNaught wrote:
> Martijn van Oosterhout <kleptog@svana.org> 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
anunsafe 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   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [COMMITTERS] pgsql: Clean up code associated with updating
Next
From: Tom Lane
Date:
Subject: Re: Bug in signal handler