diff options
| author | Tom Lane | 2004-11-09 21:30:18 +0000 |
|---|---|---|
| committer | Tom Lane | 2004-11-09 21:30:18 +0000 |
| commit | 8f6278d907466454abdeead00d99efab308a74dc (patch) | |
| tree | 8455c457f64fce67a26ff09b41a6c0fe2fa2b856 /src/include | |
| parent | 58825b8cd67e02b00393cc0c80421cc53fe51601 (diff) | |
Put in place some defenses against being fooled by accidental match of
shared memory segment ID. If we can't access the existing shmem segment,
it must not be relevant to our data directory. If we can access it,
then attach to it and check for an actual match to the data directory.
This should avoid some cases of failure-to-restart-after-boot without
introducing any significant risk of failing to detect a still-running
old backend.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/storage/pg_shmem.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/storage/pg_shmem.h b/src/include/storage/pg_shmem.h index 126e977b9e..8b13ece9fe 100644 --- a/src/include/storage/pg_shmem.h +++ b/src/include/storage/pg_shmem.h @@ -17,7 +17,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/pg_shmem.h,v 1.11 2004/08/29 04:13:10 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/pg_shmem.h,v 1.12 2004/11/09 21:30:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,14 @@ typedef struct PGShmemHeader /* standard header for all Postgres shmem */ { int32 magic; /* magic # to identify Postgres segments */ -#define PGShmemMagic 679834892 +#define PGShmemMagic 679834893 pid_t creatorPID; /* PID of creating process */ uint32 totalsize; /* total size of segment */ uint32 freeoffset; /* offset to first free space */ +#ifndef WIN32 /* Windows doesn't have useful inode#s */ + dev_t device; /* device data directory is on */ + ino_t inode; /* inode number of data directory */ +#endif } PGShmemHeader; |
