1 #ifndef _SYS_SHM_H 2 #define _SYS_SHM_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <features.h> 9 10 #define __NEED_time_t 11 #define __NEED_size_t 12 #define __NEED_pid_t 13 14 #include <bits/alltypes.h> 15 16 #include <sys/ipc.h> 17 18 #ifdef _GNU_SOURCE 19 #define __used_ids used_ids 20 #define __swap_attempts swap_attempts 21 #define __swap_successes swap_successes 22 #endif 23 24 #include <bits/shm.h> 25 26 #define SHM_R 0400 27 #define SHM_W 0200 28 29 #define SHM_RDONLY 010000 30 #define SHM_RND 020000 31 #define SHM_REMAP 040000 32 #define SHM_EXEC 0100000 33 34 #define SHM_LOCK 11 35 #define SHM_UNLOCK 12 36 #define SHM_STAT (13 | (IPC_STAT & 0x100)) 37 #define SHM_INFO 14 38 #define SHM_STAT_ANY (15 | (IPC_STAT & 0x100)) 39 #define SHM_DEST 01000 40 #define SHM_LOCKED 02000 41 #define SHM_HUGETLB 04000 42 #define SHM_NORESERVE 010000 43 44 #define SHM_HUGE_SHIFT 26 45 #define SHM_HUGE_MASK 0x3f 46 #define SHM_HUGE_64KB (16 << 26) 47 #define SHM_HUGE_512KB (19 << 26) 48 #define SHM_HUGE_1MB (20 << 26) 49 #define SHM_HUGE_2MB (21 << 26) 50 #define SHM_HUGE_8MB (23 << 26) 51 #define SHM_HUGE_16MB (24 << 26) 52 #define SHM_HUGE_32MB (25 << 26) 53 #define SHM_HUGE_256MB (28 << 26) 54 #define SHM_HUGE_512MB (29 << 26) 55 #define SHM_HUGE_1GB (30 << 26) 56 #define SHM_HUGE_2GB (31 << 26) 57 #define SHM_HUGE_16GB (34U << 26) 58 59 typedef unsigned long shmatt_t; 60 61 void *shmat(int, const void *, int); 62 int shmctl(int, int, struct shmid_ds *); 63 int shmdt(const void *); 64 int shmget(key_t, size_t, int); 65 66 #ifdef __cplusplus 67 } 68 #endif 69 70 #endif 71