@@ -34,6 +34,7 @@ pub type nl_item = ::c_int;
34
34
pub type mqd_t = * mut :: c_void ;
35
35
pub type id_t = :: c_int ;
36
36
pub type idtype_t = :: c_uint ;
37
+ pub type shmatt_t = :: c_ulong ;
37
38
38
39
pub type door_attr_t = :: c_uint ;
39
40
pub type door_id_t = :: c_ulonglong ;
57
58
pub imr_interface: in_addr,
58
59
}
59
60
61
+ pub struct ipc_perm {
62
+ pub uid: :: uid_t,
63
+ pub gid: :: gid_t,
64
+ pub cuid: :: uid_t,
65
+ pub cgid: :: gid_t,
66
+ pub mode: :: mode_t,
67
+ pub seq: :: c_uint,
68
+ pub key: :: key_t,
69
+ }
70
+
60
71
pub struct sockaddr {
61
72
pub sa_family: sa_family_t,
62
73
pub sa_data: [ :: c_char; 14 ] ,
@@ -206,6 +217,24 @@ s! {
206
217
pub ai_next: * mut addrinfo,
207
218
}
208
219
220
+ pub struct shmid_ds {
221
+ pub shm_perm: ipc_perm,
222
+ pub shm_segsz: :: size_t,
223
+ pub shm_flags: :: uintptr_t,
224
+ pub shm_lkcnt: :: c_ushort,
225
+ pub shm_lpid: :: pid_t,
226
+ pub shm_cpid: :: pid_t,
227
+ pub shm_nattch: :: shmatt_t,
228
+ pub shm_cnattch: :: c_ulong,
229
+ pub shm_atime: :: time_t,
230
+ pub shm_dtime: :: time_t,
231
+ pub shm_ctime: :: time_t,
232
+ pub shm_amp: * mut :: c_void,
233
+ pub shm_gransize: u64 ,
234
+ pub shm_allocated: u64 ,
235
+ pub shm_pad4: [ i64 ; 1 ] ,
236
+ }
237
+
209
238
pub struct sigset_t {
210
239
bits: [ u32 ; 4 ] ,
211
240
}
@@ -1352,6 +1381,16 @@ pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts
1352
1381
pub const IFF_DUPLICATE : :: c_longlong = 0x4000000000 ; // Local address in use
1353
1382
pub const IFF_IPMP : :: c_longlong = 0x8000000000 ; // IPMP IP interface
1354
1383
1384
+ // sys/ipc.h:
1385
+ pub const IPC_ALLOC : :: c_int = 0x8000 ;
1386
+ pub const IPC_CREAT : :: c_int = 0x200 ;
1387
+ pub const IPC_EXCL : :: c_int = 0x400 ;
1388
+ pub const IPC_NOWAIT : :: c_int = 0x800 ;
1389
+ pub const IPC_PRIVATE : key_t = 0 ;
1390
+ pub const IPC_RMID : :: c_int = 10 ;
1391
+ pub const IPC_SET : :: c_int = 11 ;
1392
+ pub const IPC_SEAT : :: c_int = 12 ;
1393
+
1355
1394
pub const SHUT_RD : :: c_int = 0 ;
1356
1395
pub const SHUT_WR : :: c_int = 1 ;
1357
1396
pub const SHUT_RDWR : :: c_int = 2 ;
@@ -2011,6 +2050,16 @@ extern "C" {
2011
2050
advice : :: c_int ,
2012
2051
) -> :: c_int ;
2013
2052
2053
+ pub fn shmat ( shmid : :: c_int , shmaddr : * const :: c_void ,
2054
+ shmflg : :: c_int ) -> * mut :: c_void ;
2055
+
2056
+ pub fn shmctl ( shmid : :: c_int , cmd : :: c_int ,
2057
+ buf : * mut :: shmid_ds ) -> :: c_int ;
2058
+
2059
+ pub fn shmdt ( shmaddr : * const :: c_void ) -> :: c_int ;
2060
+
2061
+ pub fn shmget ( key : key_t , size : :: size_t , shmflg : :: c_int ) -> :: c_int ;
2062
+
2014
2063
pub fn shm_open (
2015
2064
name : * const :: c_char ,
2016
2065
oflag : :: c_int ,
0 commit comments