PostgreSQL Source Code git master
Loading...
Searching...
No Matches
legacy-pqsignal.c File Reference
#include "postgres_fe.h"
#include <signal.h>
Include dependency graph for legacy-pqsignal.c:

Go to the source code of this file.

Typedefs

typedef void(* pqsigfunc_legacy) (int postgres_signal_arg)
 

Functions

pqsigfunc_legacy pqsignal (int signo, pqsigfunc_legacy func)
 

Typedef Documentation

◆ pqsigfunc_legacy

typedef void(* pqsigfunc_legacy) (int postgres_signal_arg)

Definition at line 40 of file legacy-pqsignal.c.

Function Documentation

◆ pqsignal()

pqsigfunc_legacy pqsignal ( int  signo,
pqsigfunc_legacy  func 
)
extern

Definition at line 44 of file legacy-pqsignal.c.

45{
46#ifndef WIN32
47 struct sigaction act,
48 oact;
49
50 act.sa_handler = func;
51 sigemptyset(&act.sa_mask);
52 act.sa_flags = 0;
53 if (signo != SIGALRM)
54 act.sa_flags |= SA_RESTART;
55#ifdef SA_NOCLDSTOP
56 if (signo == SIGCHLD)
57 act.sa_flags |= SA_NOCLDSTOP;
58#endif
59 if (sigaction(signo, &act, &oact) < 0)
60 return SIG_ERR;
61 return oact.sa_handler;
62#else /* WIN32 */
63 return signal(signo, func);
64#endif
65}
static int fb(int x)
#define SIGCHLD
Definition win32_port.h:168
#define SIGALRM
Definition win32_port.h:164

References fb(), SIGALRM, and SIGCHLD.