1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-25 12:03:53 +03:00

Use signals for postmaster death on FreeBSD.

Use FreeBSD 11.2's new support for detecting parent process death to
make PostmasterIsAlive() very cheap, as was done for Linux in an
earlier commit.

Author: Thomas Munro
Discussion: https://postgr.es/m/7261eb39-0369-f2f4-1bb5-62f3b6083b5e@iki.fi
This commit is contained in:
Thomas Munro
2018-07-11 12:47:42 +12:00
parent 9f09529952
commit f98b8476cd
5 changed files with 14 additions and 3 deletions

View File

@@ -18,6 +18,10 @@
#include "sys/prctl.h"
#endif
#ifdef HAVE_SYS_PROCCTL_H
#include "sys/procctl.h"
#endif
/*
* Reasons for signaling the postmaster. We can cope with simultaneous
* signals for different reasons. If the same reason is signaled multiple
@@ -66,7 +70,8 @@ extern void PostmasterDeathSignalInit(void);
* the parent dies. Checking the flag first makes PostmasterIsAlive() a lot
* cheaper in usual case that the postmaster is alive.
*/
#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_PDEATHSIG)
#if (defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_PDEATHSIG)) || \
(defined(HAVE_SYS_PROCCTL_H) && defined(PROC_PDEATHSIG_CTL))
#define USE_POSTMASTER_DEATH_SIGNAL
#endif