Hi all,

While hacking a background worker for Windows/Linux that is sending
signals to the Postmaster depending on the state of the server where
Postgres is running (particularly after a certain size threshold is
reached on the partition of PGDATA SIGINT is sent to PostmasterPid to
have it stop cleanly), I have noticed that PostmasterPid is not marked
as PGDLLIMPORT in miscadmin.h, so I cannot use the field directly in
this background worker for Windows... Bypassing this problem can be
done by parsing postmaster.pid but adding this extra logic is really
annoying as this requires a one-line change upstream...
Could it be possible to mark PostmasterPid with PGDLLIMPORT on HEAD
and back-branches?

diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 356fcc6..78545da 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -143,7 +143,7 @@ do { \
  * from utils/init/globals.c
-extern pid_t PostmasterPid;
+extern PGDLLIMPORT pid_t PostmasterPid;
 extern bool IsPostmasterEnvironment;
 extern PGDLLIMPORT bool IsUnderPostmaster;
 extern bool IsBackgroundWorker;
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to