@@ -21,6 +21,8 @@ pub type mqd_t = *mut ::c_void;
21
21
pub type posix_spawnattr_t = * mut :: c_void ;
22
22
pub type posix_spawn_file_actions_t = * mut :: c_void ;
23
23
24
+ pub type pthread_spinlock_t = * mut __c_anonymous_pthread_spinlock ;
25
+
24
26
s ! {
25
27
pub struct aiocb {
26
28
pub aio_fildes: :: c_int,
@@ -140,6 +142,21 @@ s! {
140
142
pub struct cap_rights_t {
141
143
cr_rights: [ u64 ; 2 ] ,
142
144
}
145
+
146
+ pub struct umutex {
147
+ m_owner: :: lwpid_t,
148
+ m_flags: u32 ,
149
+ m_ceilings: [ u32 ; 2 ] ,
150
+ m_rb_link: :: uintptr_t,
151
+ #[ cfg( target_pointer_width = "32" ) ]
152
+ m_pad: u32 ,
153
+ m_spare: [ u32 ; 2 ] ,
154
+
155
+ }
156
+
157
+ pub struct __c_anonymous_pthread_spinlock {
158
+ s_clock: umutex,
159
+ }
143
160
}
144
161
145
162
s_no_extra_traits ! {
@@ -1588,6 +1605,12 @@ extern "C" {
1588
1605
cpusetp : * const cpuset_t ,
1589
1606
) -> :: c_int ;
1590
1607
1608
+ pub fn pthread_spin_init ( lock : * mut pthread_spinlock_t , pshared : :: c_int ) -> :: c_int ;
1609
+ pub fn pthread_spin_destroy ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1610
+ pub fn pthread_spin_lock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1611
+ pub fn pthread_spin_trylock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1612
+ pub fn pthread_spin_unlock ( lock : * mut pthread_spinlock_t ) -> :: c_int ;
1613
+
1591
1614
#[ cfg_attr( all( target_os = "freebsd" , freebsd11) , link_name = "statfs@FBSD_1.0" ) ]
1592
1615
pub fn statfs ( path : * const :: c_char , buf : * mut statfs ) -> :: c_int ;
1593
1616
#[ cfg_attr( all( target_os = "freebsd" , freebsd11) , link_name = "fstatfs@FBSD_1.0" ) ]
0 commit comments