#include <sys/shm.h>
sys/shm.h
$NetBSD: shm.h,v 1.15 1994/06/29 06:45:17 cgd Exp $
typedefshmatt_t
[XSI] The unsigned integer type used for the number of current attaches
that MUST be able to store values at least as large as a type unsigned
short.
typedef unsigned short shmatt_t
macroSHM_RDONLY
Possible flag values which may be OR'ed into the third argument to
shmat()
#define SHM_RDONLY 010000
[XSI] Attach read-only (else read-write)
macroSHMLBA
This value is symbolic, and generally not expected to be sed by user
programs directly, although such ise is permitted by the standard. Its
value in our implementation is equal to the number of bytes per page.
NOTE: We DO NOT obtain this value from the appropriate system
headers at this time, to avoid the resulting namespace
pollution, which is why we discourages its use.
#define SHMLBA (16*1024)
[XSI] Segment low boundary address multiple
macroSHM_R
"official" access mode definitions; somewhat braindead since you have
to specify (SHM_* >> 3) for group and (SHM_* >> 6) for world permissions
#define SHM_R (IPC_R)
macroshmid_ds
#define shmid_ds __shmid_ds_new
struct__shmid_ds_new
| struct ipc_perm | shm_perm | [XSI] Operation permission value |
| size_t | shm_segsz | [XSI] Size of segment in bytes |
| pid_t | shm_lpid | [XSI] PID of last shared memory op |
| pid_t | shm_cpid | [XSI] PID of creator |
| shmatt_t | shm_nattch | [XSI] Number of current attaches |
| time_t | shm_atime | [XSI] Time of last shmat() |
| time_t | shm_dtime | [XSI] Time of last shmdt() |
| time_t | shm_ctime | [XSI] Time of last shmctl() change |
| void * | shm_internal | reserved for kernel use |
functionshmsys
int shmsys(int, ...)
functionshmat
void *shmat(int, const void *, int)
man page · August 17, 1995
shmat(2) — map/unmap shared memoryfunctionshmctl
__DARWIN_ALIAS(shmctl) int shmctl(int, int, struct shmid_ds *)
man page · August 17, 1995
shmctl(2) — shared memory control operations⚠ the man page prototype differs from the current header — man:
int shmctl(int, int, struct shmid_ds*) · header: int shmctl(int, int, struct __shmid_ds_new*)