@@ -11,6 +11,8 @@ pub type blkcnt64_t = i64;
1111pub type rlim64_t = u64 ;
1212pub type fsblkcnt_t = :: c_ulong ;
1313pub type fsfilcnt_t = :: c_ulong ;
14+ pub type key_t = :: c_int ;
15+ pub type shmatt_t = :: c_ulong ;
1416
1517pub enum fpos64_t { } // TODO: fill this out with a struct
1618
@@ -287,9 +289,36 @@ pub const SCHED_RR: ::c_int = 2;
287289pub const SCHED_BATCH : :: c_int = 3 ;
288290pub const SCHED_IDLE : :: c_int = 5 ;
289291
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+
290315extern {
291316 pub fn shm_open ( name : * const c_char , oflag : :: c_int ,
292317 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 ;
293322 pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int )
294323 -> :: c_int ;
295324 pub fn __errno_location ( ) -> * mut :: c_int ;
0 commit comments