1 /*-------------------------------------------------------------------------
4 * Platform-independent API for shared memory support.
6 * Every port is expected to support shared memory with approximately
7 * SysV-ish semantics; in particular, a memory block is not anonymous
8 * but has an ID, and we must be able to tell whether there are any
9 * remaining processes attached to a block of a specified ID.
11 * To simplify life for the SysV implementation, the ID is assumed to
12 * consist of two unsigned long values (these are key and ID in SysV
13 * terms). Other platforms may ignore the second value if they need
17 * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
18 * Portions Copyright (c) 1994, Regents of the University of California
20 * $Id: pg_shmem.h,v 1.2 2002/06/20 20:29:52 momjian Exp $
22 *-------------------------------------------------------------------------
27 #include <sys/types.h>
30 typedef struct PGShmemHeader /* standard header for all Postgres shmem */
32 int32 magic; /* magic # to identify Postgres segments */
33 #define PGShmemMagic 679834892
34 pid_t creatorPID; /* PID of creating process */
35 uint32 totalsize; /* total size of segment */
36 uint32 freeoffset; /* offset to first free space */
40 extern PGShmemHeader *PGSharedMemoryCreate(uint32 size, bool makePrivate,
42 extern bool PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2);
44 #endif /* PG_SHMEM_H */