1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
use super::hugetlb_encode::*;
use super::ipc::*;
use super::types::*;
pub const SHMMIN: i32 = 1;
pub const SHMMNI: i32 = 4096;
pub const SHMMAX: usize = (core::usize::MAX - (1 as usize) << 24);
pub const SHMALL: usize = (core::usize::MAX - (1 as usize) << 24);
pub const SHMSEG: i32 = SHMMNI;
#[repr(C)]
pub struct shmid_ds_t {
pub shm_perm: ipc_perm_t,
pub shm_segsz: i32,
pub shm_atime: time_t,
pub shm_dtime: time_t,
pub shm_ctime: time_t,
pub shm_cpid: ipc_pid_t,
pub shm_lpid: ipc_pid_t,
pub shm_nattch: u16,
shm_unused: u16,
shm_unused2: usize,
shm_unused3: usize,
}
pub const SHM_R: i32 = 0400;
pub const SHM_W: i32 = 0200;
pub const SHM_HUGETLB: i32 = 04000;
pub const SHM_NORESERVE: i32 = 010000;
pub const SHM_HUGE_SHIFT: i32 = HUGETLB_FLAG_ENCODE_SHIFT;
pub const SHM_HUGE_MASK: i32 = HUGETLB_FLAG_ENCODE_MASK;
pub const SHM_HUGE_64KB: usize = HUGETLB_FLAG_ENCODE_64KB;
pub const SHM_HUGE_512KB: usize = HUGETLB_FLAG_ENCODE_512KB;
pub const SHM_HUGE_1MB: usize = HUGETLB_FLAG_ENCODE_1MB;
pub const SHM_HUGE_2MB: usize = HUGETLB_FLAG_ENCODE_2MB;
pub const SHM_HUGE_8MB: usize = HUGETLB_FLAG_ENCODE_8MB;
pub const SHM_HUGE_16MB: usize = HUGETLB_FLAG_ENCODE_16MB;
pub const SHM_HUGE_32MB: usize = HUGETLB_FLAG_ENCODE_32MB;
pub const SHM_HUGE_256MB: usize = HUGETLB_FLAG_ENCODE_256MB;
pub const SHM_HUGE_512MB: usize = HUGETLB_FLAG_ENCODE_512MB;
pub const SHM_HUGE_1GB: usize = HUGETLB_FLAG_ENCODE_1GB;
pub const SHM_HUGE_2GB: usize = HUGETLB_FLAG_ENCODE_2GB;
pub const SHM_HUGE_16GB: usize = HUGETLB_FLAG_ENCODE_16GB;
pub const SHM_RDONLY: i32 = 010000;
pub const SHM_RND: i32 = 020000;
pub const SHM_REMAP: i32 = 040000;
pub const SHM_EXEC: i32 = 0100000;
pub const SHM_LOCK: i32 = 11;
pub const SHM_UNLOCK: i32 = 12;
pub const SHM_STAT: i32 = 13;
pub const SHM_INFO: i32 = 14;
pub const SHM_STAT_ANY: i32 = 15;
#[repr(C)]
pub struct shminfo_t {
pub shmmax: i32,
pub shmmin: i32,
pub shmmni: i32,
pub shmseg: i32,
pub shmall: i32,
}
#[repr(C)]
pub struct shm_info_t {
pub used_ids: i32,
pub shm_tot: usize,
pub shm_rss: usize,
pub shm_swp: usize,
swap_attempts: usize,
swap_successes: usize,
}