@@ -8,6 +8,7 @@ pub type tcflag_t = ::c_uint;
8
8
pub type speed_t = :: c_uint ;
9
9
pub type c_char = i8 ;
10
10
pub type clock_t = i32 ;
11
+ pub type clockid_t = i32 ;
11
12
pub type time_t = i32 ;
12
13
pub type suseconds_t = i32 ;
13
14
pub type wchar_t = i32 ;
@@ -280,6 +281,29 @@ s! {
280
281
pub sa_flags: :: c_int,
281
282
sa_userdata: * mut :: c_void,
282
283
}
284
+
285
+ pub struct sem_t {
286
+ pub se_type: i32 ,
287
+ pub se_named_id: i32 , // this is actually a union
288
+ pub se_unnamed: i32 ,
289
+ pub se_padding: [ i32 ; 4 ] ,
290
+ }
291
+
292
+ pub struct pthread_condattr_t {
293
+ pub process_shared: bool ,
294
+ pub clock_id: i32 ,
295
+ }
296
+ }
297
+
298
+ // intentionally not public, only used for fd_set
299
+ cfg_if ! {
300
+ if #[ cfg( target_pointer_width = "32" ) ] {
301
+ const ULONG_SIZE : usize = 32 ;
302
+ } else if #[ cfg( target_pointer_width = "64" ) ] {
303
+ const ULONG_SIZE : usize = 64 ;
304
+ } else {
305
+ // Unknown target_pointer_width
306
+ }
283
307
}
284
308
285
309
pub const EXIT_FAILURE : :: c_int = 1 ;
@@ -592,6 +616,9 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
592
616
waiters : [ 0 as * mut _ ; 2 ] ,
593
617
} ;
594
618
619
+ pub const PTHREAD_MUTEX_DEFAULT : :: c_int = 0 ;
620
+ pub const PTHREAD_MUTEX_NORMAL : :: c_int = 1 ;
621
+ pub const PTHREAD_MUTEX_ERRORCHECK : :: c_int = 2 ;
595
622
pub const PTHREAD_MUTEX_RECURSIVE : :: c_int = 3 ;
596
623
597
624
pub const FIOCLEX : c_ulong = 0 ; // TODO: does not exist on Haiku!
@@ -680,6 +707,10 @@ extern {
680
707
pub fn pthread_attr_getstack ( attr : * const :: pthread_attr_t ,
681
708
stackaddr : * mut * mut :: c_void ,
682
709
stacksize : * mut :: size_t ) -> :: c_int ;
710
+ pub fn pthread_condattr_getclock ( attr : * const pthread_condattr_t ,
711
+ clock_id : * mut clockid_t ) -> :: c_int ;
712
+ pub fn pthread_condattr_setclock ( attr : * mut pthread_condattr_t ,
713
+ clock_id : clockid_t ) -> :: c_int ;
683
714
pub fn memalign ( align : :: size_t , size : :: size_t ) -> * mut :: c_void ;
684
715
pub fn setgroups ( ngroups : :: size_t ,
685
716
ptr : * const :: gid_t ) -> :: c_int ;
0 commit comments