#include "c.h"
#include <signal.h>
Go to the source code of this file.
Functions | |
pqsigfunc | pqsignal (int signo, pqsigfunc func) |
Definition at line 53 of file pqsignal.c.
References pg_signal_array, SIGALRM, and SIGCHLD.
{ #if !defined(HAVE_POSIX_SIGNALS) return signal(signo, func); #else struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (signo != SIGALRM) act.sa_flags |= SA_RESTART; #ifdef SA_NOCLDSTOP if (signo == SIGCHLD) act.sa_flags |= SA_NOCLDSTOP; #endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; #endif /* !HAVE_POSIX_SIGNALS */ }