@@ -164,6 +164,7 @@ pub type pthread_key_t = __pthread_key;
164
164
pub type pthread_once_t = __pthread_once ;
165
165
166
166
pub type __rlimit_resource = :: c_uint ;
167
+ pub type __rlimit_resource_t = __rlimit_resource ;
167
168
pub type rlim_t = __rlim_t ;
168
169
pub type rlim64_t = __rlim64_t ;
169
170
@@ -215,10 +216,34 @@ pub type tcp_ca_state = ::c_uint;
215
216
216
217
pub type idtype_t = :: c_uint ;
217
218
219
+ pub type mqd_t = :: c_int ;
220
+
221
+ pub type Lmid_t = :: c_long ;
222
+
218
223
pub type regoff_t = :: c_int ;
219
224
225
+ pub type nl_item = :: c_int ;
226
+
220
227
pub type iconv_t = * mut :: c_void ;
221
228
229
+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
230
+ pub enum fpos64_t { } // FIXME: fill this out with a struct
231
+ impl :: Copy for fpos64_t { }
232
+ impl :: Clone for fpos64_t {
233
+ fn clone ( & self ) -> fpos64_t {
234
+ * self
235
+ }
236
+ }
237
+
238
+ #[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
239
+ pub enum timezone { }
240
+ impl :: Copy for timezone { }
241
+ impl :: Clone for timezone {
242
+ fn clone ( & self ) -> timezone {
243
+ * self
244
+ }
245
+ }
246
+
222
247
// structs
223
248
s ! {
224
249
pub struct ip_mreq {
431
456
432
457
pub struct stat {
433
458
pub st_fstype: :: c_int,
434
- pub st_fsid : __fsid_t,
459
+ pub st_dev : __fsid_t, /* Actually st_fsid */
435
460
pub st_ino: __ino_t,
436
461
pub st_gen: :: c_uint,
437
462
pub st_rdev: __dev_t,
@@ -583,6 +608,18 @@ s! {
583
608
__glibc_reserved: [ :: c_char; 32 ]
584
609
}
585
610
611
+ pub struct mq_attr {
612
+ pub mq_flags: :: c_long,
613
+ pub mq_maxmsg: :: c_long,
614
+ pub mq_msgsize: :: c_long,
615
+ pub mq_curmsgs: :: c_long,
616
+ }
617
+
618
+ pub struct __exit_status {
619
+ pub e_termination: :: c_short,
620
+ pub e_exit: :: c_short,
621
+ }
622
+
586
623
#[ cfg_attr( target_pointer_width = "32" ,
587
624
repr( align( 4 ) ) ) ]
588
625
#[ cfg_attr( target_pointer_width = "64" ,
@@ -998,6 +1035,96 @@ s! {
998
1035
999
1036
}
1000
1037
1038
+ s_no_extra_traits ! {
1039
+ pub struct utmpx {
1040
+ pub ut_type: :: c_short,
1041
+ pub ut_pid: :: pid_t,
1042
+ pub ut_line: [ :: c_char; __UT_LINESIZE] ,
1043
+ pub ut_id: [ :: c_char; 4 ] ,
1044
+
1045
+ pub ut_user: [ :: c_char; __UT_NAMESIZE] ,
1046
+ pub ut_host: [ :: c_char; __UT_HOSTSIZE] ,
1047
+ pub ut_exit: __exit_status,
1048
+
1049
+ #[ cfg( any( all( target_pointer_width = "32" ,
1050
+ not( target_arch = "x86_64" ) ) ) ) ]
1051
+ pub ut_session: :: c_long,
1052
+ #[ cfg( any( all( target_pointer_width = "32" ,
1053
+ not( target_arch = "x86_64" ) ) ) ) ]
1054
+ pub ut_tv: :: timeval,
1055
+
1056
+ #[ cfg( not( any( all( target_pointer_width = "32" ,
1057
+ not( target_arch = "x86_64" ) ) ) ) ) ]
1058
+ pub ut_session: i32 ,
1059
+ #[ cfg( not( any( all( target_pointer_width = "32" ,
1060
+ not( target_arch = "x86_64" ) ) ) ) ) ]
1061
+ pub ut_tv: __timeval,
1062
+
1063
+ pub ut_addr_v6: [ i32 ; 4 ] ,
1064
+ __glibc_reserved: [ :: c_char; 20 ] ,
1065
+ }
1066
+ }
1067
+
1068
+ cfg_if ! {
1069
+ if #[ cfg( feature = "extra_traits" ) ] {
1070
+ impl PartialEq for utmpx {
1071
+ fn eq( & self , other: & utmpx) -> bool {
1072
+ self . ut_type == other. ut_type
1073
+ && self . ut_pid == other. ut_pid
1074
+ && self . ut_line == other. ut_line
1075
+ && self . ut_id == other. ut_id
1076
+ && self . ut_user == other. ut_user
1077
+ && self
1078
+ . ut_host
1079
+ . iter( )
1080
+ . zip( other. ut_host. iter( ) )
1081
+ . all( |( a, b) | a == b)
1082
+ && self . ut_exit == other. ut_exit
1083
+ && self . ut_session == other. ut_session
1084
+ && self . ut_tv == other. ut_tv
1085
+ && self . ut_addr_v6 == other. ut_addr_v6
1086
+ && self . __glibc_reserved == other. __glibc_reserved
1087
+ }
1088
+ }
1089
+
1090
+ impl Eq for utmpx { }
1091
+
1092
+ impl :: fmt:: Debug for utmpx {
1093
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1094
+ f. debug_struct( "utmpx" )
1095
+ . field( "ut_type" , & self . ut_type)
1096
+ . field( "ut_pid" , & self . ut_pid)
1097
+ . field( "ut_line" , & self . ut_line)
1098
+ . field( "ut_id" , & self . ut_id)
1099
+ . field( "ut_user" , & self . ut_user)
1100
+ // FIXME: .field("ut_host", &self.ut_host)
1101
+ . field( "ut_exit" , & self . ut_exit)
1102
+ . field( "ut_session" , & self . ut_session)
1103
+ . field( "ut_tv" , & self . ut_tv)
1104
+ . field( "ut_addr_v6" , & self . ut_addr_v6)
1105
+ . field( "__glibc_reserved" , & self . __glibc_reserved)
1106
+ . finish( )
1107
+ }
1108
+ }
1109
+
1110
+ impl :: hash:: Hash for utmpx {
1111
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1112
+ self . ut_type. hash( state) ;
1113
+ self . ut_pid. hash( state) ;
1114
+ self . ut_line. hash( state) ;
1115
+ self . ut_id. hash( state) ;
1116
+ self . ut_user. hash( state) ;
1117
+ self . ut_host. hash( state) ;
1118
+ self . ut_exit. hash( state) ;
1119
+ self . ut_session. hash( state) ;
1120
+ self . ut_tv. hash( state) ;
1121
+ self . ut_addr_v6. hash( state) ;
1122
+ self . __glibc_reserved. hash( state) ;
1123
+ }
1124
+ }
1125
+ }
1126
+ }
1127
+
1001
1128
impl siginfo_t {
1002
1129
pub unsafe fn si_addr ( & self ) -> * mut :: c_void {
1003
1130
self . si_addr
@@ -1310,7 +1437,10 @@ pub const INET_ADDRSTRLEN: usize = 16;
1310
1437
pub const INET6_ADDRSTRLEN : usize = 46 ;
1311
1438
1312
1439
// netinet/ip.h
1313
- pub const IPTOS_ECN_MASK : u8 = 0x03 ;
1440
+ pub const IPTOS_TOS_MASK : u8 = 0x1E ;
1441
+ pub const IPTOS_PREC_MASK : u8 = 0xE0 ;
1442
+
1443
+ pub const IPTOS_ECN_NOT_ECT : u8 = 0x00 ;
1314
1444
1315
1445
pub const IPTOS_LOWDELAY : u8 = 0x10 ;
1316
1446
pub const IPTOS_THROUGHPUT : u8 = 0x08 ;
@@ -1372,6 +1502,12 @@ pub const ARPOP_InREQUEST: u16 = 8;
1372
1502
pub const ARPOP_InREPLY : u16 = 9 ;
1373
1503
pub const ARPOP_NAK : u16 = 10 ;
1374
1504
1505
+ pub const MAX_ADDR_LEN : usize = 7 ;
1506
+ pub const ARPD_UPDATE : :: c_ushort = 0x01 ;
1507
+ pub const ARPD_LOOKUP : :: c_ushort = 0x02 ;
1508
+ pub const ARPD_FLUSH : :: c_ushort = 0x03 ;
1509
+ pub const ATF_MAGIC : :: c_int = 0x80 ;
1510
+
1375
1511
pub const ATF_NETMASK : :: c_int = 0x20 ;
1376
1512
pub const ATF_DONTPUB : :: c_int = 0x40 ;
1377
1513
@@ -1598,6 +1734,71 @@ pub const LC_MEASUREMENT_MASK: ::c_int = 2048;
1598
1734
pub const LC_IDENTIFICATION_MASK : :: c_int = 4096 ;
1599
1735
pub const LC_ALL_MASK : :: c_int = 8127 ;
1600
1736
1737
+ pub const ABDAY_1 : :: nl_item = 0x20000 ;
1738
+ pub const ABDAY_2 : :: nl_item = 0x20001 ;
1739
+ pub const ABDAY_3 : :: nl_item = 0x20002 ;
1740
+ pub const ABDAY_4 : :: nl_item = 0x20003 ;
1741
+ pub const ABDAY_5 : :: nl_item = 0x20004 ;
1742
+ pub const ABDAY_6 : :: nl_item = 0x20005 ;
1743
+ pub const ABDAY_7 : :: nl_item = 0x20006 ;
1744
+
1745
+ pub const DAY_1 : :: nl_item = 0x20007 ;
1746
+ pub const DAY_2 : :: nl_item = 0x20008 ;
1747
+ pub const DAY_3 : :: nl_item = 0x20009 ;
1748
+ pub const DAY_4 : :: nl_item = 0x2000A ;
1749
+ pub const DAY_5 : :: nl_item = 0x2000B ;
1750
+ pub const DAY_6 : :: nl_item = 0x2000C ;
1751
+ pub const DAY_7 : :: nl_item = 0x2000D ;
1752
+
1753
+ pub const ABMON_1 : :: nl_item = 0x2000E ;
1754
+ pub const ABMON_2 : :: nl_item = 0x2000F ;
1755
+ pub const ABMON_3 : :: nl_item = 0x20010 ;
1756
+ pub const ABMON_4 : :: nl_item = 0x20011 ;
1757
+ pub const ABMON_5 : :: nl_item = 0x20012 ;
1758
+ pub const ABMON_6 : :: nl_item = 0x20013 ;
1759
+ pub const ABMON_7 : :: nl_item = 0x20014 ;
1760
+ pub const ABMON_8 : :: nl_item = 0x20015 ;
1761
+ pub const ABMON_9 : :: nl_item = 0x20016 ;
1762
+ pub const ABMON_10 : :: nl_item = 0x20017 ;
1763
+ pub const ABMON_11 : :: nl_item = 0x20018 ;
1764
+ pub const ABMON_12 : :: nl_item = 0x20019 ;
1765
+
1766
+ pub const MON_1 : :: nl_item = 0x2001A ;
1767
+ pub const MON_2 : :: nl_item = 0x2001B ;
1768
+ pub const MON_3 : :: nl_item = 0x2001C ;
1769
+ pub const MON_4 : :: nl_item = 0x2001D ;
1770
+ pub const MON_5 : :: nl_item = 0x2001E ;
1771
+ pub const MON_6 : :: nl_item = 0x2001F ;
1772
+ pub const MON_7 : :: nl_item = 0x20020 ;
1773
+ pub const MON_8 : :: nl_item = 0x20021 ;
1774
+ pub const MON_9 : :: nl_item = 0x20022 ;
1775
+ pub const MON_10 : :: nl_item = 0x20023 ;
1776
+ pub const MON_11 : :: nl_item = 0x20024 ;
1777
+ pub const MON_12 : :: nl_item = 0x20025 ;
1778
+
1779
+ pub const AM_STR : :: nl_item = 0x20026 ;
1780
+ pub const PM_STR : :: nl_item = 0x20027 ;
1781
+
1782
+ pub const D_T_FMT : :: nl_item = 0x20028 ;
1783
+ pub const D_FMT : :: nl_item = 0x20029 ;
1784
+ pub const T_FMT : :: nl_item = 0x2002A ;
1785
+ pub const T_FMT_AMPM : :: nl_item = 0x2002B ;
1786
+
1787
+ pub const ERA : :: nl_item = 0x2002C ;
1788
+ pub const ERA_D_FMT : :: nl_item = 0x2002E ;
1789
+ pub const ALT_DIGITS : :: nl_item = 0x2002F ;
1790
+ pub const ERA_D_T_FMT : :: nl_item = 0x20030 ;
1791
+ pub const ERA_T_FMT : :: nl_item = 0x20031 ;
1792
+
1793
+ pub const CODESET : :: nl_item = 14 ;
1794
+ pub const CRNCYSTR : :: nl_item = 0x4000F ;
1795
+ pub const RADIXCHAR : :: nl_item = 0x10000 ;
1796
+ pub const THOUSEP : :: nl_item = 0x10001 ;
1797
+ pub const YESEXPR : :: nl_item = 0x50000 ;
1798
+ pub const NOEXPR : :: nl_item = 0x50001 ;
1799
+ pub const YESSTR : :: nl_item = 0x50002 ;
1800
+ pub const NOSTR : :: nl_item = 0x50003 ;
1801
+
1601
1802
// reboot.h
1602
1803
pub const RB_AUTOBOOT : :: c_int = 0x0 ;
1603
1804
pub const RB_ASKNAME : :: c_int = 0x1 ;
@@ -1785,6 +1986,7 @@ pub const CBRK: u8 = 0u8;
1785
1986
1786
1987
// dlfcn.h
1787
1988
pub const RTLD_DEFAULT : * mut :: c_void = 0i64 as * mut :: c_void ;
1989
+ pub const RTLD_NEXT : * mut :: c_void = -1i64 as * mut :: c_void ;
1788
1990
pub const RTLD_LAZY : :: c_int = 1 ;
1789
1991
pub const RTLD_NOW : :: c_int = 2 ;
1790
1992
pub const RTLD_BINDING_MASK : :: c_int = 3 ;
@@ -2942,6 +3144,10 @@ pub const PRIO_PROCESS: __priority_which = 0;
2942
3144
pub const PRIO_PGRP : __priority_which = 1 ;
2943
3145
pub const PRIO_USER : __priority_which = 2 ;
2944
3146
3147
+ pub const __UT_LINESIZE: usize = 32 ;
3148
+ pub const __UT_NAMESIZE: usize = 32 ;
3149
+ pub const __UT_HOSTSIZE: usize = 256 ;
3150
+
2945
3151
pub const SOCK_STREAM : :: c_int = 1 ;
2946
3152
pub const SOCK_DGRAM : :: c_int = 2 ;
2947
3153
pub const SOCK_RAW : :: c_int = 3 ;
@@ -3079,11 +3285,6 @@ pub const RTLD_DI_TLS_DATA: ::c_int = 10;
3079
3285
pub const RTLD_DI_PHDR : :: c_int = 11 ;
3080
3286
pub const RTLD_DI_MAX : :: c_int = 11 ;
3081
3287
3082
- pub const RTLD_NEXT : * mut :: c_void = -1i64 as * mut :: c_void ;
3083
- pub const RTLD_DEFAULT : * mut :: c_void = 0i64 as * mut :: c_void ;
3084
- pub const RTLD_NODELETE : :: c_int = 0x1000 ;
3085
- pub const RTLD_NOW : :: c_int = 0x2 ;
3086
-
3087
3288
pub const SI_ASYNCIO : :: c_int = -4 ;
3088
3289
pub const SI_MESGQ : :: c_int = -3 ;
3089
3290
pub const SI_TIMER : :: c_int = -2 ;
@@ -3262,12 +3463,12 @@ f! {
3262
3463
return 0 as * mut cmsghdr;
3263
3464
} ;
3264
3465
let next = ( cmsg as usize +
3265
- super :: CMSG_ALIGN ( ( * cmsg) . cmsg_len as usize ) )
3466
+ CMSG_ALIGN ( ( * cmsg) . cmsg_len as usize ) )
3266
3467
as * mut cmsghdr;
3267
3468
let max = ( * mhdr) . msg_control as usize
3268
3469
+ ( * mhdr) . msg_controllen as usize ;
3269
3470
if ( next. offset( 1 ) ) as usize > max ||
3270
- next as usize + super :: CMSG_ALIGN ( ( * next) . cmsg_len as usize ) > max
3471
+ next as usize + CMSG_ALIGN ( ( * next) . cmsg_len as usize ) > max
3271
3472
{
3272
3473
0 as * mut cmsghdr
3273
3474
} else {
@@ -3756,19 +3957,14 @@ extern "C" {
3756
3957
__attr : * const pthread_attr_t ,
3757
3958
__guardsize : * mut :: size_t ,
3758
3959
) -> :: c_int ;
3960
+ pub fn pthread_attr_setguardsize ( attr : * mut :: pthread_attr_t , guardsize : :: size_t ) -> :: c_int ;
3759
3961
3760
3962
pub fn pthread_attr_getstack (
3761
3963
__attr : * const pthread_attr_t ,
3762
3964
__stackaddr : * mut * mut :: c_void ,
3763
3965
__stacksize : * mut :: size_t ,
3764
3966
) -> :: c_int ;
3765
3967
3766
- pub fn pthread_attr_getguardsize (
3767
- attr : * const :: pthread_attr_t ,
3768
- guardsize : * mut :: size_t ,
3769
- ) -> :: c_int ;
3770
- pub fn pthread_attr_setguardsize ( attr : * mut :: pthread_attr_t , guardsize : :: size_t ) -> :: c_int ;
3771
-
3772
3968
pub fn pthread_mutexattr_getpshared (
3773
3969
attr : * const pthread_mutexattr_t ,
3774
3970
pshared : * mut :: c_int ,
0 commit comments