xref: /aosp_15_r20/bionic/tests/headers/posix/pthread_h.c (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1*8d67ca89SAndroid Build Coastguard Worker /*
2*8d67ca89SAndroid Build Coastguard Worker  * Copyright (C) 2017 The Android Open Source Project
3*8d67ca89SAndroid Build Coastguard Worker  * All rights reserved.
4*8d67ca89SAndroid Build Coastguard Worker  *
5*8d67ca89SAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
6*8d67ca89SAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions
7*8d67ca89SAndroid Build Coastguard Worker  * are met:
8*8d67ca89SAndroid Build Coastguard Worker  *  * Redistributions of source code must retain the above copyright
9*8d67ca89SAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer.
10*8d67ca89SAndroid Build Coastguard Worker  *  * Redistributions in binary form must reproduce the above copyright
11*8d67ca89SAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer in
12*8d67ca89SAndroid Build Coastguard Worker  *    the documentation and/or other materials provided with the
13*8d67ca89SAndroid Build Coastguard Worker  *    distribution.
14*8d67ca89SAndroid Build Coastguard Worker  *
15*8d67ca89SAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16*8d67ca89SAndroid Build Coastguard Worker  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17*8d67ca89SAndroid Build Coastguard Worker  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18*8d67ca89SAndroid Build Coastguard Worker  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19*8d67ca89SAndroid Build Coastguard Worker  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20*8d67ca89SAndroid Build Coastguard Worker  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21*8d67ca89SAndroid Build Coastguard Worker  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22*8d67ca89SAndroid Build Coastguard Worker  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23*8d67ca89SAndroid Build Coastguard Worker  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24*8d67ca89SAndroid Build Coastguard Worker  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25*8d67ca89SAndroid Build Coastguard Worker  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*8d67ca89SAndroid Build Coastguard Worker  * SUCH DAMAGE.
27*8d67ca89SAndroid Build Coastguard Worker  */
28*8d67ca89SAndroid Build Coastguard Worker 
29*8d67ca89SAndroid Build Coastguard Worker #include <pthread.h>
30*8d67ca89SAndroid Build Coastguard Worker 
31*8d67ca89SAndroid Build Coastguard Worker #include "header_checks.h"
32*8d67ca89SAndroid Build Coastguard Worker 
pthread_h()33*8d67ca89SAndroid Build Coastguard Worker static void pthread_h() {
34*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_BARRIER_SERIAL_THREAD);
35*8d67ca89SAndroid Build Coastguard Worker 
36*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No thread cancellation on Android.
37*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CANCEL_ASYNCHRONOUS);
38*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CANCEL_ENABLE);
39*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CANCEL_DEFERRED);
40*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CANCEL_DISABLE);
41*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CANCELED);
42*8d67ca89SAndroid Build Coastguard Worker #endif
43*8d67ca89SAndroid Build Coastguard Worker 
44*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CREATE_DETACHED);
45*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_CREATE_JOINABLE);
46*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_EXPLICIT_SCHED);
47*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_INHERIT_SCHED);
48*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_MUTEX_DEFAULT);
49*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_MUTEX_ERRORCHECK);
50*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_MUTEX_NORMAL);
51*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_MUTEX_RECURSIVE);
52*8d67ca89SAndroid Build Coastguard Worker 
53*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
54*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_MUTEX_ROBUST);
55*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_MUTEX_STALLED);
56*8d67ca89SAndroid Build Coastguard Worker #endif
57*8d67ca89SAndroid Build Coastguard Worker 
58*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_ONCE_INIT);
59*8d67ca89SAndroid Build Coastguard Worker 
60*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_PRIO_INHERIT);
61*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_PRIO_NONE);
62*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__)
63*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_PRIO_PROTECT);
64*8d67ca89SAndroid Build Coastguard Worker #endif
65*8d67ca89SAndroid Build Coastguard Worker 
66*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_PROCESS_SHARED);
67*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_PROCESS_PRIVATE);
68*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_SCOPE_PROCESS);
69*8d67ca89SAndroid Build Coastguard Worker   MACRO(PTHREAD_SCOPE_SYSTEM);
70*8d67ca89SAndroid Build Coastguard Worker 
71*8d67ca89SAndroid Build Coastguard Worker   pthread_cond_t c0 = PTHREAD_COND_INITIALIZER;
72*8d67ca89SAndroid Build Coastguard Worker   pthread_mutex_t m0 = PTHREAD_MUTEX_INITIALIZER;
73*8d67ca89SAndroid Build Coastguard Worker   pthread_rwlock_t rw0 = PTHREAD_RWLOCK_INITIALIZER;
74*8d67ca89SAndroid Build Coastguard Worker 
75*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_attr_t);
76*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_barrier_t);
77*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_barrierattr_t);
78*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_cond_t);
79*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_condattr_t);
80*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_key_t);
81*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_mutex_t);
82*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_mutexattr_t);
83*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_once_t);
84*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_rwlock_t);
85*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_rwlockattr_t);
86*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_spinlock_t);
87*8d67ca89SAndroid Build Coastguard Worker   TYPE(pthread_t);
88*8d67ca89SAndroid Build Coastguard Worker 
89*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_atfork, int (*f)(void (*)(void), void (*)(void), void (*)(void)));
90*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_destroy, int (*f)(pthread_attr_t*));
91*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getdetachstate, int (*f)(const pthread_attr_t*, int*));
92*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getguardsize, int (*f)(const pthread_attr_t*, size_t*));
93*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getinheritsched, int (*f)(const pthread_attr_t*, int*));
94*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getschedparam, int (*f)(const pthread_attr_t*, struct sched_param*));
95*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getschedpolicy, int (*f)(const pthread_attr_t*, int*));
96*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getscope, int (*f)(const pthread_attr_t*, int*));
97*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getstack, int (*f)(const pthread_attr_t*, void**, size_t*));
98*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_getstacksize, int (*f)(const pthread_attr_t*, size_t*));
99*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_init, int (*f)(pthread_attr_t*));
100*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setdetachstate, int (*f)(pthread_attr_t*, int));
101*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setguardsize, int (*f)(pthread_attr_t*, size_t));
102*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setinheritsched, int (*f)(pthread_attr_t*, int));
103*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setschedparam, int (*f)(pthread_attr_t*, const struct sched_param*));
104*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setschedpolicy, int (*f)(pthread_attr_t*, int));
105*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setscope, int (*f)(pthread_attr_t*, int));
106*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setstack, int (*f)(pthread_attr_t*, void*, size_t));
107*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_attr_setstacksize, int (*f)(pthread_attr_t*, size_t));
108*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrier_destroy, int (*f)(pthread_barrier_t*));
109*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrier_init, int (*f)(pthread_barrier_t*, const pthread_barrierattr_t*, unsigned));
110*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrier_wait, int (*f)(pthread_barrier_t*));
111*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrierattr_destroy, int (*f)(pthread_barrierattr_t*));
112*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrierattr_getpshared, int (*f)(const pthread_barrierattr_t*, int*));
113*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrierattr_init, int (*f)(pthread_barrierattr_t*));
114*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_barrierattr_setpshared, int (*f)(pthread_barrierattr_t*, int));
115*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No thread cancellation on Android.
116*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cancel, int (*f)(pthread_t));
117*8d67ca89SAndroid Build Coastguard Worker #endif
118*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cond_broadcast, int (*f)(pthread_cond_t*));
119*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cond_destroy, int (*f)(pthread_cond_t*));
120*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cond_init, int (*f)(pthread_cond_t*, const pthread_condattr_t*));
121*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cond_signal, int (*f)(pthread_cond_t*));
122*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cond_timedwait, int (*f)(pthread_cond_t*, pthread_mutex_t*, const struct timespec*));
123*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_cond_wait, int (*f)(pthread_cond_t*, pthread_mutex_t*));
124*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_condattr_destroy, int (*f)(pthread_condattr_t*));
125*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_condattr_getclock, int (*f)(const pthread_condattr_t*, clockid_t*));
126*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_condattr_getpshared, int (*f)(const pthread_condattr_t*, int*));
127*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_condattr_init, int (*f)(pthread_condattr_t*));
128*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_condattr_setclock, int (*f)(pthread_condattr_t*, clockid_t));
129*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_condattr_setpshared, int (*f)(pthread_condattr_t*, int));
130*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_create, int (*f)(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*));
131*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_detach, int (*f)(pthread_t));
132*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_equal, int (*f)(pthread_t, pthread_t));
133*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_exit, void (*f)(void*));
134*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // Marked obsolescent.
135*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_getconcurrency, int (*f)(void));
136*8d67ca89SAndroid Build Coastguard Worker #endif
137*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_getcpuclockid, int (*f)(pthread_t, clockid_t*));
138*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_getschedparam, int (*f)(pthread_t, int*, struct sched_param*));
139*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_getspecific, void* (*f)(pthread_key_t));
140*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_join, int (*f)(pthread_t, void**));
141*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_key_create, int (*f)(pthread_key_t*, void (*)(void*)));
142*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_key_delete, int (*f)(pthread_key_t));
143*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
144*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_consistent, int (*f)(pthread_mutex_t*));
145*8d67ca89SAndroid Build Coastguard Worker #endif
146*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_destroy, int (*f)(pthread_mutex_t*));
147*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
148*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_getprioceiling, int (*f)(const pthread_mutex_t*, int*));
149*8d67ca89SAndroid Build Coastguard Worker #endif
150*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_init, int (*f)(pthread_mutex_t*, const pthread_mutexattr_t*));
151*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_lock, int (*f)(pthread_mutex_t*));
152*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
153*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_setprioceiling, int (*f)(pthread_mutex_t*, int, int*));
154*8d67ca89SAndroid Build Coastguard Worker #endif
155*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_timedlock, int (*f)(pthread_mutex_t*, const struct timespec*));
156*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_trylock, int (*f)(pthread_mutex_t*));
157*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutex_unlock, int (*f)(pthread_mutex_t*));
158*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_destroy, int (*f)(pthread_mutexattr_t*));
159*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
160*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_getprioceiling, int (*f)(const pthread_mutexattr_t*, int*));
161*8d67ca89SAndroid Build Coastguard Worker #endif
162*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_getprotocol, int (*f)(const pthread_mutexattr_t*, int*));
163*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_getpshared, int (*f)(const pthread_mutexattr_t*, int*));
164*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
165*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_getrobust, int (*f)(const pthread_mutexattr_t*, int*));
166*8d67ca89SAndroid Build Coastguard Worker #endif
167*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_gettype, int (*f)(const pthread_mutexattr_t*, int*));
168*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_init, int (*f)(pthread_mutexattr_t*));
169*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
170*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_setprioceiling, int (*f)(pthread_mutexattr_t*, int));
171*8d67ca89SAndroid Build Coastguard Worker #endif
172*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_setprotocol, int (*f)(pthread_mutexattr_t*, int));
173*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_setpshared, int (*f)(pthread_mutexattr_t*, int));
174*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No robust mutexes on Android.
175*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_setrobust, int (*f)(pthread_mutexattr_t*, int));
176*8d67ca89SAndroid Build Coastguard Worker #endif
177*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_mutexattr_settype, int (*f)(pthread_mutexattr_t*, int));
178*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_once, int (*f)(pthread_once_t*, void (*)(void)));
179*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_destroy, int (*f)(pthread_rwlock_t*));
180*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_init, int (*f)(pthread_rwlock_t*, const pthread_rwlockattr_t*));
181*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_rdlock, int (*f)(pthread_rwlock_t*));
182*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_timedrdlock, int (*f)(pthread_rwlock_t*, const struct timespec*));
183*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_timedwrlock, int (*f)(pthread_rwlock_t*, const struct timespec*));
184*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_tryrdlock, int (*f)(pthread_rwlock_t*));
185*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_trywrlock, int (*f)(pthread_rwlock_t*));
186*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_unlock, int (*f)(pthread_rwlock_t*));
187*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlock_wrlock, int (*f)(pthread_rwlock_t*));
188*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlockattr_destroy, int (*f)(pthread_rwlockattr_t*));
189*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlockattr_getpshared, int (*f)(const pthread_rwlockattr_t*, int*));
190*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlockattr_init, int (*f)(pthread_rwlockattr_t*));
191*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_rwlockattr_setpshared, int (*f)(pthread_rwlockattr_t*, int));
192*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_self, pthread_t (*f)(void));
193*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No thread cancellation on Android.
194*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_setcancelstate, int (*f)(int, int*));
195*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_setcanceltype, int (*f)(int, int*));
196*8d67ca89SAndroid Build Coastguard Worker #endif
197*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // Marked obsolescent.
198*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_setconcurrency, int (*f)(int));
199*8d67ca89SAndroid Build Coastguard Worker #endif
200*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_setschedparam, int (*f)(pthread_t, int, const struct sched_param*));
201*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_setschedprio, int (*f)(pthread_t, int));
202*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_setspecific, int (*f)(pthread_key_t, const void*));
203*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_spin_destroy, int (*f)(pthread_spinlock_t*));
204*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_spin_init, int (*f)(pthread_spinlock_t*, int));
205*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_spin_lock, int (*f)(pthread_spinlock_t*));
206*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_spin_trylock, int (*f)(pthread_spinlock_t*));
207*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_spin_unlock, int (*f)(pthread_spinlock_t*));
208*8d67ca89SAndroid Build Coastguard Worker #if !defined(__BIONIC__) // No thread cancellation on Android.
209*8d67ca89SAndroid Build Coastguard Worker   FUNCTION(pthread_testcancel, void (*f)(void));
210*8d67ca89SAndroid Build Coastguard Worker #endif
211*8d67ca89SAndroid Build Coastguard Worker 
212*8d67ca89SAndroid Build Coastguard Worker #if !defined(pthread_cleanup_pop)
213*8d67ca89SAndroid Build Coastguard Worker #error pthread_cleanup_pop
214*8d67ca89SAndroid Build Coastguard Worker #endif
215*8d67ca89SAndroid Build Coastguard Worker #if !defined(pthread_cleanup_push)
216*8d67ca89SAndroid Build Coastguard Worker #error pthread_cleanup_push
217*8d67ca89SAndroid Build Coastguard Worker #endif
218*8d67ca89SAndroid Build Coastguard Worker }
219*8d67ca89SAndroid Build Coastguard Worker 
220*8d67ca89SAndroid Build Coastguard Worker // POSIX: "Inclusion of the <pthread.h> header shall make symbols defined in the
221*8d67ca89SAndroid Build Coastguard Worker // headers <sched.h> and <time.h> visible."
222*8d67ca89SAndroid Build Coastguard Worker 
223*8d67ca89SAndroid Build Coastguard Worker #define DO_NOT_INCLUDE_SCHED_H
224*8d67ca89SAndroid Build Coastguard Worker #include "sched_h.c"
225*8d67ca89SAndroid Build Coastguard Worker #define DO_NOT_INCLUDE_TIME_H
226*8d67ca89SAndroid Build Coastguard Worker #include "time_h.c"
227