File tree Expand file tree Collapse file tree 20 files changed +54
-1
lines changed Expand file tree Collapse file tree 20 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,11 @@ fn main() {
22
22
let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly;
23
23
let mut cfg = ctest:: TestGenerator :: new ( ) ;
24
24
25
- // Pull in extra goodies on linux/mingw
25
+ // Pull in extra goodies
26
26
if linux || android {
27
27
cfg. define ( "_GNU_SOURCE" , None ) ;
28
+ } else if netbsd {
29
+ cfg. define ( "_NETBSD_SOURCE" , Some ( "1" ) ) ;
28
30
} else if windows {
29
31
cfg. define ( "_WIN32_WINNT" , Some ( "0x8000" ) ) ;
30
32
}
Original file line number Diff line number Diff line change 12
12
13
13
pub const __PTHREAD_MUTEX_SIZE__: usize = 40 ;
14
14
pub const __PTHREAD_COND_SIZE__: usize = 24 ;
15
+ pub const __PTHREAD_CONDATTR_SIZE__: usize = 4 ;
15
16
pub const __PTHREAD_RWLOCK_SIZE__: usize = 124 ;
16
17
17
18
pub const TIOCTIMESTAMP : :: c_ulong = 0x40087459 ;
Original file line number Diff line number Diff line change 12
12
13
13
pub const __PTHREAD_MUTEX_SIZE__: usize = 56 ;
14
14
pub const __PTHREAD_COND_SIZE__: usize = 40 ;
15
+ pub const __PTHREAD_CONDATTR_SIZE__: usize = 8 ;
15
16
pub const __PTHREAD_RWLOCK_SIZE__: usize = 192 ;
16
17
17
18
pub const TIOCTIMESTAMP : :: c_ulong = 0x40107459 ;
Original file line number Diff line number Diff line change @@ -114,6 +114,11 @@ s! {
114
114
__opaque: [ u8 ; __PTHREAD_COND_SIZE__] ,
115
115
}
116
116
117
+ pub struct pthread_condattr_t {
118
+ __sig: :: c_long,
119
+ __opaque: [ u8 ; __PTHREAD_CONDATTR_SIZE__] ,
120
+ }
121
+
117
122
pub struct pthread_rwlock_t {
118
123
__sig: :: c_long,
119
124
__opaque: [ u8 ; __PTHREAD_RWLOCK_SIZE__] ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ pub type rlim_t = i64;
5
5
pub type pthread_mutex_t = * mut :: c_void ;
6
6
pub type pthread_mutexattr_t = * mut :: c_void ;
7
7
pub type pthread_cond_t = * mut :: c_void ;
8
+ pub type pthread_condattr_t = * mut :: c_void ;
8
9
pub type pthread_rwlock_t = * mut :: c_void ;
9
10
pub type pthread_key_t = :: c_int ;
10
11
pub type tcflag_t = :: c_uint ;
@@ -806,6 +807,10 @@ extern {
806
807
flags : :: c_int ) -> :: c_int ;
807
808
pub fn mkfifoat ( dirfd : :: c_int , pathname : * const :: c_char ,
808
809
mode : :: mode_t ) -> :: c_int ;
810
+ pub fn pthread_condattr_getclock ( attr : * const pthread_condattr_t ,
811
+ clock_id : * mut clockid_t ) -> :: c_int ;
812
+ pub fn pthread_condattr_setclock ( attr : * mut pthread_condattr_t ,
813
+ clock_id : clockid_t ) -> :: c_int ;
809
814
}
810
815
811
816
cfg_if ! {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pub type pthread_attr_t = *mut ::c_void;
9
9
pub type pthread_mutex_t = * mut :: c_void ;
10
10
pub type pthread_mutexattr_t = * mut :: c_void ;
11
11
pub type pthread_cond_t = * mut :: c_void ;
12
+ pub type pthread_condattr_t = * mut :: c_void ;
12
13
pub type pthread_rwlock_t = * mut :: c_void ;
13
14
14
15
s ! {
Original file line number Diff line number Diff line change @@ -525,6 +525,8 @@ extern {
525
525
flags : :: c_int ) -> :: c_int ;
526
526
pub fn mkfifoat ( dirfd : :: c_int , pathname : * const :: c_char ,
527
527
mode : :: mode_t ) -> :: c_int ;
528
+ pub fn pthread_condattr_setclock ( attr : * mut pthread_condattr_t ,
529
+ clock_id : clockid_t ) -> :: c_int ;
528
530
}
529
531
530
532
cfg_if ! {
Original file line number Diff line number Diff line change @@ -152,6 +152,11 @@ s! {
152
152
ptc_private: * mut :: c_void,
153
153
}
154
154
155
+ pub struct pthread_condattr_t {
156
+ ptca_magic: :: c_uint,
157
+ ptca_private: * mut :: c_void,
158
+ }
159
+
155
160
pub struct pthread_rwlock_t {
156
161
ptr_magic: :: c_uint,
157
162
ptr_interlock: :: c_uchar,
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pub type pthread_attr_t = *mut ::c_void;
9
9
pub type pthread_mutex_t = * mut :: c_void ;
10
10
pub type pthread_mutexattr_t = * mut :: c_void ;
11
11
pub type pthread_cond_t = * mut :: c_void ;
12
+ pub type pthread_condattr_t = * mut :: c_void ;
12
13
pub type pthread_rwlock_t = * mut :: c_void ;
13
14
14
15
s ! {
Original file line number Diff line number Diff line change @@ -538,6 +538,10 @@ extern {
538
538
pub fn pthread_mutexattr_settype ( attr : * mut pthread_mutexattr_t ,
539
539
_type : :: c_int ) -> :: c_int ;
540
540
541
+ #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
542
+ link_name = "pthread_cond_init$UNIX2003" ) ]
543
+ pub fn pthread_cond_init ( cond : * mut pthread_cond_t ,
544
+ attr : * const pthread_condattr_t ) -> :: c_int ;
541
545
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
542
546
link_name = "pthread_cond_wait$UNIX2003" ) ]
543
547
pub fn pthread_cond_wait ( cond : * mut pthread_cond_t ,
@@ -550,6 +554,8 @@ extern {
550
554
pub fn pthread_cond_signal ( cond : * mut pthread_cond_t ) -> :: c_int ;
551
555
pub fn pthread_cond_broadcast ( cond : * mut pthread_cond_t ) -> :: c_int ;
552
556
pub fn pthread_cond_destroy ( cond : * mut pthread_cond_t ) -> :: c_int ;
557
+ pub fn pthread_condattr_init ( attr : * mut pthread_condattr_t ) -> :: c_int ;
558
+ pub fn pthread_condattr_destroy ( attr : * mut pthread_condattr_t ) -> :: c_int ;
553
559
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
554
560
link_name = "pthread_rwlock_destroy$UNIX2003" ) ]
555
561
pub fn pthread_rwlock_destroy ( lock : * mut pthread_rwlock_t ) -> :: c_int ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ pub type useconds_t = u32;
13
13
pub type socklen_t = i32 ;
14
14
pub type pthread_t = :: c_long ;
15
15
pub type pthread_mutexattr_t = :: c_long ;
16
+ pub type pthread_condattr_t = :: c_long ;
16
17
pub type sigset_t = :: c_ulong ;
17
18
pub type time64_t = i64 ; // N/A on android
18
19
pub type fsfilcnt_t = :: c_ulong ;
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ pub const SO_RCVTIMEO: ::c_int = 4102;
378
378
pub const SO_SNDTIMEO : :: c_int = 4101 ;
379
379
pub const SO_ACCEPTCONN : :: c_int = 4105 ;
380
380
381
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4 ;
381
382
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24 ;
382
383
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32 ;
383
384
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4 ;
Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ s! {
104
104
size: [ u8 ; __SIZEOF_PTHREAD_COND_T] ,
105
105
}
106
106
107
+ pub struct pthread_condattr_t {
108
+ __align: [ :: c_int; 0 ] ,
109
+ size: [ u8 ; __SIZEOF_PTHREAD_CONDATTR_T] ,
110
+ }
111
+
107
112
pub struct passwd {
108
113
pub pw_name: * mut :: c_char,
109
114
pub pw_passwd: * mut :: c_char,
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ pub const SIGUNUSED: ::c_int = ::SIGSYS;
107
107
pub const FALLOC_FL_KEEP_SIZE : :: c_int = 0x01 ;
108
108
pub const FALLOC_FL_PUNCH_HOLE : :: c_int = 0x02 ;
109
109
110
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4 ;
110
111
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4 ;
111
112
112
113
pub const CPU_SETSIZE : :: c_int = 128 ;
Original file line number Diff line number Diff line change 85
85
}
86
86
}
87
87
88
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4 ;
88
89
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24 ;
89
90
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32 ;
90
91
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4 ;
Original file line number Diff line number Diff line change 55
55
}
56
56
}
57
57
58
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8 ;
58
59
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48 ;
59
60
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8 ;
60
61
Original file line number Diff line number Diff line change 53
53
}
54
54
}
55
55
56
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4 ;
56
57
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40 ;
57
58
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4 ;
58
59
Original file line number Diff line number Diff line change 93
93
}
94
94
}
95
95
96
+ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4 ;
96
97
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40 ;
97
98
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4 ;
98
99
Original file line number Diff line number Diff line change @@ -860,6 +860,10 @@ extern {
860
860
linkpath : * const :: c_char ) -> :: c_int ;
861
861
pub fn unlinkat ( dirfd : :: c_int , pathname : * const :: c_char ,
862
862
flags : :: c_int ) -> :: c_int ;
863
+ pub fn pthread_condattr_getclock ( attr : * const pthread_condattr_t ,
864
+ clock_id : * mut clockid_t ) -> :: c_int ;
865
+ pub fn pthread_condattr_setclock ( attr : * mut pthread_condattr_t ,
866
+ clock_id : clockid_t ) -> :: c_int ;
863
867
}
864
868
865
869
cfg_if ! {
Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ s! {
143
143
__pthread_cond_data: u64
144
144
}
145
145
146
+ pub struct pthread_condattr_t {
147
+ __pthread_condattrp: * mut :: c_void,
148
+ }
149
+
146
150
pub struct pthread_rwlock_t {
147
151
__pthread_rwlock_readers: i32 ,
148
152
__pthread_rwlock_type: u16 ,
@@ -1013,5 +1017,9 @@ extern {
1013
1017
pub fn sethostname ( name : * const :: c_char , len : :: size_t ) -> :: c_int ;
1014
1018
pub fn if_nameindex ( ) -> * mut if_nameindex ;
1015
1019
pub fn if_freenameindex ( ptr : * mut if_nameindex ) ;
1020
+ pub fn pthread_condattr_getclock ( attr : * const pthread_condattr_t ,
1021
+ clock_id : * mut clockid_t ) -> :: c_int ;
1022
+ pub fn pthread_condattr_setclock ( attr : * mut pthread_condattr_t ,
1023
+ clock_id : clockid_t ) -> :: c_int ;
1016
1024
}
1017
1025
You can’t perform that action at this time.
0 commit comments