Re: Bug in signal handler

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Bug in signal handler
Дата
Msg-id 20060511140316.GG30113@svana.org
обсуждение исходный текст
Ответ на Re: Bug in signal handler  (Douglas McNaught <doug@mcnaught.org>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Clean up code associated with updating
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug in signal handler