#ifndef __SHM_LOADED #define __SHM_LOADED /**************************************************************************** ** ** - System V shared memory system calls ** ***************************************************************************** ** ** Copyright 2012 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries required for possession, use, or copying. ** ** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, ** Computer Software Documentation, and Technical Data for Commercial ** Items are licensed to the U.S. Government under vendor's standard ** commercial license. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 64 #endif #include #if !defined __PID_T && !defined _DECC_V4_SOURCE # define __PID_T 1 typedef __pid_t pid_t; #endif #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE # ifndef __TIME_T # define __TIME_T 1 #ifdef __NAMESPACE_STD namespace std { #endif typedef __time_t time_t; #ifdef __NAMESPACE_STD } /* namespace std */ using std::time_t; #endif # endif #endif #if !defined __SIZE_T && !defined _DECC_V4_SOURCE # define __SIZE_T 1 #ifdef __NAMESPACE_STD namespace std { #endif typedef __size_t size_t; #ifdef __NAMESPACE_STD } /* namespace std */ using std::size_t; #endif #endif /* Flags for `shmat'. */ #define SHM_RDONLY 010000 /* attach read-only else read-write */ #define SHM_RND 020000 /* round attach address to SHMLBA */ /* Segment low boundary address multiple. */ #define SHMLBA 0X2000 /* Type to count number of attaches. */ typedef unsigned long int shmatt_t; /*data structure used to store shared memory details*/ struct shmid_ds { struct ipc_perm shm_perm; /*permissions structure*/ size_t shm_segsz; /*size of memory segment in bytes*/ pid_t shm_lpid; /*Process ID of last memory operation*/ pid_t shm_cpid; /*Process ID of segment creator*/ shmatt_t shm_nattch; /*Number of current attaches*/ time_t shm_atime; /*time of last shmat()*/ time_t shm_dtime; /*time of last shmdt()*/ time_t shm_ctime; /*time of last change */ }; /* shared memory get operation */ int shmget(key_t key, size_t size, int shmflg); /*shared memory attach operation*/ void* shmat(int shmid,const void *shmaddr,int shmflg); /* shared memory control operations */ int shmctl(int shmid, int cmd, struct shmid_ds *buf); /* shared memory detach operations */ int shmdt(const void *shmaddr); /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __SHM_LOADED */