Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Munro2018-07-11 00:47:42 +0000
committerThomas Munro2018-07-11 01:14:07 +0000
commitf98b8476cd4a19dfc602ab95642ce08e53877d65 (patch)
tree8e47d857238724401ab000ab240af1b55ecaf595 /src/backend
parent9f09529952ac41a10e5874cba745c1c24e67ac79 (diff)
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
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/storage/ipc/pmsignal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/storage/ipc/pmsignal.c b/src/backend/storage/ipc/pmsignal.c
index ebf027306f7..f658588c272 100644
--- a/src/backend/storage/ipc/pmsignal.c
+++ b/src/backend/storage/ipc/pmsignal.c
@@ -379,6 +379,9 @@ PostmasterDeathSignalInit(void)
#if defined(PR_SET_PDEATHSIG)
if (prctl(PR_SET_PDEATHSIG, signum) < 0)
elog(ERROR, "could not request parent death signal: %m");
+#elif defined(PROC_PDEATHSIG_CTL)
+ if (procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum) < 0)
+ elog(ERROR, "could not request parent death signal: %m");
#else
#error "USE_POSTMASTER_DEATH_SIGNAL set, but there is no mechanism to request the signal"
#endif