@@ -11,9 +11,10 @@ pub type ino64_t = u64;
1111pub type off64_t = i64 ;
1212pub type blkcnt64_t = i64 ;
1313pub type rlim64_t = u64 ;
14- pub type key_t = :: c_int ;
1514pub type shmatt_t = :: c_ulong ;
1615pub type mqd_t = :: c_int ;
16+ pub type msgqnum_t = :: c_ulong ;
17+ pub type msglen_t = :: c_ulong ;
1718pub type nfds_t = :: c_ulong ;
1819pub type nl_item = :: c_int ;
1920
@@ -190,6 +191,17 @@ s! {
190191 pub if_name: * mut :: c_char,
191192 }
192193
194+ // System V IPC
195+ pub struct msginfo {
196+ pub msgpool: :: c_int,
197+ pub msgmap: :: c_int,
198+ pub msgmax: :: c_int,
199+ pub msgmnb: :: c_int,
200+ pub msgmni: :: c_int,
201+ pub msgssz: :: c_int,
202+ pub msgtql: :: c_int,
203+ pub msgseg: :: c_ushort,
204+ }
193205}
194206
195207pub const ABDAY_1 : :: nl_item = 0x20000 ;
@@ -430,6 +442,9 @@ pub const SCHED_RR: ::c_int = 2;
430442pub const SCHED_BATCH : :: c_int = 3 ;
431443pub const SCHED_IDLE : :: c_int = 5 ;
432444
445+ // System V IPC
446+ pub const IPC_PRIVATE : :: key_t = 0 ;
447+
433448pub const IPC_CREAT : :: c_int = 0o1000 ;
434449pub const IPC_EXCL : :: c_int = 0o2000 ;
435450pub const IPC_NOWAIT : :: c_int = 0o4000 ;
@@ -438,6 +453,12 @@ pub const IPC_RMID: ::c_int = 0;
438453pub const IPC_SET : :: c_int = 1 ;
439454pub const IPC_STAT : :: c_int = 2 ;
440455pub const IPC_INFO : :: c_int = 3 ;
456+ pub const MSG_STAT : :: c_int = 11 ;
457+ pub const MSG_INFO : :: c_int = 12 ;
458+
459+ pub const MSG_NOERROR : :: c_int = 0o10000 ;
460+ pub const MSG_EXCEPT : :: c_int = 0o20000 ;
461+ pub const MSG_COPY : :: c_int = 0o40000 ;
441462
442463pub const SHM_R : :: c_int = 0o400 ;
443464pub const SHM_W : :: c_int = 0o200 ;
@@ -522,6 +543,8 @@ extern {
522543 pub fn getpwent ( ) -> * mut passwd ;
523544 pub fn shm_open ( name : * const c_char , oflag : :: c_int ,
524545 mode : mode_t ) -> :: c_int ;
546+
547+ // System V IPC
525548 pub fn shmget ( key : :: key_t , size : :: size_t , shmflg : :: c_int ) -> :: c_int ;
526549 pub fn shmat ( shmid : :: c_int ,
527550 shmaddr : * const :: c_void ,
@@ -530,6 +553,14 @@ extern {
530553 pub fn shmctl ( shmid : :: c_int ,
531554 cmd : :: c_int ,
532555 buf : * mut :: shmid_ds ) -> :: c_int ;
556+ pub fn ftok ( pathname : * const :: c_char , proj_id : :: c_int ) -> :: key_t ;
557+ pub fn msgctl ( msqid : :: c_int , cmd : :: c_int , buf : * mut msqid_ds ) -> :: c_int ;
558+ pub fn msgget ( key : :: key_t , msgflg : :: c_int ) -> :: c_int ;
559+ pub fn msgrcv ( msqid : :: c_int , msgp : * mut :: c_void , msgsz : :: size_t ,
560+ msgtyp : :: c_long , msgflg : :: c_int ) -> :: ssize_t ;
561+ pub fn msgsnd ( msqid : :: c_int , msgp : * const :: c_void , msgsz : :: size_t ,
562+ msgflg : :: c_int ) -> :: c_int ;
563+
533564 pub fn mprotect ( addr : * mut :: c_void , len : :: size_t , prot : :: c_int )
534565 -> :: c_int ;
535566 pub fn __errno_location ( ) -> * mut :: c_int ;
0 commit comments