File tree Expand file tree Collapse file tree 11 files changed +61
-0
lines changed
Expand file tree Collapse file tree 11 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -1099,6 +1099,8 @@ fn test_netbsd(target: &str) {
10991099 // conflicting with `p_type` macro from <resolve.h>.
11001100 ( "Elf32_Phdr" , "p_type" ) => true ,
11011101 ( "Elf64_Phdr" , "p_type" ) => true ,
1102+ // pthread_spin_t is a volatile uchar
1103+ ( "pthread_spinlock_t" , "pts_spin" ) => true ,
11021104 _ => false ,
11031105 }
11041106 } ) ;
Original file line number Diff line number Diff line change @@ -3001,6 +3001,12 @@ pthread_self
30013001pthread_setschedparam
30023002pthread_setspecific
30033003pthread_sigmask
3004+ pthread_spin_destroy
3005+ pthread_spin_init
3006+ pthread_spin_lock
3007+ pthread_spin_trylock
3008+ pthread_spin_unlock
3009+ pthread_spinlock_t
30043010pthread_t
30053011ptrace
30063012ptrdiff_t
Original file line number Diff line number Diff line change @@ -1307,6 +1307,12 @@ pthread_mutexattr_setpshared
13071307pthread_rwlockattr_getpshared
13081308pthread_rwlockattr_setpshared
13091309pthread_set_name_np
1310+ pthread_spin_destroy
1311+ pthread_spin_init
1312+ pthread_spin_lock
1313+ pthread_spin_trylock
1314+ pthread_spin_unlock
1315+ pthread_spinlock_t
13101316ptrace
13111317ptrace_io_desc
13121318pututxline
Original file line number Diff line number Diff line change @@ -1558,6 +1558,12 @@ pthread_rwlockattr_getpshared
15581558pthread_rwlockattr_setpshared
15591559pthread_setaffinity_np
15601560pthread_set_name_np
1561+ pthread_spin_destroy
1562+ pthread_spin_init
1563+ pthread_spin_lock
1564+ pthread_spin_trylock
1565+ pthread_spin_unlock
1566+ pthread_spinlock_t
15611567ptrace
15621568ptrace_io_desc
15631569ptrace_vm_entry
Original file line number Diff line number Diff line change @@ -2913,6 +2913,12 @@ pthread_rwlockattr_setpshared
29132913pthread_setaffinity_np
29142914pthread_setschedparam
29152915pthread_setschedprio
2916+ pthread_spin_destroy
2917+ pthread_spin_init
2918+ pthread_spin_lock
2919+ pthread_spin_trylock
2920+ pthread_spin_unlock
2921+ pthread_spinlock_t
29162922ptrace
29172923ptsname_r
29182924pwrite64
Original file line number Diff line number Diff line change @@ -1205,6 +1205,12 @@ pthread_getattr_np
12051205pthread_getaffinity_np
12061206pthread_kill
12071207pthread_mutex_timedlock
1208+ pthread_spin_destroy
1209+ pthread_spin_init
1210+ pthread_spin_lock
1211+ pthread_spin_trylock
1212+ pthread_spin_unlock
1213+ pthread_spinlock_t
12081214pthread_setaffinity_np
12091215pthread_setname_np
12101216ptrace
Original file line number Diff line number Diff line change @@ -1008,6 +1008,12 @@ pthread_kill
10081008pthread_main_np
10091009pthread_mutex_timedlock
10101010pthread_set_name_np
1011+ pthread_spin_destroy
1012+ pthread_spin_init
1013+ pthread_spin_lock
1014+ pthread_spin_trylock
1015+ pthread_spin_unlock
1016+ pthread_spinlock_t
10111017pthread_stackseg_np
10121018ptrace
10131019ptrace_io_desc
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ pub type cpuset_t = cpumask_t;
2626pub type cpu_set_t = cpumask_t ;
2727
2828pub type register_t = :: c_long ;
29+ pub type umtx_t = :: c_int ;
30+ pub type pthread_spinlock_t = :: uintptr_t ;
2931
3032#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
3133pub enum sem { }
@@ -1269,6 +1271,12 @@ extern "C" {
12691271 needle : * const :: c_void ,
12701272 needlelen : :: size_t ,
12711273 ) -> * mut :: c_void ;
1274+ pub fn pthread_spin_init ( lock : * mut pthread_spinlock_t , pshared : :: c_int ) -> :: c_int ;
1275+ pub fn pthread_spin_destroy ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1276+ pub fn pthread_spin_lock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1277+ pub fn pthread_spin_trylock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1278+ pub fn pthread_spin_unlock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1279+
12721280 pub fn sched_getaffinity ( pid : :: pid_t , cpusetsize : :: size_t , mask : * mut cpu_set_t ) -> :: c_int ;
12731281 pub fn sched_setaffinity ( pid : :: pid_t , cpusetsize : :: size_t , mask : * const cpu_set_t )
12741282 -> :: c_int ;
Original file line number Diff line number Diff line change @@ -712,6 +712,11 @@ extern "C" {
712712 lock : * mut pthread_mutex_t ,
713713 abstime : * const :: timespec ,
714714 ) -> :: c_int ;
715+ pub fn pthread_spin_init ( lock : * mut pthread_spinlock_t , pshared : :: c_int ) -> :: c_int ;
716+ pub fn pthread_spin_destroy ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
717+ pub fn pthread_spin_lock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
718+ pub fn pthread_spin_trylock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
719+ pub fn pthread_spin_unlock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
715720 pub fn pipe2 ( fds : * mut :: c_int , flags : :: c_int ) -> :: c_int ;
716721
717722 pub fn getgrouplist (
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ pub type lwpid_t = ::c_uint;
1212pub type shmatt_t = :: c_uint ;
1313pub type cpuid_t = u64 ;
1414pub type cpuset_t = _cpuset ;
15+ pub type pthread_spin_t = :: c_uchar ;
1516
1617// elf.h
1718
@@ -209,6 +210,12 @@ s! {
209210 ptr_private: * mut :: c_void,
210211 }
211212
213+ pub struct pthread_spinlock_t {
214+ pts_magic: :: c_uint,
215+ pts_spin: :: pthread_spin_t,
216+ pts_flags: :: c_int,
217+ }
218+
212219 pub struct kevent {
213220 pub ident: :: uintptr_t,
214221 pub filter: u32 ,
@@ -2067,6 +2074,7 @@ extern "C" {
20672074 size : :: size_t ,
20682075 set : * mut cpuset_t ,
20692076 ) -> :: c_int ;
2077+
20702078 pub fn _cpuset_create ( ) -> * mut cpuset_t ;
20712079 pub fn _cpuset_destroy ( set : * mut cpuset_t ) ;
20722080 pub fn _cpuset_clr ( cpu : cpuid_t , set : * mut cpuset_t ) -> :: c_int ;
You can’t perform that action at this time.
0 commit comments