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-2021, 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 bool EnableSSL;
18 extern int ReservedBackends;
19 extern PGDLLIMPORT int PostPortNumber;
20 extern int Unix_socket_permissions;
21 extern char *Unix_socket_group;
22 extern char *Unix_socket_directories;
23 extern char *ListenAddresses;
24 extern bool ClientAuthInProgress;
25 extern int PreAuthDelay;
26 extern int AuthenticationTimeout;
27 extern bool Log_connections;
28 extern bool log_hostname;
29 extern bool enable_bonjour;
30 extern char *bonjour_name;
31 extern bool restart_after_crash;
33 
34 #ifdef WIN32
35 extern HANDLE PostmasterHandle;
36 #else
37 extern int postmaster_alive_fds[2];
38 
39 /*
40  * Constants that represent which of postmaster_alive_fds is held by
41  * postmaster, and which is used in children to check for postmaster death.
42  */
43 #define POSTMASTER_FD_WATCH 0 /* used in children to check for
44  * postmaster death */
45 #define POSTMASTER_FD_OWN 1 /* kept open by postmaster only */
46 #endif
47 
48 extern PGDLLIMPORT const char *progname;
49 
50 extern void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
51 extern void ClosePostmasterPorts(bool am_syslogger);
52 extern void InitProcessGlobals(void);
53 
54 extern int MaxLivePostmasterChildren(void);
55 
56 extern bool PostmasterMarkPIDForWorkerNotify(int);
57 
58 #ifdef EXEC_BACKEND
59 extern pid_t postmaster_forkexec(int argc, char *argv[]);
60 extern void SubPostmasterMain(int argc, char *argv[]) pg_attribute_noreturn();
61 
62 extern Size ShmemBackendArraySize(void);
63 extern void ShmemBackendArrayAllocation(void);
64 #endif
65 
66 /*
67  * Note: MAX_BACKENDS is limited to 2^18-1 because that's the width reserved
68  * for buffer references in buf_internals.h. This limitation could be lifted
69  * by using a 64bit state; but it's unlikely to be worthwhile as 2^18-1
70  * backends exceed currently realistic configurations. Even if that limitation
71  * were removed, we still could not a) exceed 2^23-1 because inval.c stores
72  * the backend ID as a 3-byte signed integer, b) INT_MAX/4 because some places
73  * compute 4*MaxBackends without any overflow check. This is rechecked in the
74  * relevant GUC check hooks and in RegisterBackgroundWorker().
75  */
76 #define MAX_BACKENDS 0x3FFFF
77 
78 #endif /* _POSTMASTER_H */
#define pg_attribute_noreturn()
Definition: c.h:179
char * Unix_socket_directories
Definition: postmaster.c:202
int MaxLivePostmasterChildren(void)
Definition: postmaster.c:5662
void PostmasterMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: postmaster.c:579
bool Log_connections
Definition: postmaster.c:239
char * ListenAddresses
Definition: postmaster.c:205
#define PGDLLIMPORT
Definition: c.h:1317
bool PostmasterMarkPIDForWorkerNotify(int)
Definition: postmaster.c:6078
bool log_hostname
Definition: postmaster.c:238
int postmaster_alive_fds[2]
Definition: postmaster.c:569
int ReservedBackends
Definition: postmaster.c:216
bool remove_temp_files_after_crash
Definition: postmaster.c:245
char * bonjour_name
Definition: postmaster.c:243
bool enable_bonjour
Definition: postmaster.c:242
PGDLLIMPORT const char * progname
Definition: main.c:46
bool restart_after_crash
Definition: postmaster.c:244
PGDLLIMPORT int PostPortNumber
Definition: postmaster.c:199
bool ClientAuthInProgress
Definition: postmaster.c:363
void InitProcessGlobals(void)
Definition: postmaster.c:2618
void ClosePostmasterPorts(bool am_syslogger)
Definition: postmaster.c:2554
int Unix_socket_permissions
Definition: pqcomm.c:108
size_t Size
Definition: c.h:540
char * Unix_socket_group
Definition: pqcomm.c:109
bool EnableSSL
Definition: postmaster.c:233
int PreAuthDelay
Definition: postmaster.c:235
int AuthenticationTimeout
Definition: postmaster.c:236