PostgreSQL Source Code  git master
postmaster.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * postmaster.h
4  * Exports from postmaster/postmaster.c.
5  *
6  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/postmaster/postmaster.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef _POSTMASTER_H
14 #define _POSTMASTER_H
15 
16 /* GUC options */
17 extern PGDLLIMPORT bool EnableSSL;
20 extern PGDLLIMPORT int PostPortNumber;
22 extern PGDLLIMPORT char *Unix_socket_group;
24 extern PGDLLIMPORT char *ListenAddresses;
26 extern PGDLLIMPORT int PreAuthDelay;
28 extern PGDLLIMPORT bool Log_connections;
29 extern PGDLLIMPORT bool log_hostname;
30 extern PGDLLIMPORT bool enable_bonjour;
31 extern PGDLLIMPORT char *bonjour_name;
36 
37 #ifdef WIN32
38 extern PGDLLIMPORT HANDLE PostmasterHandle;
39 #else
40 extern PGDLLIMPORT int postmaster_alive_fds[2];
41 
42 /*
43  * Constants that represent which of postmaster_alive_fds is held by
44  * postmaster, and which is used in children to check for postmaster death.
45  */
46 #define POSTMASTER_FD_WATCH 0 /* used in children to check for
47  * postmaster death */
48 #define POSTMASTER_FD_OWN 1 /* kept open by postmaster only */
49 #endif
50 
51 extern PGDLLIMPORT const char *progname;
52 
53 extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
54 extern void ClosePostmasterPorts(bool am_syslogger);
55 extern void InitProcessGlobals(void);
56 
57 extern int MaxLivePostmasterChildren(void);
58 
59 extern bool PostmasterMarkPIDForWorkerNotify(int);
60 
61 #ifdef EXEC_BACKEND
62 extern pid_t postmaster_forkexec(int argc, char *argv[]);
63 extern void SubPostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
64 
65 extern Size ShmemBackendArraySize(void);
66 extern void ShmemBackendArrayAllocation(void);
67 #endif
68 
69 /*
70  * Note: MAX_BACKENDS is limited to 2^18-1 because that's the width reserved
71  * for buffer references in buf_internals.h. This limitation could be lifted
72  * by using a 64bit state; but it's unlikely to be worthwhile as 2^18-1
73  * backends exceed currently realistic configurations. Even if that limitation
74  * were removed, we still could not a) exceed 2^23-1 because inval.c stores
75  * the backend ID as a 3-byte signed integer, b) INT_MAX/4 because some places
76  * compute 4*MaxBackends without any overflow check. This is rechecked in the
77  * relevant GUC check hooks and in RegisterBackgroundWorker().
78  */
79 #define MAX_BACKENDS 0x3FFFF
80 
81 #endif /* _POSTMASTER_H */
#define PGDLLIMPORT
Definition: c.h:1326
#define pg_attribute_noreturn()
Definition: c.h:206
size_t Size
Definition: c.h:594
PGDLLIMPORT bool enable_bonjour
Definition: postmaster.c:241
PGDLLIMPORT bool log_hostname
Definition: postmaster.c:238
PGDLLIMPORT int PostPortNumber
Definition: postmaster.c:199
PGDLLIMPORT bool send_abort_for_kill
Definition: postmaster.c:246
PGDLLIMPORT int Unix_socket_permissions
Definition: pqcomm.c:106
PGDLLIMPORT char * ListenAddresses
Definition: postmaster.c:205
PGDLLIMPORT bool send_abort_for_crash
Definition: postmaster.c:245
void InitProcessGlobals(void)
Definition: postmaster.c:2623
PGDLLIMPORT int postmaster_alive_fds[2]
Definition: postmaster.c:575
PGDLLIMPORT char * Unix_socket_directories
Definition: postmaster.c:202
PGDLLIMPORT const char * progname
Definition: main.c:45
PGDLLIMPORT int AuthenticationTimeout
Definition: postmaster.c:236
PGDLLIMPORT bool ClientAuthInProgress
Definition: postmaster.c:356
PGDLLIMPORT char * bonjour_name
Definition: postmaster.c:242
PGDLLIMPORT int SuperuserReservedConnections
Definition: postmaster.c:225
PGDLLIMPORT int PreAuthDelay
Definition: postmaster.c:235
void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: postmaster.c:585
PGDLLIMPORT char * Unix_socket_group
Definition: pqcomm.c:107
bool PostmasterMarkPIDForWorkerNotify(int)
Definition: postmaster.c:5991
PGDLLIMPORT bool remove_temp_files_after_crash
Definition: postmaster.c:244
PGDLLIMPORT int ReservedConnections
Definition: postmaster.c:226
PGDLLIMPORT bool Log_connections
Definition: postmaster.c:239
PGDLLIMPORT bool EnableSSL
Definition: postmaster.c:233
int MaxLivePostmasterChildren(void)
Definition: postmaster.c:5568
void ClosePostmasterPorts(bool am_syslogger)
Definition: postmaster.c:2549
PGDLLIMPORT bool restart_after_crash
Definition: postmaster.c:243