55use crate :: prelude:: * ;
66
77extern "C" {
8- #[ cfg( target_os = "linux" ) ]
8+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
99 pub fn pthread_atfork (
1010 prepare : Option < unsafe extern "C" fn ( ) > ,
1111 parent : Option < unsafe extern "C" fn ( ) > ,
1212 child : Option < unsafe extern "C" fn ( ) > ,
1313 ) -> c_int ;
1414
15- #[ cfg( target_os = "linux" ) ]
15+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
1616 pub fn pthread_attr_getguardsize (
1717 attr : * const crate :: pthread_attr_t ,
1818 guardsize : * mut size_t ,
1919 ) -> c_int ;
2020
21- #[ cfg( target_os = "linux" ) ]
21+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
2222 pub fn pthread_attr_getinheritsched (
2323 attr : * const crate :: pthread_attr_t ,
2424 inheritsched : * mut c_int ,
@@ -36,10 +36,10 @@ extern "C" {
3636 policy : * mut c_int ,
3737 ) -> c_int ;
3838
39- #[ cfg( target_os = "linux" ) ]
39+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
4040 pub fn pthread_attr_setguardsize ( attr : * mut crate :: pthread_attr_t , guardsize : size_t ) -> c_int ;
4141
42- #[ cfg( target_os = "linux" ) ]
42+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
4343 pub fn pthread_attr_setinheritsched (
4444 attr : * mut crate :: pthread_attr_t ,
4545 inheritsched : c_int ,
@@ -54,32 +54,32 @@ extern "C" {
5454 #[ cfg( target_os = "linux" ) ]
5555 pub fn pthread_attr_setschedpolicy ( attr : * mut crate :: pthread_attr_t , policy : c_int ) -> c_int ;
5656
57- #[ cfg( target_os = "linux" ) ]
57+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
5858 pub fn pthread_barrier_destroy ( barrier : * mut crate :: pthread_barrier_t ) -> c_int ;
5959
60- #[ cfg( target_os = "linux" ) ]
60+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
6161 pub fn pthread_barrier_init (
6262 barrier : * mut crate :: pthread_barrier_t ,
6363 attr : * const crate :: pthread_barrierattr_t ,
6464 count : c_uint ,
6565 ) -> c_int ;
6666
67- #[ cfg( target_os = "linux" ) ]
67+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
6868 pub fn pthread_barrier_wait ( barrier : * mut crate :: pthread_barrier_t ) -> c_int ;
6969
70- #[ cfg( target_os = "linux" ) ]
70+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
7171 pub fn pthread_barrierattr_destroy ( attr : * mut crate :: pthread_barrierattr_t ) -> c_int ;
7272
73- #[ cfg( target_os = "linux" ) ]
73+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
7474 pub fn pthread_barrierattr_getpshared (
7575 attr : * const crate :: pthread_barrierattr_t ,
7676 shared : * mut c_int ,
7777 ) -> c_int ;
7878
79- #[ cfg( target_os = "linux" ) ]
79+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
8080 pub fn pthread_barrierattr_init ( attr : * mut crate :: pthread_barrierattr_t ) -> c_int ;
8181
82- #[ cfg( target_os = "linux" ) ]
82+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
8383 pub fn pthread_barrierattr_setpshared (
8484 attr : * mut crate :: pthread_barrierattr_t ,
8585 shared : c_int ,
@@ -88,24 +88,24 @@ extern "C" {
8888 #[ cfg( all( target_os = "linux" , not( target_env = "ohos" ) ) ) ]
8989 pub fn pthread_cancel ( thread : crate :: pthread_t ) -> c_int ;
9090
91- #[ cfg( target_os = "linux" ) ]
91+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
9292 pub fn pthread_condattr_getpshared (
9393 attr : * const crate :: pthread_condattr_t ,
9494 pshared : * mut c_int ,
9595 ) -> c_int ;
9696
97- #[ cfg( target_os = "linux" ) ]
97+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
9898 pub fn pthread_create (
9999 native : * mut crate :: pthread_t ,
100100 attr : * const crate :: pthread_attr_t ,
101101 f : extern "C" fn ( * mut c_void ) -> * mut c_void ,
102102 value : * mut c_void ,
103103 ) -> c_int ;
104104
105- #[ cfg( target_os = "linux" ) ]
105+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
106106 pub fn pthread_getcpuclockid ( thread : crate :: pthread_t , clk_id : * mut crate :: clockid_t ) -> c_int ;
107107
108- #[ cfg( target_os = "linux" ) ]
108+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
109109 pub fn pthread_getschedparam (
110110 native : crate :: pthread_t ,
111111 policy : * mut c_int ,
@@ -114,13 +114,13 @@ extern "C" {
114114
115115 // FIXME(reorg): In recent POSIX versions, this is a signal.h function and not required
116116 // in pthread.
117- #[ cfg( target_os = "linux" ) ]
117+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
118118 pub fn pthread_kill ( thread : crate :: pthread_t , sig : c_int ) -> c_int ;
119119
120120 #[ cfg( all( target_os = "linux" , not( target_env = "ohos" ) ) ) ]
121121 pub fn pthread_mutex_consistent ( mutex : * mut crate :: pthread_mutex_t ) -> c_int ;
122122
123- #[ cfg( target_os = "linux" ) ]
123+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
124124 #[ cfg_attr( gnu_time_bits64, link_name = "__pthread_mutex_timedlock64" ) ]
125125 pub fn pthread_mutex_timedlock (
126126 lock : * mut crate :: pthread_mutex_t ,
@@ -133,7 +133,7 @@ extern "C" {
133133 protocol : * mut c_int ,
134134 ) -> c_int ;
135135
136- #[ cfg( target_os = "linux" ) ]
136+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
137137 pub fn pthread_mutexattr_getpshared (
138138 attr : * const crate :: pthread_mutexattr_t ,
139139 pshared : * mut c_int ,
@@ -160,7 +160,7 @@ extern "C" {
160160 #[ cfg( target_os = "linux" ) ]
161161 pub fn pthread_once ( control : * mut crate :: pthread_once_t , routine : extern "C" fn ( ) ) -> c_int ;
162162
163- #[ cfg( target_os = "linux" ) ]
163+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
164164 pub fn pthread_setschedparam (
165165 native : crate :: pthread_t ,
166166 policy : c_int ,
@@ -172,25 +172,25 @@ extern "C" {
172172
173173 // FIXME(reorg): In recent POSIX versions, this is a signal.h function and not required
174174 // in pthread.
175- #[ cfg( target_os = "linux" ) ]
175+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
176176 pub fn pthread_sigmask (
177177 how : c_int ,
178178 set : * const crate :: sigset_t ,
179179 oldset : * mut crate :: sigset_t ,
180180 ) -> c_int ;
181181
182- #[ cfg( target_os = "linux" ) ]
182+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
183183 pub fn pthread_spin_destroy ( lock : * mut crate :: pthread_spinlock_t ) -> c_int ;
184184
185- #[ cfg( target_os = "linux" ) ]
185+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
186186 pub fn pthread_spin_init ( lock : * mut crate :: pthread_spinlock_t , pshared : c_int ) -> c_int ;
187187
188- #[ cfg( target_os = "linux" ) ]
188+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
189189 pub fn pthread_spin_lock ( lock : * mut crate :: pthread_spinlock_t ) -> c_int ;
190190
191- #[ cfg( target_os = "linux" ) ]
191+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
192192 pub fn pthread_spin_trylock ( lock : * mut crate :: pthread_spinlock_t ) -> c_int ;
193193
194- #[ cfg( target_os = "linux" ) ]
194+ #[ cfg( any ( target_os = "android" , target_os = " linux") ) ]
195195 pub fn pthread_spin_unlock ( lock : * mut crate :: pthread_spinlock_t ) -> c_int ;
196196}
0 commit comments