Header And Logo

PostgreSQL
| The world's most advanced open source database.

postmaster.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * postmaster.h
00004  *    Exports from postmaster/postmaster.c.
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/postmaster/postmaster.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef _POSTMASTER_H
00014 #define _POSTMASTER_H
00015 
00016 /* GUC options */
00017 extern bool EnableSSL;
00018 extern int  ReservedBackends;
00019 extern int  PostPortNumber;
00020 extern int  Unix_socket_permissions;
00021 extern char *Unix_socket_group;
00022 extern char *Unix_socket_directories;
00023 extern char *ListenAddresses;
00024 extern bool ClientAuthInProgress;
00025 extern int  PreAuthDelay;
00026 extern int  AuthenticationTimeout;
00027 extern bool Log_connections;
00028 extern bool log_hostname;
00029 extern bool enable_bonjour;
00030 extern char *bonjour_name;
00031 extern bool restart_after_crash;
00032 
00033 #ifdef WIN32
00034 extern HANDLE PostmasterHandle;
00035 #else
00036 extern int  postmaster_alive_fds[2];
00037 
00038 /*
00039  * Constants that represent which of postmaster_alive_fds is held by
00040  * postmaster, and which is used in children to check for postmaster death.
00041  */
00042 #define POSTMASTER_FD_WATCH     0       /* used in children to check for
00043                                          * postmaster death */
00044 #define POSTMASTER_FD_OWN       1       /* kept open by postmaster only */
00045 #endif
00046 
00047 extern const char *progname;
00048 
00049 extern void PostmasterMain(int argc, char *argv[]) __attribute__((noreturn));
00050 extern void ClosePostmasterPorts(bool am_syslogger);
00051 
00052 extern int  MaxLivePostmasterChildren(void);
00053 
00054 extern int GetNumShmemAttachedBgworkers(void);
00055 
00056 #ifdef EXEC_BACKEND
00057 extern pid_t postmaster_forkexec(int argc, char *argv[]);
00058 extern void SubPostmasterMain(int argc, char *argv[]) __attribute__((noreturn));
00059 
00060 extern Size ShmemBackendArraySize(void);
00061 extern void ShmemBackendArrayAllocation(void);
00062 #endif
00063 
00064 /*
00065  * Note: MAX_BACKENDS is limited to 2^23-1 because inval.c stores the
00066  * backend ID as a 3-byte signed integer.  Even if that limitation were
00067  * removed, we still could not exceed INT_MAX/4 because some places compute
00068  * 4*MaxBackends without any overflow check.  This is rechecked in the relevant
00069  * GUC check hooks and in RegisterBackgroundWorker().
00070  */
00071 #define MAX_BACKENDS    0x7fffff
00072 
00073 #endif   /* _POSTMASTER_H */