PostgreSQL Source Code  git master
pqsignal.c File Reference
#include "c.h"
#include <signal.h>
#include "libpq/pqsignal.h"
Include dependency graph for pqsignal.c:

Go to the source code of this file.


pqsigfunc pqsignal (int signo, pqsigfunc func)

Function Documentation

◆ pqsignal()

pqsigfunc pqsignal ( int  signo,
pqsigfunc  func 

Definition at line 42 of file pqsignal.c.

43 {
44 #if !(defined(WIN32) && defined(FRONTEND))
45  struct sigaction act,
46  oact;
48  act.sa_handler = func;
49  sigemptyset(&act.sa_mask);
50  act.sa_flags = SA_RESTART;
51 #ifdef SA_NOCLDSTOP
52  if (signo == SIGCHLD)
53  act.sa_flags |= SA_NOCLDSTOP;
54 #endif
55  if (sigaction(signo, &act, &oact) < 0)
56  return SIG_ERR;
57  return oact.sa_handler;
58 #else
59  /* Forward to Windows native signal system. */
60  return signal(signo, func);
61 #endif
62 }
#define SIGCHLD
Definition: win32_port.h:186
#define SIG_ERR
Definition: win32_port.h:172


Referenced by ApplyLauncherMain(), ApplyWorkerMain(), autoprewarm_database_main(), autoprewarm_main(), AutoVacLauncherMain(), AutoVacWorkerMain(), BackendInitialize(), BackgroundWriterMain(), bootstrap_signals(), CheckpointerMain(), disable_sigpipe_trap(), do_start(), InitializeLatchSupport(), InitializeTimeouts(), InitPostmasterChild(), main(), make_temp_sockdir(), OpenPipeStream(), ParallelApplyWorkerMain(), ParallelBackupStart(), ParallelWorkerMain(), pg_crc32c_armv8_available(), PgArchiverMain(), plperl_init_interp(), PostgresMain(), PostmasterDeathSignalInit(), PostmasterMain(), PQprint(), restore_sigpipe_trap(), setalarm(), setup_cancel_handler(), setup_signals(), ShutdownLatchSupport(), signal_remove_temp(), sigTermHandler(), StartBackgroundWorker(), StartupProcessMain(), SysLoggerMain(), test_shm_mq_main(), trap_sigint_during_startup(), trapsig(), WalReceiverMain(), WalSndSignals(), and WalWriterMain().