PostgreSQL Source Code  git master
pqsignal.h File Reference
#include <signal.h>
Include dependency graph for pqsignal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PG_SETMASK(mask)   sigprocmask(SIG_SETMASK, mask, NULL)
 

Functions

void pqinitmask (void)
 

Variables

sigset_t UnBlockSig
 
sigset_t BlockSig
 
sigset_t StartupBlockSig
 

Macro Definition Documentation

◆ PG_SETMASK

Function Documentation

◆ pqinitmask()

void pqinitmask ( void  )

Definition at line 41 of file pqsignal.c.

References BlockSig, SIGABRT, SIGALRM, SIGCONT, SIGQUIT, SIGTRAP, StartupBlockSig, and UnBlockSig.

Referenced by BackendRun(), PostgresMain(), and PostmasterMain().

42 {
43  sigemptyset(&UnBlockSig);
44 
45  /* First set all signals, then clear some. */
46  sigfillset(&BlockSig);
47  sigfillset(&StartupBlockSig);
48 
49  /*
50  * Unmark those signals that should never be blocked. Some of these signal
51  * names don't exist on all platforms. Most do, but might as well ifdef
52  * them all for consistency...
53  */
54 #ifdef SIGTRAP
55  sigdelset(&BlockSig, SIGTRAP);
56  sigdelset(&StartupBlockSig, SIGTRAP);
57 #endif
58 #ifdef SIGABRT
59  sigdelset(&BlockSig, SIGABRT);
60  sigdelset(&StartupBlockSig, SIGABRT);
61 #endif
62 #ifdef SIGILL
63  sigdelset(&BlockSig, SIGILL);
64  sigdelset(&StartupBlockSig, SIGILL);
65 #endif
66 #ifdef SIGFPE
67  sigdelset(&BlockSig, SIGFPE);
68  sigdelset(&StartupBlockSig, SIGFPE);
69 #endif
70 #ifdef SIGSEGV
71  sigdelset(&BlockSig, SIGSEGV);
72  sigdelset(&StartupBlockSig, SIGSEGV);
73 #endif
74 #ifdef SIGBUS
75  sigdelset(&BlockSig, SIGBUS);
76  sigdelset(&StartupBlockSig, SIGBUS);
77 #endif
78 #ifdef SIGSYS
79  sigdelset(&BlockSig, SIGSYS);
80  sigdelset(&StartupBlockSig, SIGSYS);
81 #endif
82 #ifdef SIGCONT
83  sigdelset(&BlockSig, SIGCONT);
84  sigdelset(&StartupBlockSig, SIGCONT);
85 #endif
86 
87 /* Signals unique to startup */
88 #ifdef SIGQUIT
89  sigdelset(&StartupBlockSig, SIGQUIT);
90 #endif
91 #ifdef SIGTERM
92  sigdelset(&StartupBlockSig, SIGTERM);
93 #endif
94 #ifdef SIGALRM
95  sigdelset(&StartupBlockSig, SIGALRM);
96 #endif
97 }
#define SIGQUIT
Definition: win32_port.h:164
#define SIGCONT
Definition: win32_port.h:172
#define SIGTRAP
Definition: win32_port.h:165
#define SIGABRT
Definition: win32_port.h:166
sigset_t UnBlockSig
Definition: pqsignal.c:22
sigset_t BlockSig
Definition: pqsignal.c:22
#define SIGALRM
Definition: win32_port.h:169
sigset_t StartupBlockSig
Definition: pqsignal.c:22

Variable Documentation

◆ BlockSig

◆ StartupBlockSig

sigset_t StartupBlockSig

Definition at line 22 of file pqsignal.c.

Referenced by BackendInitialize(), and pqinitmask().

◆ UnBlockSig