1
1
pub type c_char = i8 ;
2
2
pub type c_long = i64 ;
3
3
pub type c_ulong = u64 ;
4
+ pub type caddr_t = * mut :: c_char ;
4
5
5
6
pub type clockid_t = :: c_int ;
6
7
pub type blkcnt_t = :: c_long ;
@@ -36,9 +37,6 @@ pub type id_t = ::c_int;
36
37
pub type idtype_t = :: c_uint ;
37
38
pub type shmatt_t = :: c_ulong ;
38
39
39
- pub type door_attr_t = :: c_uint ;
40
- pub type door_id_t = :: c_ulonglong ;
41
-
42
40
#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
43
41
pub enum timezone { }
44
42
impl :: Copy for timezone { }
@@ -217,33 +215,6 @@ s! {
217
215
pub ai_next: * mut addrinfo,
218
216
}
219
217
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
-
247
218
pub struct sigset_t {
248
219
bits: [ u32 ; 4 ] ,
249
220
}
371
342
pub mq_maxmsg: :: c_long,
372
343
pub mq_msgsize: :: c_long,
373
344
pub mq_curmsgs: :: c_long,
374
- _pad: [ :: c_int; 4 ]
345
+ _pad: [ :: c_int; 12 ]
375
346
}
376
347
377
348
pub struct port_event {
@@ -382,11 +353,6 @@ s! {
382
353
pub portev_user: * mut :: c_void,
383
354
}
384
355
385
- pub struct door_desc_t__d_data__d_desc {
386
- pub d_descriptor: :: c_int,
387
- pub d_id: :: door_id_t
388
- }
389
-
390
356
pub struct exit_status {
391
357
e_termination: :: c_short,
392
358
e_exit: :: c_short,
@@ -431,7 +397,14 @@ s! {
431
397
}
432
398
433
399
s_no_extra_traits ! {
434
- #[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , repr( packed) ) ]
400
+ #[ cfg_attr( all(
401
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
402
+ libc_packedN
403
+ ) , repr( packed( 4 ) ) ) ]
404
+ #[ cfg_attr( all(
405
+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
406
+ not( libc_packedN)
407
+ ) , repr( packed) ) ]
435
408
pub struct epoll_event {
436
409
pub events: u32 ,
437
410
pub u64 : u64 ,
@@ -505,28 +478,6 @@ s_no_extra_traits! {
505
478
pub sigev_notify_attributes: * const :: pthread_attr_t,
506
479
__sigev_pad2: :: c_int,
507
480
}
508
-
509
- #[ cfg_attr( feature = "extra_traits" , allow( missing_debug_implementations) ) ]
510
- pub union door_desc_t__d_data {
511
- pub d_desc: door_desc_t__d_data__d_desc,
512
- d_resv: [ :: c_int; 5 ] , /* Check out /usr/include/sys/door.h */
513
- }
514
-
515
- #[ cfg_attr( feature = "extra_traits" , allow( missing_debug_implementations) ) ]
516
- pub struct door_desc_t {
517
- pub d_attributes: door_attr_t,
518
- pub d_data: door_desc_t__d_data,
519
- }
520
-
521
- #[ cfg_attr( feature = "extra_traits" , allow( missing_debug_implementations) ) ]
522
- pub struct door_arg_t {
523
- pub data_ptr: * const :: c_char,
524
- pub data_size: :: size_t,
525
- pub desc_ptr: * const door_desc_t,
526
- pub dec_num: :: c_uint,
527
- pub rbuf: * const :: c_char,
528
- pub rsize: :: size_t,
529
- }
530
481
}
531
482
532
483
cfg_if ! {
@@ -1018,7 +969,7 @@ pub const O_CREAT: ::c_int = 256;
1018
969
pub const O_EXCL : :: c_int = 1024 ;
1019
970
pub const O_NOCTTY : :: c_int = 2048 ;
1020
971
pub const O_TRUNC : :: c_int = 512 ;
1021
- pub const O_NOFOLLOW : :: c_int = 0x200000 ;
972
+ pub const O_NOFOLLOW : :: c_int = 0x20000 ;
1022
973
pub const O_SEARCH : :: c_int = 0x200000 ;
1023
974
pub const O_EXEC : :: c_int = 0x400000 ;
1024
975
pub const O_CLOEXEC : :: c_int = 0x800000 ;
@@ -1361,7 +1312,7 @@ pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
1361
1312
1362
1313
#[ deprecated( since = "0.2.64" , note = "Not stable across OS versions" ) ]
1363
1314
pub const RLIM_NLIMITS : rlim_t = 7 ;
1364
- pub const RLIM_INFINITY : rlim_t = 0x7fffffff ;
1315
+ pub const RLIM_INFINITY : rlim_t = 0xfffffffffffffffd ;
1365
1316
1366
1317
pub const RUSAGE_SELF : :: c_int = 0 ;
1367
1318
pub const RUSAGE_CHILDREN : :: c_int = -1 ;
@@ -1375,8 +1326,6 @@ pub const MADV_FREE: ::c_int = 5;
1375
1326
1376
1327
pub const AF_UNSPEC : :: c_int = 0 ;
1377
1328
pub const AF_UNIX : :: c_int = 1 ;
1378
- pub const AF_LOCAL : :: c_int = 0 ;
1379
- pub const AF_FILE : :: c_int = 0 ;
1380
1329
pub const AF_INET : :: c_int = 2 ;
1381
1330
pub const AF_IMPLINK : :: c_int = 3 ;
1382
1331
pub const AF_PUP : :: c_int = 4 ;
@@ -1465,6 +1414,9 @@ pub const MSG_DUPCTRL: ::c_int = 0x800;
1465
1414
pub const MSG_XPG4_2 : :: c_int = 0x8000 ;
1466
1415
pub const MSG_MAXIOVLEN : :: c_int = 16 ;
1467
1416
1417
+ pub const IF_NAMESIZE : :: size_t = 32 ;
1418
+ pub const IFNAMSIZ : :: size_t = 16 ;
1419
+
1468
1420
// https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html
1469
1421
pub const IFF_UP : :: c_int = 0x0000000001 ; // Address is up
1470
1422
pub const IFF_BROADCAST : :: c_int = 0x0000000002 ; // Broadcast address valid
@@ -1780,8 +1732,6 @@ pub const PORT_SOURCE_FD: ::c_int = 4;
1780
1732
pub const PORT_SOURCE_ALERT : :: c_int = 5 ;
1781
1733
pub const PORT_SOURCE_MQ : :: c_int = 6 ;
1782
1734
pub const PORT_SOURCE_FILE : :: c_int = 7 ;
1783
- pub const PORT_SOURCE_POSTWAIT : :: c_int = 8 ;
1784
- pub const PORT_SOURCE_SIGNAL : :: c_int = 9 ;
1785
1735
1786
1736
pub const NONROOT_USR : :: c_short = 2 ;
1787
1737
pub const _UTX_USERSIZE: usize = 32 ;
@@ -1888,7 +1838,6 @@ pub const EPOLLERR: ::c_int = 0x8;
1888
1838
pub const EPOLLHUP : :: c_int = 0x10 ;
1889
1839
pub const EPOLLET : :: c_int = 0x80000000 ;
1890
1840
pub const EPOLLRDHUP : :: c_int = 0x2000 ;
1891
- pub const EPOLLEXCLUSIVE : :: c_int = 0x10000000 ;
1892
1841
pub const EPOLLONESHOT : :: c_int = 0x40000000 ;
1893
1842
pub const EPOLL_CLOEXEC : :: c_int = 0x80000 ;
1894
1843
pub const EPOLL_CTL_ADD : :: c_int = 1 ;
@@ -1920,9 +1869,9 @@ pub const B230400: speed_t = 20;
1920
1869
pub const B307200 : speed_t = 21 ;
1921
1870
pub const B460800 : speed_t = 22 ;
1922
1871
pub const B921600 : speed_t = 23 ;
1923
- pub const CSTART : :: tcflag_t = 021 ;
1924
- pub const CSTOP : :: tcflag_t = 023 ;
1925
- pub const CSWTCH : :: tcflag_t = 032 ;
1872
+ pub const CSTART : :: tcflag_t = 0o21 ;
1873
+ pub const CSTOP : :: tcflag_t = 0o23 ;
1874
+ pub const CSWTCH : :: tcflag_t = 0o32 ;
1926
1875
pub const CSIZE : :: tcflag_t = 0o000060 ;
1927
1876
pub const CS5 : :: tcflag_t = 0 ;
1928
1877
pub const CS6 : :: tcflag_t = 0o000020 ;
@@ -2137,11 +2086,6 @@ extern "C" {
2137
2086
pub fn freeifaddrs ( ifa : * mut :: ifaddrs ) ;
2138
2087
2139
2088
pub fn stack_getbounds ( sp : * mut :: stack_t ) -> :: c_int ;
2140
- pub fn mincore (
2141
- addr : * const :: c_void ,
2142
- len : :: size_t ,
2143
- vec : * mut c_char ,
2144
- ) -> :: c_int ;
2145
2089
pub fn initgroups ( name : * const :: c_char , basegid : :: gid_t ) -> :: c_int ;
2146
2090
pub fn setgroups ( ngroups : :: c_int , ptr : * const :: gid_t ) -> :: c_int ;
2147
2091
pub fn ioctl ( fildes : :: c_int , request : :: c_int , ...) -> :: c_int ;
@@ -2237,6 +2181,7 @@ extern "C" {
2237
2181
options : :: c_int ,
2238
2182
) -> :: c_int ;
2239
2183
2184
+ #[ cfg_attr( target_os = "illumos" , link_name = "_glob_ext" ) ]
2240
2185
pub fn glob (
2241
2186
pattern : * const :: c_char ,
2242
2187
flags : :: c_int ,
@@ -2246,6 +2191,7 @@ extern "C" {
2246
2191
pglob : * mut :: glob_t ,
2247
2192
) -> :: c_int ;
2248
2193
2194
+ #[ cfg_attr( target_os = "illumos" , link_name = "_globfree_ext" ) ]
2249
2195
pub fn globfree ( pglob : * mut :: glob_t ) ;
2250
2196
2251
2197
pub fn posix_madvise (
@@ -2426,11 +2372,6 @@ extern "C" {
2426
2372
events : :: c_int ,
2427
2373
user : * mut :: c_void ,
2428
2374
) -> :: c_int ;
2429
- pub fn fexecve (
2430
- fd : :: c_int ,
2431
- argv : * const * const :: c_char ,
2432
- envp : * const * const :: c_char ,
2433
- ) -> :: c_int ;
2434
2375
#[ cfg_attr(
2435
2376
any( target_os = "solaris" , target_os = "illumos" ) ,
2436
2377
link_name = "__posix_getgrgid_r"
@@ -2555,25 +2496,6 @@ extern "C" {
2555
2496
pub fn dup3 ( src : :: c_int , dst : :: c_int , flags : :: c_int ) -> :: c_int ;
2556
2497
pub fn uname ( buf : * mut :: utsname ) -> :: c_int ;
2557
2498
pub fn pipe2 ( fds : * mut :: c_int , flags : :: c_int ) -> :: c_int ;
2558
- pub fn door_call ( d : :: c_int , params : * const door_arg_t ) -> :: c_int ;
2559
- pub fn door_return (
2560
- data_ptr : * const :: c_char ,
2561
- data_size : :: size_t ,
2562
- desc_ptr : * const door_desc_t ,
2563
- num_desc : :: c_uint ,
2564
- ) ;
2565
- pub fn door_create (
2566
- server_procedure : extern "C" fn (
2567
- cookie : * const :: c_void ,
2568
- argp : * const :: c_char ,
2569
- arg_size : :: size_t ,
2570
- dp : * const door_desc_t ,
2571
- n_desc : :: c_uint ,
2572
- ) ,
2573
- cookie : * const :: c_void ,
2574
- attributes : door_attr_t ,
2575
- ) -> :: c_int ;
2576
- pub fn fattach ( fildes : :: c_int , path : * const :: c_char ) -> :: c_int ;
2577
2499
2578
2500
pub fn makeutx ( ux : * const utmpx ) -> * mut utmpx ;
2579
2501
pub fn modutx ( ux : * const utmpx ) -> * mut utmpx ;
@@ -2604,3 +2526,15 @@ extern "C" {
2604
2526
2605
2527
mod compat;
2606
2528
pub use self :: compat:: * ;
2529
+
2530
+ cfg_if ! {
2531
+ if #[ cfg( target_os = "illumos" ) ] {
2532
+ mod illumos;
2533
+ pub use self :: illumos:: * ;
2534
+ } else if #[ cfg( target_os = "solaris" ) ] {
2535
+ mod solaris;
2536
+ pub use self :: solaris:: * ;
2537
+ } else {
2538
+ // Unknown target_os
2539
+ }
2540
+ }
0 commit comments