#ifndef __SHM_LOADED #define __SHM_LOADED /**************************************************************************** ** ** - System V shared memory system calls ** ***************************************************************************** ** * ** HPE CONFIDENTIAL. This software is confidential proprietary software * ** licensed by Hewlett Packard Enterprise Development, LP, and is not * ** authorized to be used, duplicated or disclosed to anyone without the * ** prior written permission of HPE. * ** Copyright 2012 Hewlett Packard Enterprise Development, LP * ** * ** VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential * ** proprietary software licensed by VMS Software, Inc., and is not * ** authorized to be used, duplicated or disclosed to anyone without * ** the prior written permission of VMS Software, Inc. * ** Copyright 2022 VMS Software, Inc. * ** * ****************************************************************************/ #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. */ #if defined(__clang__) typedef unsigned int shmatt_t; #else typedef unsigned long shmatt_t; #endif /*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 */