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 60 of file pqsignal.c.

61 {
62 #if !(defined(WIN32) && defined(FRONTEND))
63  struct sigaction act,
64  oact;
66  act.sa_handler = func;
67  sigemptyset(&act.sa_mask);
68  act.sa_flags = SA_RESTART;
69 #ifdef SA_NOCLDSTOP
70  if (signo == SIGCHLD)
71  act.sa_flags |= SA_NOCLDSTOP;
72 #endif
73  if (sigaction(signo, &act, &oact) < 0)
74  return SIG_ERR;
75  return oact.sa_handler;
76 #else
77  /* Forward to Windows native signal system. */
78  return signal(signo, func);
79 #endif
80 }
#define SIGCHLD
Definition: win32_port.h:178
#define SIG_ERR
Definition: win32_port.h:164


Referenced by ApplyLauncherMain(), autoprewarm_database_main(), autoprewarm_main(), AutoVacLauncherMain(), AutoVacWorkerMain(), BackendInitialize(), BackgroundWorkerMain(), 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(), restore_sigpipe_trap(), setalarm(), setup_cancel_handler(), setup_signals(), SetupApplyOrSyncWorker(), ShutdownLatchSupport(), signal_remove_temp(), sigTermHandler(), StartupProcessMain(), SysLoggerMain(), test_shm_mq_main(), trap_sigint_during_startup(), trapsig(), WalReceiverMain(), WalSndSignals(), WalWriterMain(), and worker_spi_main().