]> granicus.if.org Git - postgresql/blobdiff - src/include/miscadmin.h
Remove leftovers of BeOS port
[postgresql] / src / include / miscadmin.h
index 382a5deced44b245a724c026e25ec62ed3465281..b186eed8f478ae66ca1fde3ee8f08e613d97c54d 100644 (file)
@@ -10,7 +10,7 @@
  *       Over time, this has also become the preferred place for widely known
  *       resource-limitation stuff, such as work_mem and check_stack_depth().
  *
- * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * src/include/miscadmin.h
  * course, only if the interrupt holdoff counter is zero).     See the
  * related code for details.
  *
+ * A lost connection is handled similarly, although the loss of connection
+ * does not raise a signal, but is detected when we fail to write to the
+ * socket. If there was a signal for a broken connection, we could make use of
+ * it by setting ClientConnectionLost in the signal handler.
+ *
  * A related, but conceptually distinct, mechanism is the "critical section"
  * mechanism.  A critical section not only holds off cancel/die interrupts,
  * but causes any ereport(ERROR) or ereport(FATAL) to become ereport(PANIC)
@@ -70,6 +75,8 @@ extern PGDLLIMPORT volatile bool InterruptPending;
 extern volatile bool QueryCancelPending;
 extern volatile bool ProcDiePending;
 
+extern volatile bool ClientConnectionLost;
+
 /* these are marked volatile because they are examined by signal handlers: */
 extern volatile bool ImmediateInterruptOK;
 extern PGDLLIMPORT volatile uint32 InterruptHoldoffCount;
@@ -124,6 +131,7 @@ do { \
 extern pid_t PostmasterPid;
 extern bool IsPostmasterEnvironment;
 extern PGDLLIMPORT bool IsUnderPostmaster;
+extern bool IsBinaryUpgrade;
 
 extern bool ExitOnAnyError;
 
@@ -229,11 +237,28 @@ extern int        VacuumCostPageDirty;
 extern int     VacuumCostLimit;
 extern int     VacuumCostDelay;
 
+extern int     VacuumPageHit;
+extern int     VacuumPageMiss;
+extern int     VacuumPageDirty;
+
 extern int     VacuumCostBalance;
 extern bool VacuumCostActive;
 
 
 /* in tcop/postgres.c */
+
+#if defined(__ia64__) || defined(__ia64)
+typedef struct
+{
+       char       *stack_base_ptr;
+       char       *register_stack_base_ptr;
+} pg_stack_base_t;
+#else
+typedef char *pg_stack_base_t;
+#endif
+
+extern pg_stack_base_t set_stack_base(void);
+extern void restore_stack_base(pg_stack_base_t base);
 extern void check_stack_depth(void);
 
 /* in tcop/utility.c */
@@ -348,11 +373,35 @@ extern PGDLLIMPORT bool process_shared_preload_libraries_in_progress;
 extern char *shared_preload_libraries_string;
 extern char *local_preload_libraries_string;
 
-#define LOCK_FILE_LINES                7
+/*
+ * As of 9.1, the contents of the data-directory lock file are:
+ *
+ * line #
+ *             1       postmaster PID (or negative of a standalone backend's PID)
+ *             2       data directory path
+ *             3       postmaster start timestamp (time_t representation)
+ *             4       port number
+ *             5       socket directory path (empty on Windows)
+ *             6       first listen_address (IP address or "*"; empty if no TCP port)
+ *             7       shared memory key (not present on Windows)
+ *
+ * Lines 6 and up are added via AddToDataDirLockFile() after initial file
+ * creation; they have to be ordered according to time of addition.
+ *
+ * The socket lock file, if used, has the same contents as lines 1-5.
+ */
+#define LOCK_FILE_LINE_PID                     1
+#define LOCK_FILE_LINE_DATA_DIR                2
+#define LOCK_FILE_LINE_START_TIME      3
+#define LOCK_FILE_LINE_PORT                    4
+#define LOCK_FILE_LINE_SOCKET_DIR      5
+#define LOCK_FILE_LINE_LISTEN_ADDR     6
+#define LOCK_FILE_LINE_SHMEM_KEY       7
+
 extern void CreateDataDirLockFile(bool amPostmaster);
 extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster);
 extern void TouchSocketLockFile(void);
-extern void AddToLockFile(int target_line, const char *str);
+extern void AddToDataDirLockFile(int target_line, const char *str);
 extern void ValidatePgVersion(const char *path);
 extern void process_shared_preload_libraries(void);
 extern void process_local_preload_libraries(void);