void* gs_signal_receiver_thread(void* args) { sigset_t waitMask; /* wait below signals: SIGINT, SIGTERM, SIGQUIT, SIGHUP, SIGUSR1 */ sigemptyset(&waitMask); sigaddset(&waitMask, SIGINT); sigaddset(&waitMask, SIGTERM); sigaddset(&waitMask, SIGQUIT); sigaddset(&waitMask, SIGHUP); sigaddset(&waitMask, SIGUSR1); gs_signal_block_sigusr2(); /* add just for memcheck */ gs_thread_args_free(); for (;;) { int signo; /* Wait for signals arrival. */ sigwait(&waitMask, &signo); /* send signal to thread */ (void)gs_signal_send(PostmasterPid, signo); } return NULL; }