diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-28 05:13:32 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-28 05:13:32 +0000 |
commit | 1a321f26d88e5c64bccba9d36920aede1e201729 (patch) | |
tree | 43940a3ed5cc754bff68748502550731b0ad19a0 /src/include/pgstat.h | |
parent | 37da0ba0e0f2d92857dc62789820d21e177dc00f (diff) | |
download | postgresql-1a321f26d88e5c64bccba9d36920aede1e201729.tar.gz postgresql-1a321f26d88e5c64bccba9d36920aede1e201729.zip |
Code review for EXEC_BACKEND changes. Reduce the number of #ifdefs by
about a third, make it work on non-Windows platforms again. (But perhaps
I broke the WIN32 code, since I have no way to test that.) Fold all the
paths that fork postmaster child processes to go through the single
routine SubPostmasterMain, which takes care of resurrecting the state that
would normally be inherited from the postmaster (including GUC variables).
Clean up some places where there's no particularly good reason for the
EXEC and non-EXEC cases to work differently. Take care of one or two
FIXMEs that remained in the code.
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r-- | src/include/pgstat.h | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 7380a883cfa..8f7c4dc4515 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -5,7 +5,7 @@ * * Copyright (c) 2001-2003, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.21 2004/03/09 05:11:53 momjian Exp $ + * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.22 2004/05/28 05:13:25 tgl Exp $ * ---------- */ #ifndef PGSTAT_H @@ -325,18 +325,6 @@ typedef union PgStat_Msg } PgStat_Msg; -#ifdef EXEC_BACKEND -typedef enum STATS_PROCESS_TYPE -{ - STAT_PROC_BUFFER, - STAT_PROC_COLLECTOR -} STATS_PROCESS_TYPE; -#define PGSTAT_FORK_ARGS int argc, char *argv[] -#else -#define PGSTAT_FORK_ARGS void -#endif - - /* ---------- * GUC parameters * ---------- @@ -355,28 +343,21 @@ extern bool pgstat_is_running; /* ---------- - * Functions called from main - * ---------- - */ -#ifdef EXEC_BACKEND -extern void pgstat_main(PGSTAT_FORK_ARGS); -extern void pgstat_mainChild(PGSTAT_FORK_ARGS); -#endif - - -/* ---------- * Functions called from postmaster * ---------- */ -#ifdef EXEC_BACKEND -extern void pgstat_init_forkexec_backend(void); -#endif extern void pgstat_init(void); extern void pgstat_start(void); extern bool pgstat_ispgstat(int pid); extern void pgstat_close_sockets(void); extern void pgstat_beterm(int pid); +#ifdef EXEC_BACKEND +extern void PgstatBufferMain(int argc, char *argv[]); +extern void PgstatCollectorMain(int argc, char *argv[]); +#endif + + /* ---------- * Functions called from backends * ---------- |