Commit eeece9e6 authored by Peter Eisentraut's avatar Peter Eisentraut

Unify calling conventions for postgres/postmaster sub-main functions

There was a wild mix of calling conventions: Some were declared to
return void and didn't return, some returned an int exit code, some
claimed to return an exit code, which the callers checked, but
actually never returned, and so on.

Now all of these functions are declared to return void and decorated
with attribute noreturn and don't return.  That's easiest, and most
code already worked that way.
parent c7d47abd
...@@ -173,7 +173,7 @@ main(int argc, char *argv[]) ...@@ -173,7 +173,7 @@ main(int argc, char *argv[])
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
if (argc > 1 && strncmp(argv[1], "--fork", 6) == 0) if (argc > 1 && strncmp(argv[1], "--fork", 6) == 0)
exit(SubPostmasterMain(argc, argv)); SubPostmasterMain(argc, argv); /* does not return */
#endif #endif
#ifdef WIN32 #ifdef WIN32
...@@ -189,14 +189,13 @@ main(int argc, char *argv[]) ...@@ -189,14 +189,13 @@ main(int argc, char *argv[])
if (argc > 1 && strcmp(argv[1], "--boot") == 0) if (argc > 1 && strcmp(argv[1], "--boot") == 0)
AuxiliaryProcessMain(argc, argv); /* does not return */ AuxiliaryProcessMain(argc, argv); /* does not return */
else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0)
if (argc > 1 && strcmp(argv[1], "--describe-config") == 0) GucInfoMain(); /* does not return */
exit(GucInfoMain()); else if (argc > 1 && strcmp(argv[1], "--single") == 0)
PostgresMain(argc, argv, get_current_username(progname)); /* does not return */
if (argc > 1 && strcmp(argv[1], "--single") == 0) else
exit(PostgresMain(argc, argv, get_current_username(progname))); PostmasterMain(argc, argv); /* does not return */
abort(); /* should not get here */
exit(PostmasterMain(argc, argv));
} }
......
...@@ -269,8 +269,8 @@ int AutovacuumLauncherPid = 0; ...@@ -269,8 +269,8 @@ int AutovacuumLauncherPid = 0;
static pid_t avlauncher_forkexec(void); static pid_t avlauncher_forkexec(void);
static pid_t avworker_forkexec(void); static pid_t avworker_forkexec(void);
#endif #endif
NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]); NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]) __attribute__((noreturn));
NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]); NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) __attribute__((noreturn));
static Oid do_start_worker(void); static Oid do_start_worker(void);
static void launcher_determine_sleep(bool canlaunch, bool recursing, static void launcher_determine_sleep(bool canlaunch, bool recursing,
......
...@@ -101,7 +101,7 @@ static Latch mainloop_latch; ...@@ -101,7 +101,7 @@ static Latch mainloop_latch;
static pid_t pgarch_forkexec(void); static pid_t pgarch_forkexec(void);
#endif #endif
NON_EXEC_STATIC void PgArchiverMain(int argc, char *argv[]); NON_EXEC_STATIC void PgArchiverMain(int argc, char *argv[]) __attribute__((noreturn));
static void pgarch_exit(SIGNAL_ARGS); static void pgarch_exit(SIGNAL_ARGS);
static void ArchSigHupHandler(SIGNAL_ARGS); static void ArchSigHupHandler(SIGNAL_ARGS);
static void ArchSigTermHandler(SIGNAL_ARGS); static void ArchSigTermHandler(SIGNAL_ARGS);
......
...@@ -243,7 +243,7 @@ static instr_time total_func_time; ...@@ -243,7 +243,7 @@ static instr_time total_func_time;
static pid_t pgstat_forkexec(void); static pid_t pgstat_forkexec(void);
#endif #endif
NON_EXEC_STATIC void PgstatCollectorMain(int argc, char *argv[]); NON_EXEC_STATIC void PgstatCollectorMain(int argc, char *argv[]) __attribute__((noreturn));
static void pgstat_exit(SIGNAL_ARGS); static void pgstat_exit(SIGNAL_ARGS);
static void pgstat_beshutdown_hook(int code, Datum arg); static void pgstat_beshutdown_hook(int code, Datum arg);
static void pgstat_sighup_handler(SIGNAL_ARGS); static void pgstat_sighup_handler(SIGNAL_ARGS);
......
...@@ -343,8 +343,8 @@ static void LogChildExit(int lev, const char *procname, ...@@ -343,8 +343,8 @@ static void LogChildExit(int lev, const char *procname,
int pid, int exitstatus); int pid, int exitstatus);
static void PostmasterStateMachine(void); static void PostmasterStateMachine(void);
static void BackendInitialize(Port *port); static void BackendInitialize(Port *port);
static int BackendRun(Port *port); static void BackendRun(Port *port) __attribute__((noreturn));
static void ExitPostmaster(int status); static void ExitPostmaster(int status) __attribute__((noreturn));
static int ServerLoop(void); static int ServerLoop(void);
static int BackendStartup(Port *port); static int BackendStartup(Port *port);
static int ProcessStartupPacket(Port *port, bool SSLdone); static int ProcessStartupPacket(Port *port, bool SSLdone);
...@@ -491,7 +491,7 @@ HANDLE PostmasterHandle; ...@@ -491,7 +491,7 @@ HANDLE PostmasterHandle;
/* /*
* Postmaster main entry point * Postmaster main entry point
*/ */
int void
PostmasterMain(int argc, char *argv[]) PostmasterMain(int argc, char *argv[])
{ {
int opt; int opt;
...@@ -1125,7 +1125,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -1125,7 +1125,7 @@ PostmasterMain(int argc, char *argv[])
*/ */
ExitPostmaster(status != STATUS_OK); ExitPostmaster(status != STATUS_OK);
return 0; /* not reached */ abort(); /* not reached */
} }
...@@ -3295,7 +3295,7 @@ BackendStartup(Port *port) ...@@ -3295,7 +3295,7 @@ BackendStartup(Port *port)
BackendInitialize(port); BackendInitialize(port);
/* And run the backend */ /* And run the backend */
proc_exit(BackendRun(port)); BackendRun(port);
} }
#endif /* EXEC_BACKEND */ #endif /* EXEC_BACKEND */
...@@ -3539,7 +3539,7 @@ BackendInitialize(Port *port) ...@@ -3539,7 +3539,7 @@ BackendInitialize(Port *port)
* Shouldn't return at all. * Shouldn't return at all.
* If PostgresMain() fails, return status. * If PostgresMain() fails, return status.
*/ */
static int static void
BackendRun(Port *port) BackendRun(Port *port)
{ {
char **av; char **av;
...@@ -3610,7 +3610,7 @@ BackendRun(Port *port) ...@@ -3610,7 +3610,7 @@ BackendRun(Port *port)
*/ */
MemoryContextSwitchTo(TopMemoryContext); MemoryContextSwitchTo(TopMemoryContext);
return (PostgresMain(ac, av, port->user_name)); PostgresMain(ac, av, port->user_name);
} }
...@@ -3960,7 +3960,7 @@ internal_forkexec(int argc, char *argv[], Port *port) ...@@ -3960,7 +3960,7 @@ internal_forkexec(int argc, char *argv[], Port *port)
* have been inherited by fork() on Unix. Remaining arguments go to the * have been inherited by fork() on Unix. Remaining arguments go to the
* subprocess FooMain() routine. * subprocess FooMain() routine.
*/ */
int void
SubPostmasterMain(int argc, char *argv[]) SubPostmasterMain(int argc, char *argv[])
{ {
Port port; Port port;
...@@ -4111,7 +4111,7 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4111,7 +4111,7 @@ SubPostmasterMain(int argc, char *argv[])
CreateSharedMemoryAndSemaphores(false, 0); CreateSharedMemoryAndSemaphores(false, 0);
/* And run the backend */ /* And run the backend */
proc_exit(BackendRun(&port)); BackendRun(&port); /* does not return */
} }
if (strcmp(argv[1], "--forkboot") == 0) if (strcmp(argv[1], "--forkboot") == 0)
{ {
...@@ -4127,8 +4127,7 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4127,8 +4127,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */ /* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0); CreateSharedMemoryAndSemaphores(false, 0);
AuxiliaryProcessMain(argc - 2, argv + 2); AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
proc_exit(0);
} }
if (strcmp(argv[1], "--forkavlauncher") == 0) if (strcmp(argv[1], "--forkavlauncher") == 0)
{ {
...@@ -4144,8 +4143,7 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4144,8 +4143,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */ /* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0); CreateSharedMemoryAndSemaphores(false, 0);
AutoVacLauncherMain(argc - 2, argv + 2); AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
proc_exit(0);
} }
if (strcmp(argv[1], "--forkavworker") == 0) if (strcmp(argv[1], "--forkavworker") == 0)
{ {
...@@ -4161,8 +4159,7 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4161,8 +4159,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */ /* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0); CreateSharedMemoryAndSemaphores(false, 0);
AutoVacWorkerMain(argc - 2, argv + 2); AutoVacWorkerMain(argc - 2, argv + 2); /* does not return */
proc_exit(0);
} }
if (strcmp(argv[1], "--forkarch") == 0) if (strcmp(argv[1], "--forkarch") == 0)
{ {
...@@ -4171,8 +4168,7 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4171,8 +4168,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */ /* Do not want to attach to shared memory */
PgArchiverMain(argc, argv); PgArchiverMain(argc, argv); /* does not return */
proc_exit(0);
} }
if (strcmp(argv[1], "--forkcol") == 0) if (strcmp(argv[1], "--forkcol") == 0)
{ {
...@@ -4181,8 +4177,7 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4181,8 +4177,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */ /* Do not want to attach to shared memory */
PgstatCollectorMain(argc, argv); PgstatCollectorMain(argc, argv); /* does not return */
proc_exit(0);
} }
if (strcmp(argv[1], "--forklog") == 0) if (strcmp(argv[1], "--forklog") == 0)
{ {
...@@ -4191,11 +4186,10 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4191,11 +4186,10 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */ /* Do not want to attach to shared memory */
SysLoggerMain(argc, argv); SysLoggerMain(argc, argv); /* does not return */
proc_exit(0);
} }
return 1; /* shouldn't get here */ abort(); /* shouldn't get here */
} }
#endif /* EXEC_BACKEND */ #endif /* EXEC_BACKEND */
......
...@@ -139,6 +139,7 @@ static volatile sig_atomic_t rotation_requested = false; ...@@ -139,6 +139,7 @@ static volatile sig_atomic_t rotation_requested = false;
static pid_t syslogger_forkexec(void); static pid_t syslogger_forkexec(void);
static void syslogger_parseArgs(int argc, char *argv[]); static void syslogger_parseArgs(int argc, char *argv[]);
#endif #endif
NON_EXEC_STATIC void SysLoggerMain(int argc, char *argv[]) __attribute__((noreturn));
static void process_pipe_input(char *logbuffer, int *bytes_in_logbuffer); static void process_pipe_input(char *logbuffer, int *bytes_in_logbuffer);
static void flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer); static void flush_pipe_input(char *logbuffer, int *bytes_in_logbuffer);
static void open_csvlogfile(void); static void open_csvlogfile(void);
......
...@@ -120,7 +120,7 @@ static void WalSndLastCycleHandler(SIGNAL_ARGS); ...@@ -120,7 +120,7 @@ static void WalSndLastCycleHandler(SIGNAL_ARGS);
/* Prototypes for private functions */ /* Prototypes for private functions */
static bool HandleReplicationCommand(const char *cmd_string); static bool HandleReplicationCommand(const char *cmd_string);
static int WalSndLoop(void); static void WalSndLoop(void) __attribute__((noreturn));
static void InitWalSnd(void); static void InitWalSnd(void);
static void WalSndHandshake(void); static void WalSndHandshake(void);
static void WalSndKill(int code, Datum arg); static void WalSndKill(int code, Datum arg);
...@@ -135,7 +135,7 @@ static void WalSndKeepalive(char *msgbuf); ...@@ -135,7 +135,7 @@ static void WalSndKeepalive(char *msgbuf);
/* Main entry point for walsender process */ /* Main entry point for walsender process */
int void
WalSenderMain(void) WalSenderMain(void)
{ {
MemoryContext walsnd_context; MemoryContext walsnd_context;
...@@ -192,7 +192,7 @@ WalSenderMain(void) ...@@ -192,7 +192,7 @@ WalSenderMain(void)
SyncRepInitConfig(); SyncRepInitConfig();
/* Main loop of walsender */ /* Main loop of walsender */
return WalSndLoop(); WalSndLoop();
} }
/* /*
...@@ -706,7 +706,7 @@ ProcessStandbyHSFeedbackMessage(void) ...@@ -706,7 +706,7 @@ ProcessStandbyHSFeedbackMessage(void)
} }
/* Main loop of walsender process */ /* Main loop of walsender process */
static int static void
WalSndLoop(void) WalSndLoop(void)
{ {
char *output_message; char *output_message;
...@@ -882,7 +882,7 @@ WalSndLoop(void) ...@@ -882,7 +882,7 @@ WalSndLoop(void)
whereToSendOutput = DestNone; whereToSendOutput = DestNone;
proc_exit(0); proc_exit(0);
return 1; /* keep the compiler quiet */ abort(); /* keep the compiler quiet */
} }
/* Initialize a per-walsender data structure for this walsender process */ /* Initialize a per-walsender data structure for this walsender process */
......
...@@ -3507,7 +3507,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx) ...@@ -3507,7 +3507,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx)
* for the session. * for the session.
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
int void
PostgresMain(int argc, char *argv[], const char *username) PostgresMain(int argc, char *argv[], const char *username)
{ {
const char *dbname; const char *dbname;
...@@ -3721,7 +3721,10 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -3721,7 +3721,10 @@ PostgresMain(int argc, char *argv[], const char *username)
/* If this is a WAL sender process, we're done with initialization. */ /* If this is a WAL sender process, we're done with initialization. */
if (am_walsender) if (am_walsender)
proc_exit(WalSenderMain()); {
WalSenderMain(); /* does not return */
abort();
}
/* /*
* process any libraries that should be preloaded at backend start (this * process any libraries that should be preloaded at backend start (this
...@@ -4199,7 +4202,7 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -4199,7 +4202,7 @@ PostgresMain(int argc, char *argv[], const char *username)
/* can't get here because the above loop never exits */ /* can't get here because the above loop never exits */
Assert(false); Assert(false);
return 1; /* keep compiler quiet */ abort(); /* keep compiler quiet */
} }
......
...@@ -43,7 +43,7 @@ static void printMixedStruct(mixedStruct *structToPrint); ...@@ -43,7 +43,7 @@ static void printMixedStruct(mixedStruct *structToPrint);
static bool displayStruct(mixedStruct *structToDisplay); static bool displayStruct(mixedStruct *structToDisplay);
int void
GucInfoMain(void) GucInfoMain(void)
{ {
struct config_generic **guc_vars; struct config_generic **guc_vars;
...@@ -64,7 +64,7 @@ GucInfoMain(void) ...@@ -64,7 +64,7 @@ GucInfoMain(void)
printMixedStruct(var); printMixedStruct(var);
} }
return 0; exit(0);
} }
......
...@@ -40,7 +40,7 @@ extern Form_pg_attribute attrtypes[MAXATTR]; ...@@ -40,7 +40,7 @@ extern Form_pg_attribute attrtypes[MAXATTR];
extern int numattr; extern int numattr;
extern void AuxiliaryProcessMain(int argc, char *argv[]); extern void AuxiliaryProcessMain(int argc, char *argv[]) __attribute__((noreturn));
extern void err_out(void); extern void err_out(void);
......
...@@ -749,7 +749,7 @@ extern void pgstat_reset_all(void); ...@@ -749,7 +749,7 @@ extern void pgstat_reset_all(void);
extern void allow_immediate_pgstat_restart(void); extern void allow_immediate_pgstat_restart(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void PgstatCollectorMain(int argc, char *argv[]); extern void PgstatCollectorMain(int argc, char *argv[]) __attribute__((noreturn));
#endif #endif
......
...@@ -52,8 +52,8 @@ extern void AutoVacWorkerFailed(void); ...@@ -52,8 +52,8 @@ extern void AutoVacWorkerFailed(void);
extern void AutoVacuumUpdateDelay(void); extern void AutoVacuumUpdateDelay(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void AutoVacLauncherMain(int argc, char *argv[]); extern void AutoVacLauncherMain(int argc, char *argv[]) __attribute__((noreturn));
extern void AutoVacWorkerMain(int argc, char *argv[]); extern void AutoVacWorkerMain(int argc, char *argv[]) __attribute__((noreturn));
extern void AutovacuumWorkerIAm(void); extern void AutovacuumWorkerIAm(void);
extern void AutovacuumLauncherIAm(void); extern void AutovacuumLauncherIAm(void);
#endif #endif
......
...@@ -25,8 +25,8 @@ extern int CheckPointTimeout; ...@@ -25,8 +25,8 @@ extern int CheckPointTimeout;
extern int CheckPointWarning; extern int CheckPointWarning;
extern double CheckPointCompletionTarget; extern double CheckPointCompletionTarget;
extern void BackgroundWriterMain(void); extern void BackgroundWriterMain(void) __attribute__((noreturn));
extern void CheckpointerMain(void); extern void CheckpointerMain(void) __attribute__((noreturn));
extern void RequestCheckpoint(int flags); extern void RequestCheckpoint(int flags);
extern void CheckpointWriteDelay(int flags, double progress); extern void CheckpointWriteDelay(int flags, double progress);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
extern int pgarch_start(void); extern int pgarch_start(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void PgArchiverMain(int argc, char *argv[]); extern void PgArchiverMain(int argc, char *argv[]) __attribute__((noreturn));
#endif #endif
#endif /* _PGARCH_H */ #endif /* _PGARCH_H */
...@@ -46,14 +46,14 @@ extern int postmaster_alive_fds[2]; ...@@ -46,14 +46,14 @@ extern int postmaster_alive_fds[2];
extern const char *progname; extern const char *progname;
extern int PostmasterMain(int argc, char *argv[]); extern void PostmasterMain(int argc, char *argv[]) __attribute__((noreturn));
extern void ClosePostmasterPorts(bool am_syslogger); extern void ClosePostmasterPorts(bool am_syslogger);
extern int MaxLivePostmasterChildren(void); extern int MaxLivePostmasterChildren(void);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern pid_t postmaster_forkexec(int argc, char *argv[]); extern pid_t postmaster_forkexec(int argc, char *argv[]);
extern int SubPostmasterMain(int argc, char *argv[]); extern void SubPostmasterMain(int argc, char *argv[]) __attribute__((noreturn));
extern Size ShmemBackendArraySize(void); extern Size ShmemBackendArraySize(void);
extern void ShmemBackendArrayAllocation(void); extern void ShmemBackendArrayAllocation(void);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define _STARTUP_H #define _STARTUP_H
extern void HandleStartupProcInterrupts(void); extern void HandleStartupProcInterrupts(void);
extern void StartupProcessMain(void); extern void StartupProcessMain(void) __attribute__((noreturn));
extern void PreRestoreCommand(void); extern void PreRestoreCommand(void);
extern void PostRestoreCommand(void); extern void PostRestoreCommand(void);
extern bool IsPromoteTriggered(void); extern bool IsPromoteTriggered(void);
......
...@@ -84,7 +84,7 @@ extern int SysLogger_Start(void); ...@@ -84,7 +84,7 @@ extern int SysLogger_Start(void);
extern void write_syslogger_file(const char *buffer, int count, int dest); extern void write_syslogger_file(const char *buffer, int count, int dest);
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
extern void SysLoggerMain(int argc, char *argv[]); extern void SysLoggerMain(int argc, char *argv[]) __attribute__((noreturn));
#endif #endif
#endif /* _SYSLOGGER_H */ #endif /* _SYSLOGGER_H */
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
/* GUC options */ /* GUC options */
extern int WalWriterDelay; extern int WalWriterDelay;
extern void WalWriterMain(void); extern void WalWriterMain(void) __attribute__((noreturn));
#endif /* _WALWRITER_H */ #endif /* _WALWRITER_H */
...@@ -109,7 +109,7 @@ typedef void (*walrcv_disconnect_type) (void); ...@@ -109,7 +109,7 @@ typedef void (*walrcv_disconnect_type) (void);
extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect; extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect;
/* prototypes for functions in walreceiver.c */ /* prototypes for functions in walreceiver.c */
extern void WalReceiverMain(void); extern void WalReceiverMain(void) __attribute__((noreturn));
/* prototypes for functions in walreceiverfuncs.c */ /* prototypes for functions in walreceiverfuncs.c */
extern Size WalRcvShmemSize(void); extern Size WalRcvShmemSize(void);
......
...@@ -26,7 +26,7 @@ extern volatile sig_atomic_t walsender_ready_to_stop; ...@@ -26,7 +26,7 @@ extern volatile sig_atomic_t walsender_ready_to_stop;
extern int max_wal_senders; extern int max_wal_senders;
extern int replication_timeout; extern int replication_timeout;
extern int WalSenderMain(void); extern void WalSenderMain(void) __attribute__((noreturn));
extern void WalSndSignals(void); extern void WalSndSignals(void);
extern Size WalSndShmemSize(void); extern Size WalSndShmemSize(void);
extern void WalSndShmemInit(void); extern void WalSndShmemInit(void);
......
...@@ -64,7 +64,7 @@ typedef void (*shmem_startup_hook_type) (void); ...@@ -64,7 +64,7 @@ typedef void (*shmem_startup_hook_type) (void);
/* ipc.c */ /* ipc.c */
extern bool proc_exit_inprogress; extern bool proc_exit_inprogress;
extern void proc_exit(int code); extern void proc_exit(int code) __attribute__((noreturn));
extern void shmem_exit(int code); extern void shmem_exit(int code);
extern void on_proc_exit(pg_on_exit_callback function, Datum arg); extern void on_proc_exit(pg_on_exit_callback function, Datum arg);
extern void on_shmem_exit(pg_on_exit_callback function, Datum arg); extern void on_shmem_exit(pg_on_exit_callback function, Datum arg);
......
...@@ -61,7 +61,7 @@ extern bool check_max_stack_depth(int *newval, void **extra, GucSource source); ...@@ -61,7 +61,7 @@ extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
extern void assign_max_stack_depth(int newval, void *extra); extern void assign_max_stack_depth(int newval, void *extra);
extern void die(SIGNAL_ARGS); extern void die(SIGNAL_ARGS);
extern void quickdie(SIGNAL_ARGS); extern void quickdie(SIGNAL_ARGS) __attribute__((noreturn));
extern void StatementCancelHandler(SIGNAL_ARGS); extern void StatementCancelHandler(SIGNAL_ARGS);
extern void FloatExceptionHandler(SIGNAL_ARGS); extern void FloatExceptionHandler(SIGNAL_ARGS);
extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
...@@ -70,7 +70,7 @@ extern void prepare_for_client_read(void); ...@@ -70,7 +70,7 @@ extern void prepare_for_client_read(void);
extern void client_read_ended(void); extern void client_read_ended(void);
extern const char *process_postgres_switches(int argc, char *argv[], extern const char *process_postgres_switches(int argc, char *argv[],
GucContext ctx); GucContext ctx);
extern int PostgresMain(int argc, char *argv[], const char *username); extern void PostgresMain(int argc, char *argv[], const char *username) __attribute__((noreturn));
extern long get_stack_depth_rlimit(void); extern long get_stack_depth_rlimit(void);
extern void ResetUsage(void); extern void ResetUsage(void);
extern void ShowUsage(const char *title); extern void ShowUsage(const char *title);
......
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
#ifndef HELP_CONFIG_H #ifndef HELP_CONFIG_H
#define HELP_CONFIG_H 1 #define HELP_CONFIG_H 1
extern int GucInfoMain(void); extern void GucInfoMain(void) __attribute__((noreturn));
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment