File tree Expand file tree Collapse file tree 5 files changed +21
-0
lines changed Expand file tree Collapse file tree 5 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2600,6 +2600,8 @@ fn test_linux(target: &str) {
2600
2600
// (`c_uint`) and this clashes with the type of the `rlimit` APIs
2601
2601
// which expect a `c_int` even though both are ABI compatible.
2602
2602
"__rlimit_resource_t" => true ,
2603
+ // on Linux, this is a volatile int
2604
+ "pthread_spinlock_t" => true ,
2603
2605
2604
2606
_ => false ,
2605
2607
}
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ s! {
120
120
__reserved: [ :: c_char; 12 ] ,
121
121
}
122
122
123
+ pub struct pthread_spinlock_t {
124
+ __private: [ i32 ; 2 ] ,
125
+ }
126
+
123
127
pub struct passwd {
124
128
pub pw_name: * mut :: c_char,
125
129
pub pw_passwd: * mut :: c_char,
Original file line number Diff line number Diff line change @@ -105,6 +105,10 @@ s! {
105
105
pub f_namemax: :: c_ulong,
106
106
__f_spare: [ :: c_int; 6 ] ,
107
107
}
108
+
109
+ pub struct pthread_spinlock_t {
110
+ __private: i64 ,
111
+ }
108
112
}
109
113
110
114
s_no_extra_traits ! {
Original file line number Diff line number Diff line change @@ -2677,6 +2677,11 @@ extern "C" {
2677
2677
lock : * mut pthread_mutex_t ,
2678
2678
abstime : * const :: timespec ,
2679
2679
) -> :: c_int ;
2680
+ pub fn pthread_spin_init ( lock : * mut :: pthread_spinlock_t , pshared : :: c_int ) -> :: c_int ;
2681
+ pub fn pthread_spin_destroy ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
2682
+ pub fn pthread_spin_lock ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
2683
+ pub fn pthread_spin_trylock ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
2684
+ pub fn pthread_spin_unlock ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
2680
2685
pub fn clone (
2681
2686
cb : extern "C" fn ( * mut :: c_void ) -> :: c_int ,
2682
2687
child_stack : * mut :: c_void ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ pub type nl_item = ::c_int;
14
14
pub type idtype_t = :: c_uint ;
15
15
pub type loff_t = :: c_longlong ;
16
16
pub type pthread_key_t = :: c_uint ;
17
+ pub type pthread_spinlock_t = :: c_int ;
17
18
18
19
pub type __u8 = :: c_uchar ;
19
20
pub type __u16 = :: c_ushort ;
@@ -3557,6 +3558,11 @@ extern "C" {
3557
3558
lock : * mut pthread_mutex_t ,
3558
3559
abstime : * const :: timespec ,
3559
3560
) -> :: c_int ;
3561
+ pub fn pthread_spin_init ( lock : * mut :: pthread_spinlock_t , pshared : :: c_int ) -> :: c_int ;
3562
+ pub fn pthread_spin_destroy ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
3563
+ pub fn pthread_spin_lock ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
3564
+ pub fn pthread_spin_trylock ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
3565
+ pub fn pthread_spin_unlock ( lock : * mut :: pthread_spinlock_t ) -> :: c_int ;
3560
3566
pub fn clone (
3561
3567
cb : extern "C" fn ( * mut :: c_void ) -> :: c_int ,
3562
3568
child_stack : * mut :: c_void ,
You can’t perform that action at this time.
0 commit comments