/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* */ #ifndef __XR_sys_shm_h #define __XR_sys_shm_h #include #include #include #include /* * Shared Memory Operation Flags. */ #define XR_SHM_RDONLY 010000 /* attach read-only (else read-write) */ #define XR_SHM_RND 020000 /* round attach address to SHMLBA */ /* * Shmctl Command Definitions. */ #define XR_SHM_LOCK 3 /* Lock segment in core */ #define XR_SHM_UNLOCK 4 /* Unlock segment */ /* * Implementation Constants. */ #define XR_SHMLBA 0x1000 /* segment low boundary address multiple */ /* (SHMLBA must be a power of 2) */ /* * Structure Definitions. */ /* * There is a shared mem id data structure for each segment in the system. */ struct XR_shmid_ds { struct XR_ipc_perm shm_perm; /* operation permission struct */ unsigned int shm_segsz; /* size of segment in bytes */ unsigned short shm_lpid; /* pid of last shmop */ unsigned short shm_cpid; /* pid of creator */ unsigned short shm_nattch; /* number of current attaches */ XR_time_t shm_atime; /* last shmat time */ XR_time_t shm_dtime; /* last shmdt time */ XR_time_t shm_ctime; /* last change time */ void *shm_amp; /* segment anon_map pointer */ }; #if defined(PCR_OS_SUNOS4) # define XR_sys_shm_FlagsToHost(flags) (flags) # define XR_sys_shm_CmdToHost(cmd) (cmd) extern void XR_sys_shm_DSToHost(struct shmid_ds *hds, struct XR_shmid_ds *xds); extern void XR_sys_shm_DSFromHost(struct XR_shmid_ds *xds, struct shmid_ds *hds); #elif defined(PCR_OS_SUNOS5) # define XR_sys_shm_FlagsToHost(flags) (flags) extern int XR_sys_shm_CmdToHost(int cmd); extern void XR_sys_shm_DSToHost(struct shmid_ds *hds, struct XR_shmid_ds *xds); extern void XR_sys_shm_DSFromHost(struct XR_shmid_ds *xds, struct shmid_ds *hds); #else # error os ? #endif #endif /*!__XR_sys_shm_h*/