@@ -11,6 +11,8 @@ pub type blkcnt64_t = i64;
11
11
pub type rlim64_t = u64 ;
12
12
pub type fsblkcnt_t = :: c_ulong ;
13
13
pub type fsfilcnt_t = :: c_ulong ;
14
+ pub type key_t = :: c_int ;
15
+ pub type shmatt_t = :: c_ulong ;
14
16
15
17
pub enum fpos64_t { } // TODO: fill this out with a struct
16
18
@@ -287,9 +289,36 @@ pub const SCHED_RR: ::c_int = 2;
287
289
pub const SCHED_BATCH : :: c_int = 3 ;
288
290
pub const SCHED_IDLE : :: c_int = 5 ;
289
291
292
+ pub const IPC_CREAT : :: c_int = 0o1000 ;
293
+ pub const IPC_EXCL : :: c_int = 0o2000 ;
294
+ pub const IPC_NOWAIT : :: c_int = 0o4000 ;
295
+
296
+ pub const IPC_RMID : :: c_int = 0 ;
297
+ pub const IPC_SET : :: c_int = 1 ;
298
+ pub const IPC_STAT : :: c_int = 2 ;
299
+ pub const IPC_INFO : :: c_int = 3 ;
300
+
301
+ pub const SHM_R : :: c_int = 0o400 ;
302
+ pub const SHM_W : :: c_int = 0o200 ;
303
+
304
+ pub const SHM_RDONLY : :: c_int = 0o10000 ;
305
+ pub const SHM_RND : :: c_int = 0o20000 ;
306
+ pub const SHM_REMAP : :: c_int = 0o40000 ;
307
+ pub const SHM_EXEC : :: c_int = 0o100000 ;
308
+
309
+ pub const SHM_LOCK : :: c_int = 11 ;
310
+ pub const SHM_UNLOCK : :: c_int = 12 ;
311
+
312
+ pub const SHM_HUGETLB : :: c_int = 0o4000 ;
313
+ pub const SHM_NORESERVE : :: c_int = 0o10000 ;
314
+
290
315
extern {
291
316
pub fn shm_open ( name : * const c_char , oflag : :: c_int ,
292
317
mode : mode_t ) -> :: c_int ;
318
+ pub fn shmget ( key : :: key_t , size : :: size_t , shmflg : :: c_int ) -> :: c_int ;
319
+ pub fn shmat ( shmid : :: c_int , shmaddr : * const :: c_void , shmflg : :: c_int ) -> * mut :: c_void ;
320
+ pub fn shmdt ( shmaddr : * const :: c_void ) -> :: c_int ;
321
+ pub fn shmctl ( shmid : :: c_int , cmd : :: c_int , buf : * mut :: shmid_ds ) -> :: c_int ;
293
322
pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int )
294
323
-> :: c_int ;
295
324
pub fn __errno_location ( ) -> * mut :: c_int ;
0 commit comments