@@ -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,33 @@ 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
+ #[ cfg( target_os = "illumos" ) ]
224
+ pub shm_amp: * mut :: c_void,
225
+ #[ cfg( target_os = "solaris" ) ]
226
+ pub shm_flags: :: uintptr_t,
227
+ pub shm_lkcnt: :: c_ushort,
228
+ pub shm_lpid: :: pid_t,
229
+ pub shm_cpid: :: pid_t,
230
+ pub shm_nattch: :: shmatt_t,
231
+ pub shm_cnattch: :: c_ulong,
232
+ pub shm_atime: :: time_t,
233
+ pub shm_dtime: :: time_t,
234
+ pub shm_ctime: :: time_t,
235
+ #[ cfg( target_os = "illumos" ) ]
236
+ pub shm_pad4: [ i64 ; 4 ] ,
237
+ #[ cfg( target_os = "solaris" ) ]
238
+ pub shm_amp: * mut :: c_void,
239
+ #[ cfg( target_os = "solaris" ) ]
240
+ pub shm_gransize: u64 ,
241
+ #[ cfg( target_os = "solaris" ) ]
242
+ pub shm_allocated: u64 ,
243
+ #[ cfg( target_os = "solaris" ) ]
244
+ pub shm_pad4: [ i64 ; 1 ] ,
245
+ }
246
+
209
247
pub struct sigset_t {
210
248
bits: [ u32 ; 4 ] ,
211
249
}
@@ -1066,6 +1104,7 @@ pub const MAP_PRIVATE: ::c_int = 0x0002;
1066
1104
pub const MAP_FIXED : :: c_int = 0x0010 ;
1067
1105
pub const MAP_NORESERVE : :: c_int = 0x40 ;
1068
1106
pub const MAP_ANON : :: c_int = 0x0100 ;
1107
+ pub const MAP_ANONYMOUS : :: c_int = 0x0100 ;
1069
1108
pub const MAP_RENAME : :: c_int = 0x20 ;
1070
1109
pub const MAP_ALIGN : :: c_int = 0x200 ;
1071
1110
pub const MAP_TEXT : :: c_int = 0x400 ;
@@ -1437,6 +1476,16 @@ pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts
1437
1476
pub const IFF_DUPLICATE : :: c_longlong = 0x4000000000 ; // Local address in use
1438
1477
pub const IFF_IPMP : :: c_longlong = 0x8000000000 ; // IPMP IP interface
1439
1478
1479
+ // sys/ipc.h:
1480
+ pub const IPC_ALLOC : :: c_int = 0x8000 ;
1481
+ pub const IPC_CREAT : :: c_int = 0x200 ;
1482
+ pub const IPC_EXCL : :: c_int = 0x400 ;
1483
+ pub const IPC_NOWAIT : :: c_int = 0x800 ;
1484
+ pub const IPC_PRIVATE : key_t = 0 ;
1485
+ pub const IPC_RMID : :: c_int = 10 ;
1486
+ pub const IPC_SET : :: c_int = 11 ;
1487
+ pub const IPC_SEAT : :: c_int = 12 ;
1488
+
1440
1489
pub const SHUT_RD : :: c_int = 0 ;
1441
1490
pub const SHUT_WR : :: c_int = 1 ;
1442
1491
pub const SHUT_RDWR : :: c_int = 2 ;
@@ -2119,6 +2168,22 @@ extern "C" {
2119
2168
advice : :: c_int ,
2120
2169
) -> :: c_int ;
2121
2170
2171
+ pub fn shmat (
2172
+ shmid : :: c_int ,
2173
+ shmaddr : * const :: c_void ,
2174
+ shmflg : :: c_int ,
2175
+ ) -> * mut :: c_void ;
2176
+
2177
+ pub fn shmctl (
2178
+ shmid : :: c_int ,
2179
+ cmd : :: c_int ,
2180
+ buf : * mut :: shmid_ds ,
2181
+ ) -> :: c_int ;
2182
+
2183
+ pub fn shmdt ( shmaddr : * const :: c_void ) -> :: c_int ;
2184
+
2185
+ pub fn shmget ( key : key_t , size : :: size_t , shmflg : :: c_int ) -> :: c_int ;
2186
+
2122
2187
pub fn shm_open (
2123
2188
name : * const :: c_char ,
2124
2189
oflag : :: c_int ,
0 commit comments