1 /* 2 * This file is auto-generated. Modifications will be lost. 3 * 4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ 5 * for more information. 6 */ 7 #ifndef _UAPI_LINUX_SHM_H_ 8 #define _UAPI_LINUX_SHM_H_ 9 #include <linux/ipc.h> 10 #include <linux/errno.h> 11 #include <asm-generic/hugetlb_encode.h> 12 #include <unistd.h> 13 #define SHMMIN 1 14 #define SHMMNI 4096 15 #define SHMMAX (ULONG_MAX - (1UL << 24)) 16 #define SHMALL (ULONG_MAX - (1UL << 24)) 17 #define SHMSEG SHMMNI 18 struct __kernel_legacy_shmid_ds { 19 struct __kernel_legacy_ipc_perm shm_perm; 20 int shm_segsz; 21 __kernel_old_time_t shm_atime; 22 __kernel_old_time_t shm_dtime; 23 __kernel_old_time_t shm_ctime; 24 __kernel_ipc_pid_t shm_cpid; 25 __kernel_ipc_pid_t shm_lpid; 26 unsigned short shm_nattch; 27 unsigned short shm_unused; 28 void * shm_unused2; 29 void * shm_unused3; 30 }; 31 #include <asm/shmbuf.h> 32 #define SHM_R 0400 33 #define SHM_W 0200 34 #define SHM_HUGETLB 04000 35 #define SHM_NORESERVE 010000 36 #define SHM_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT 37 #define SHM_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK 38 #define SHM_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB 39 #define SHM_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB 40 #define SHM_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB 41 #define SHM_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB 42 #define SHM_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB 43 #define SHM_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB 44 #define SHM_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB 45 #define SHM_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB 46 #define SHM_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB 47 #define SHM_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB 48 #define SHM_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB 49 #define SHM_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB 50 #define SHM_RDONLY 010000 51 #define SHM_RND 020000 52 #define SHM_REMAP 040000 53 #define SHM_EXEC 0100000 54 #define SHM_LOCK 11 55 #define SHM_UNLOCK 12 56 #define SHM_STAT 13 57 #define SHM_INFO 14 58 #define SHM_STAT_ANY 15 59 struct shminfo { 60 int shmmax; 61 int shmmin; 62 int shmmni; 63 int shmseg; 64 int shmall; 65 }; 66 struct shm_info { 67 int used_ids; 68 __kernel_ulong_t shm_tot; 69 __kernel_ulong_t shm_rss; 70 __kernel_ulong_t shm_swp; 71 __kernel_ulong_t swap_attempts; 72 __kernel_ulong_t swap_successes; 73 }; 74 #endif 75