On Fri, Oct 12, 2007 at 10:29:53AM -0400, Carson Gaspar wrote: > David Carter wrote: > >> I'm still a little bothered about signal handling and EINTR. I did some >> experiments after our last chat about signals. In practice disk IO system >> calls seem to be reasonably safe against EINTR on both Linux and Solaris, >> but a trip to Google suggests that there are few guarantees: >> http://archives.postgresql.org/pgsql-hackers/2005-12/msg01259.php >> There seems to be a spilt of opinion between BSD and SVR4: BSD tries to >> retry while SVR4 throws EINTR. Linux of course can work either way: >> http://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html > > I suggest reading the POSIX specs. Restart vs. EINTR is specified > explicitly on any POSIX platform (including all the *BSDs, Solaris, Linux, > ...). If cyrus is still using signal() and friends anywhere, they > desperately need to be replaced with sigaction().
Apart from a couple of short-lived command line utilities it looks like the only use of signal() is a bunch of 'signal(SIGPIPE, SIG_IGN);' scattered through just about everything. Most of the "interesting" signal handling is done with sigaction already. Bron.