| /*------------------------------------------------------------------------- | |
| * | |
| * dsm_impl.h | |
| * low-level dynamic shared memory primitives | |
| * | |
| * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group | |
| * Portions Copyright (c) 1994, Regents of the University of California | |
| * | |
| * src/include/storage/dsm_impl.h | |
| * | |
| *------------------------------------------------------------------------- | |
| */ | |
| /* Dynamic shared memory implementations. */ | |
| /* | |
| * Determine which dynamic shared memory implementations will be supported | |
| * on this platform, and which one will be the default. | |
| */ | |
| /* GUC. */ | |
| extern PGDLLIMPORT int dynamic_shared_memory_type; | |
| extern PGDLLIMPORT int min_dynamic_shared_memory; | |
| /* | |
| * Directory for on-disk state. | |
| * | |
| * This is used by all implementations for crash recovery and by the mmap | |
| * implementation for storage. | |
| */ | |
| /* A "name" for a dynamic shared memory segment. */ | |
| typedef uint32 dsm_handle; | |
| /* Sentinel value to use for invalid DSM handles. */ | |
| /* All the shared-memory operations we know about. */ | |
| typedef enum | |
| { | |
| DSM_OP_CREATE, | |
| DSM_OP_ATTACH, | |
| DSM_OP_DETACH, | |
| DSM_OP_DESTROY | |
| } dsm_op; | |
| /* Create, attach to, detach from, resize, or destroy a segment. */ | |
| extern bool dsm_impl_op(dsm_op op, dsm_handle handle, Size request_size, | |
| void **impl_private, void **mapped_address, Size *mapped_size, | |
| int elevel); | |
| /* Implementation-dependent actions required to keep segment until shutdown. */ | |
| extern void dsm_impl_pin_segment(dsm_handle handle, void *impl_private, | |
| void **impl_private_pm_handle); | |
| extern void dsm_impl_unpin_segment(dsm_handle handle, void **impl_private); | |