1
/*-------------------------------------------------------------------------
4
* reliable BSD-style signal(2) routine stolen from RWW who stole it
7
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
15
* This shouldn't be in libpq, but the monitor and some other
18
*-------------------------------------------------------------------------
25
pqsignal(int signo, pqsigfunc func)
27
#if !defined(HAVE_POSIX_SIGNALS)
28
return signal(signo, func);
33
act.sa_handler = func;
34
sigemptyset(&act.sa_mask);
37
act.sa_flags |= SA_RESTART;
40
act.sa_flags |= SA_NOCLDSTOP;
42
if (sigaction(signo, &act, &oact) < 0)
44
return oact.sa_handler;
45
#endif /* !HAVE_POSIX_SIGNALS */