00001 /*------------------------------------------------------------------------- 00002 * 00003 * procsignal.h 00004 * Routines for interprocess signalling 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * src/include/storage/procsignal.h 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 #ifndef PROCSIGNAL_H 00015 #define PROCSIGNAL_H 00016 00017 #include "storage/backendid.h" 00018 00019 00020 /* 00021 * Reasons for signalling a Postgres child process (a backend or an auxiliary 00022 * process, like checkpointer). We can cope with concurrent signals for different 00023 * reasons. However, if the same reason is signaled multiple times in quick 00024 * succession, the process is likely to observe only one notification of it. 00025 * This is okay for the present uses. 00026 * 00027 * Also, because of race conditions, it's important that all the signals be 00028 * defined so that no harm is done if a process mistakenly receives one. 00029 */ 00030 typedef enum 00031 { 00032 PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */ 00033 PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */ 00034 00035 /* Recovery conflict reasons */ 00036 PROCSIG_RECOVERY_CONFLICT_DATABASE, 00037 PROCSIG_RECOVERY_CONFLICT_TABLESPACE, 00038 PROCSIG_RECOVERY_CONFLICT_LOCK, 00039 PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, 00040 PROCSIG_RECOVERY_CONFLICT_BUFFERPIN, 00041 PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK, 00042 00043 NUM_PROCSIGNALS /* Must be last! */ 00044 } ProcSignalReason; 00045 00046 /* 00047 * prototypes for functions in procsignal.c 00048 */ 00049 extern Size ProcSignalShmemSize(void); 00050 extern void ProcSignalShmemInit(void); 00051 00052 extern void ProcSignalInit(int pss_idx); 00053 extern int SendProcSignal(pid_t pid, ProcSignalReason reason, 00054 BackendId backendId); 00055 00056 extern void procsignal_sigusr1_handler(SIGNAL_ARGS); 00057 00058 #endif /* PROCSIGNAL_H */
1.7.1