first pass...move some of the "Port" dependencies to src/include/config.h
This commit is contained in:
parent
672aec6ce3
commit
c028568217
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.5 1996/08/14 04:51:34 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.6 1996/08/27 06:55:28 scrappy Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -33,43 +33,47 @@
|
|||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#include "libpq/pqsignal.h" /* substitute for <signal.h> */
|
#include "libpq/pqsignal.h" /* substitute for <signal.h> */
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifndef WIN32
|
|
||||||
#include <unistd.h>
|
#if !defined(NO_UNISTD_H)
|
||||||
#endif /* WIN32 */
|
# include <unistd.h>
|
||||||
|
#endif /* !NO_UNISTD_H */
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h> /* for fd_set stuff */
|
#include <sys/types.h> /* for fd_set stuff */
|
||||||
#include <sys/stat.h> /* for umask */
|
#include <sys/stat.h> /* for umask */
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
|
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
|
||||||
#ifdef WIN32
|
|
||||||
#include <winsock.h>
|
#if defined(USES_WINSOCK)
|
||||||
#include <limits.h>
|
# include <winsock.h>
|
||||||
#define MAXINT INT_MAX
|
# include <limits.h>
|
||||||
|
# define MAXINT INT_MAX
|
||||||
#else
|
#else
|
||||||
#include <netdb.h> /* for MAXHOSTNAMELEN on some */
|
# include <netdb.h> /* for MAXHOSTNAMELEN on some */
|
||||||
#ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
|
# ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
|
||||||
#include <arpa/nameser.h>
|
# include <arpa/nameser.h>
|
||||||
#define MAXHOSTNAMELEN MAXDNAME
|
# define MAXHOSTNAMELEN MAXDNAME
|
||||||
#endif
|
# endif
|
||||||
# if defined(PORTNAME_BSD44_derived) || \
|
# if defined(USE_LIMITS_H)
|
||||||
defined(PORTNAME_bsdi) || \
|
# include <machine/limits.h>
|
||||||
defined(PORTNAME_bsdi_2_1)
|
# define MAXINT INT_MAX
|
||||||
# include <machine/limits.h>
|
|
||||||
# define MAXINT INT_MAX
|
|
||||||
# else
|
# else
|
||||||
# include <values.h>
|
# include <values.h>
|
||||||
# endif /* !PORTNAME_BSD44_derived */
|
# endif /* !USE_LIMITS_H */
|
||||||
#include <sys/wait.h>
|
# include <sys/wait.h>
|
||||||
#endif /* WIN32 */
|
#endif /* USES_WINSOCK */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#if defined(PORTNAME_aix)
|
#if defined(NEED_SYS_SELECT_H)
|
||||||
#include <sys/select.h>
|
# include <sys/select.h>
|
||||||
#endif /* PORTNAME_aix */
|
#endif /* NEED_SYS_SELECT_H */
|
||||||
|
|
||||||
#include "storage/ipc.h"
|
#include "storage/ipc.h"
|
||||||
#include "libpq/libpq.h"
|
#include "libpq/libpq.h"
|
||||||
@ -81,15 +85,14 @@
|
|||||||
#include "storage/proc.h"
|
#include "storage/proc.h"
|
||||||
#include "utils/elog.h"
|
#include "utils/elog.h"
|
||||||
|
|
||||||
#ifdef DBX_VERSION
|
#if defined(DBX_VERSION)
|
||||||
#define FORK() (0)
|
# define FORK() (0)
|
||||||
#else
|
#else
|
||||||
#if defined(PORTNAME_irix5)
|
# if defined(NO_VFORK)
|
||||||
/* IRIX 5 does not have vfork() */
|
# define FORK() fork()
|
||||||
#define FORK() fork()
|
# else
|
||||||
#else
|
# define FORK() vfork()
|
||||||
#define FORK() vfork()
|
# endif
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -140,7 +143,7 @@ static int SendStop = 0;
|
|||||||
static int MultiplexedBackends = 0;
|
static int MultiplexedBackends = 0;
|
||||||
static int MultiplexedBackendPort;
|
static int MultiplexedBackendPort;
|
||||||
|
|
||||||
#ifdef HBA
|
#if defined(HBA)
|
||||||
static int useHostBasedAuth = 1;
|
static int useHostBasedAuth = 1;
|
||||||
#else
|
#else
|
||||||
static int useHostBasedAuth = 0;
|
static int useHostBasedAuth = 0;
|
||||||
@ -153,7 +156,7 @@ static void pmdaemonize(void);
|
|||||||
static int ConnStartup(Port *port);
|
static int ConnStartup(Port *port);
|
||||||
static int ConnCreate(int serverFd, int *newFdP);
|
static int ConnCreate(int serverFd, int *newFdP);
|
||||||
static void reset_shared(short port);
|
static void reset_shared(short port);
|
||||||
#if defined(PORTNAME_linux)
|
#if defined(linux)
|
||||||
static void pmdie(int);
|
static void pmdie(int);
|
||||||
static void reaper(int);
|
static void reaper(int);
|
||||||
static void dumpstatus(int);
|
static void dumpstatus(int);
|
||||||
@ -184,7 +187,7 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
int status;
|
int status;
|
||||||
int silentflag = 0;
|
int silentflag = 0;
|
||||||
char hostbuf[MAXHOSTNAMELEN];
|
char hostbuf[MAXHOSTNAMELEN];
|
||||||
#ifdef WIN32
|
#if defined(WIN32)
|
||||||
WSADATA WSAData;
|
WSADATA WSAData;
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
@ -313,7 +316,7 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32)
|
||||||
if ((status = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0)
|
if ((status = WSAStartup(MAKEWORD(1,1), &WSAData)) == 0)
|
||||||
(void) printf("%s\nInitializing WinSock: %s\n", WSAData.szDescription, WSAData.szSystemStatus);
|
(void) printf("%s\nInitializing WinSock: %s\n", WSAData.szDescription, WSAData.szSystemStatus);
|
||||||
else
|
else
|
||||||
@ -951,7 +954,7 @@ DoExec(StartupInfo *packet, int portFd)
|
|||||||
char dbbuf[ARGV_SIZE + 1];
|
char dbbuf[ARGV_SIZE + 1];
|
||||||
int ac = 0;
|
int ac = 0;
|
||||||
int i;
|
int i;
|
||||||
#ifdef WIN32
|
#if defined(WIN32)
|
||||||
char win32_args[(2 * ARGV_SIZE) + 1];
|
char win32_args[(2 * ARGV_SIZE) + 1];
|
||||||
PROCESS_INFORMATION piProcInfo;
|
PROCESS_INFORMATION piProcInfo;
|
||||||
STARTUPINFO siStartInfo;
|
STARTUPINFO siStartInfo;
|
||||||
@ -984,7 +987,7 @@ DoExec(StartupInfo *packet, int portFd)
|
|||||||
if (packet->tty[0]) {
|
if (packet->tty[0]) {
|
||||||
(void) strncpy(ttybuf, packet->tty, ARGV_SIZE);
|
(void) strncpy(ttybuf, packet->tty, ARGV_SIZE);
|
||||||
av[ac++] = "-o";
|
av[ac++] = "-o";
|
||||||
#ifdef WIN32
|
#if defined(WIN32)
|
||||||
/* BIG HACK - The front end is passing "/dev/null" here which
|
/* BIG HACK - The front end is passing "/dev/null" here which
|
||||||
** causes new backends to fail. So, as a very special case,
|
** causes new backends to fail. So, as a very special case,
|
||||||
** use a real NT filename.
|
** use a real NT filename.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user