*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.8 1996/09/26 03:17:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.9 1996/10/04 20:16:18 scrappy Exp $
*
* NOTES
*
static int ConnStartup(Port *port);
static int ConnCreate(int serverFd, int *newFdP);
static void reset_shared(short port);
-#if defined(linux)
-static void pmdie(int);
-static void reaper(int);
-static void dumpstatus(int);
-#else
-static void pmdie(void);
-static void reaper(void);
-static void dumpstatus();
-#endif
+static void pmdie(SIGNAL_ARGS);
+static void reaper(SIGNAL_ARGS);
+static void dumpstatus(SIGNAL_ARGS);
static void CleanupProc(int pid, int exitstatus);
static int DoExec(StartupInfo *packet, int portFd);
static void ExitPostmaster(int status);
-static void usage();
-static void checkDataDir();
+static void usage(const char *);
+static void checkDataDir(void);
int ServerLoop(void);
int BackendStartup(StartupInfo *packet, Port *port, int *pidPtr);
}
static void
-pmdaemonize()
+pmdaemonize(void)
{
int i;
}
static void
-usage(char *progname)
+usage(const char *progname)
{
fprintf(stderr, "usage: %s [options..]\n", progname);
fprintf(stderr, "\t-a authsys\tdo/do not permit use of an authentication system\n");
}
int
-ServerLoop()
+ServerLoop(void)
{
int serverFd = ServerSock;
fd_set rmask, basemask;
fprintf(stderr, "%s: ServerLoop: select failed\n",
progname);
return(STATUS_ERROR);
- }
+ }
/* [TRH]
* To avoid race conditions, block SIGCHLD signals while we are
* handling the request. (both reaper() and ConnCreate()
--nSelected;
FD_CLR(ServerSock, &rmask);
}
-
+
if (DebugLvl > 1) {
fprintf(stderr, "%s: ServerLoop:\tnSelected=%d\n",
progname, nSelected);
* pmdie -- signal handler for cleaning up after a kill signal.
*/
static void
-#if defined(PORTNAME_linux)
-pmdie(int i)
-#else
-pmdie()
-#endif
+pmdie(SIGNAL_ARGS)
{
exitpg(0);
}
* Reaper -- signal handler to cleanup after a backend (child) dies.
*/
static void
-#if defined(PORTNAME_linux)
-reaper(int i)
-#else
-reaper()
-#endif
+reaper(SIGNAL_ARGS)
{
int status; /* backend exit status */
int pid; /* process id of dead backend */
}
static void
-#if defined(PORTNAME_linux)
-dumpstatus(int i)
-#else
-dumpstatus()
-#endif
+dumpstatus(SIGNAL_ARGS)
{
Dlelem *curr = DLGetHead(PortList);
}
static void
-checkDataDir()
+checkDataDir(void)
{
char path[MAXPATHLEN];
FILE *fp;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.8 1996/09/16 05:36:38 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.9 1996/10/04 20:16:32 scrappy Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
*/
void
-handle_warn()
+handle_warn(SIGNAL_ARGS)
{
siglongjmp(Warn_restart, 1);
}
void
-quickdie()
+quickdie(SIGNAL_ARGS)
{
elog(NOTICE, "I have been signalled by the postmaster.");
elog(NOTICE, "Some backend process has died unexpectedly and possibly");
}
void
-die()
+die(SIGNAL_ARGS)
{
ExitPostgres(0);
}
/* signal handler for floating point exception */
void
-FloatExceptionHandler()
+FloatExceptionHandler(SIGNAL_ARGS)
{
elog(WARN, "floating point exception! the last floating point operation eit\
her exceeded legal ranges or was a divide by zero");
*/
if (IsUnderPostmaster == false) {
puts("\nPOSTGRES backend interactive interface");
- puts("$Revision: 1.8 $ $Date: 1996/09/16 05:36:38 $");
+ puts("$Revision: 1.9 $ $Date: 1996/10/04 20:16:32 $");
}
/* ----------------
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: async.h,v 1.1 1996/08/28 07:21:41 scrappy Exp $
+ * $Id: async.h,v 1.2 1996/10/04 20:16:52 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include "nodes/memnodes.h"
-#if defined(PORTNAME_linux)
-extern void Async_NotifyHandler(int);
-#else
-extern void Async_NotifyHandler(void);
-#endif
+extern void Async_NotifyHandler(SIGNAL_ARGS);
extern void Async_Notify(char *relname);
extern void Async_NotifyAtCommit(void);
extern void Async_NotifyAtAbort(void);
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/mk/Attic/postgres.mk,v 1.3 1996/09/23 08:24:11 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/mk/Attic/postgres.mk,v 1.4 1996/10/04 20:17:11 scrappy Exp $
#
#-------------------------------------------------------------------------
include $(MKDIR)/../Makefile.global
-include $(MKDIR)/port/postgres.mk.$(PORTNAME)
+# The following is used as the arg list for signal handlers. Any ports
+# that take something other than an int argument should change this in
+# the port specific makefile. Note that variable names are required
+# because it is used in both the prototypes as well as the definitions.
+# Note also the long name. We expect that this won't collide with
+# other names causing compiler warnings.
+#ifndef SIGNAL_ARGS
+#define SIGNAL_ARGS int postgres_signal_arg
+#endif
+
+CFLAGS += -DSIGNAL_ARGS=$(SIGNAL_ARGS)
+
CURDIR:= $(shell pwd)
# This is where we put all the .o's and the generated files.