1 /*
2  * Copyright (c) 2002, Intel Corporation. All rights reserved.
3  * Created by:  rolla.n.selbak REMOVE-THIS AT intel DOT com
4  * This file is licensed under the GPL license.  For the full content
5  * of this license, see the COPYING file at the top level of this
6  * source tree.
7 
8  Test this function is defined:
9 
10  int pthread_mutexattr_destroy(pthread_mutexattr_t *);
11  */
12 
13 #include <pthread.h>
14 
15 int     (*test_pthread_atfork)(void (*prepare)(void), void (*parent)(void), void (*child)(void));
16 int     (*test_pthread_attr_destroy)(pthread_attr_t *__attr);
17 int     (*test_pthread_attr_getdetachstate)(const pthread_attr_t *__attr, int *__detachstate);
18 int     (*test_pthread_attr_getguardsize)(const pthread_attr_t *__attr, size_t *__guardsize);
19 int     (*test_pthread_attr_getinheritsched)(const pthread_attr_t *__attr, int *__inheritsched);
20 int     (*test_pthread_attr_getschedparam)(const pthread_attr_t *__attr, struct sched_param *__param);
21 int     (*test_pthread_attr_getschedpolicy)(const pthread_attr_t *__attr, int *__policy);
22 int     (*test_pthread_attr_getscope)(const pthread_attr_t *__attr, int *__contentionscope);
23 int     (*test_pthread_attr_getstack)(const pthread_attr_t *attr, void **__stackaddr, size_t *__stacksize);
24 int     (*test_pthread_attr_getstackaddr)(const pthread_attr_t *__attr, void **__stackaddr);
25 int     (*test_pthread_attr_getstacksize)(const pthread_attr_t *__attr, size_t *__stacksize);
26 int     (*test_pthread_attr_init)(pthread_attr_t *__attr);
27 int     (*test_pthread_attr_setdetachstate)(pthread_attr_t *__attr, int __detachstate);
28 int     (*test_pthread_attr_setguardsize)(pthread_attr_t *__attr, size_t __guardsize);
29 int     (*test_pthread_attr_setinheritsched)(pthread_attr_t *__attr, int __inheritsched);
30 int     (*test_pthread_attr_setschedparam)(pthread_attr_t *__attr, const struct sched_param *__param);
31 int     (*test_pthread_attr_setschedpolicy)(pthread_attr_t *__attr, int __policy);
32 int     (*test_pthread_attr_setscope)(pthread_attr_t *__attr, int __contentionscope);
33 int     (*test_pthread_attr_setstack)(pthread_attr_t *attr, void *__stackaddr, size_t __stacksize);
34 int     (*test_pthread_attr_setstackaddr)(pthread_attr_t  *__attr, void *__stackaddr);
35 int     (*test_pthread_attr_setstacksize)(pthread_attr_t *__attr, size_t __stacksize);
36 int     (*test_pthread_cancel)(pthread_t __pthread);
37 void    (*test_pthread_cleanup_pop)(int execute);
38 void    (*test_pthread_cleanup_push)(void (*routine)(void*), void *arg);
39 int     (*test_pthread_cond_broadcast)(pthread_cond_t *__cond);
40 int     (*test_pthread_cond_destroy)(pthread_cond_t *__mutex);
41 int     (*test_pthread_cond_init)(pthread_cond_t *__cond, const pthread_condattr_t *__attr);
42 int     (*test_pthread_cond_signal)(pthread_cond_t *__cond);
43 int     (*test_pthread_cond_timedwait)(pthread_cond_t *__cond, pthread_mutex_t *__mutex, const struct timespec *__abstime);
44 int     (*test_pthread_cond_wait)(pthread_cond_t *__cond, pthread_mutex_t *__mutex);
45 int     (*test_pthread_condattr_destroy)(pthread_condattr_t *__attr);
46 int     (*test_pthread_condattr_getclock)(const pthread_condattr_t *__restrict __attr, clockid_t *__restrict __clock_id);
47 int     (*test_pthread_condattr_init)(pthread_condattr_t *__attr);
48 int     (*test_pthread_condattr_setclock)(pthread_condattr_t *__attr, clockid_t __clock_id);
49 int     (*test_pthread_create)(pthread_t *__pthread, const pthread_attr_t  *__attr, void *(*__start_routine)(void *), void *__arg);
50 int     (*test_pthread_detach)(pthread_t __pthread);
51 int     (*test_pthread_equal)(pthread_t __t1, pthread_t __t2);
52 void    (*test_pthread_exit)(void *__value_ptr);
53 int     (*test_pthread_getcpuclockid)(pthread_t thread, clockid_t *clock_id);
54 int     (*test_pthread_getconcurrency)(void);
55 int     (*test_pthread_getschedparam)(pthread_t __pthread, int *__policy, struct sched_param *__param);
56 void *  (*test_pthread_getspecific)(pthread_key_t __key);
57 int     (*test_pthread_join)(pthread_t __pthread, void **__value_ptr);
58 int     (*test_pthread_key_create)(pthread_key_t *__key, void (*__destructor)(void *));
59 int     (*test_pthread_key_delete)(pthread_key_t __key);
60 int     (*test_pthread_mutex_destroy)(pthread_mutex_t *__mutex);
61 int     (*test_pthread_mutex_getprioceiling)(const pthread_mutex_t *__restrict __mutex, int *__prioceiling);
62 int     (*test_pthread_mutex_init)(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr);
63 int     (*test_pthread_mutex_lock)(pthread_mutex_t *__mutex);
64 int     (*test_pthread_mutex_setprioceiling)(pthread_mutex_t *__mutex, int __prioceiling, int *__old_ceiling);
65 int     (*test_pthread_mutex_trylock)(pthread_mutex_t *__mutex);
66 int     (*test_pthread_mutex_unlock)(pthread_mutex_t *__mutex);
67 int     (*test_pthread_mutexattr_destroy)(pthread_mutexattr_t *__attr);
68 int     (*test_pthread_mutexattr_getprioceiling)(const pthread_mutexattr_t *__attr, int *__prioceiling);
69 int     (*test_pthread_mutexattr_getprotocol)(const pthread_mutexattr_t *__attr, int *__protocol);
70 int     (*test_pthread_mutexattr_gettype)(const pthread_mutexattr_t *__attr, int *__kind);
71 int     (*test_pthread_mutexattr_init)(pthread_mutexattr_t *__attr);
72 int     (*test_pthread_mutexattr_setprioceiling)(const pthread_mutexattr_t *__attr, int __prioceiling);
73 int     (*test_pthread_mutexattr_setprotocol)(const pthread_mutexattr_t *__attr, int __protocol);
74 int     (*test_pthread_mutexattr_settype)(pthread_mutexattr_t *__attr, int __kind);
75 int     (*test_pthread_once)(pthread_once_t *__once_control, void (*__init_routine)(void));
76 pthread_t (*test_pthread_self)(void);
77 int     (*test_pthread_setcancelstate)(int __state, int *__oldstate);
78 int     (*test_pthread_setcanceltype)(int __type, int *__oldtype);
79 int     (*test_pthread_setconcurrency)(int new_level);
80 int     (*test_pthread_setschedparam)(pthread_t __pthread, int __policy, const struct sched_param *__param);
81 int     (*test_pthread_setschedprio)(pthread_t thread, int prio);
82 int     (*test_pthread_setspecific)(pthread_key_t __key, const void *__value);
83 void    (*test_pthread_testcancel)(void);
84 
85 
dummy_func()86 __attribute__((unused)) static void dummy_func()
87 {
88     test_pthread_atfork = pthread_atfork;
89     test_pthread_attr_destroy = pthread_attr_destroy;
90     test_pthread_attr_getdetachstate = pthread_attr_getdetachstate;
91     test_pthread_attr_getguardsize = pthread_attr_getguardsize;
92     test_pthread_attr_getinheritsched = pthread_attr_getinheritsched;
93     test_pthread_attr_getschedparam = pthread_attr_getschedparam;
94     test_pthread_attr_getschedpolicy = pthread_attr_getschedpolicy;
95     test_pthread_attr_getscope = pthread_attr_getscope;
96     test_pthread_attr_getstack = pthread_attr_getstack;
97     test_pthread_attr_getstackaddr = pthread_attr_getstackaddr;
98     test_pthread_attr_getstacksize = pthread_attr_getstacksize;
99     test_pthread_attr_init = pthread_attr_init;
100     test_pthread_attr_setdetachstate = pthread_attr_setdetachstate;
101     test_pthread_attr_setguardsize = pthread_attr_setguardsize;
102     test_pthread_attr_setinheritsched = pthread_attr_setinheritsched;
103     test_pthread_attr_setschedparam = pthread_attr_setschedparam;
104     test_pthread_attr_setschedpolicy = pthread_attr_setschedpolicy;
105     test_pthread_attr_setscope = pthread_attr_setscope;
106     test_pthread_attr_setstack = pthread_attr_setstack;
107     test_pthread_attr_setstackaddr = pthread_attr_setstackaddr;
108     test_pthread_attr_setstacksize = pthread_attr_setstacksize;
109     test_pthread_cancel = pthread_cancel;
110     test_pthread_cleanup_pop = pthread_cleanup_pop;
111     test_pthread_cleanup_push = pthread_cleanup_push;
112     test_pthread_cond_broadcast = pthread_cond_broadcast;
113     test_pthread_cond_destroy = pthread_cond_destroy;
114     test_pthread_cond_init = pthread_cond_init;
115     test_pthread_cond_signal = pthread_cond_signal;
116     test_pthread_cond_timedwait = pthread_cond_timedwait;
117     test_pthread_cond_wait = pthread_cond_wait;
118     test_pthread_condattr_destroy = pthread_condattr_destroy;
119     test_pthread_condattr_getclock = pthread_condattr_getclock;
120     test_pthread_condattr_init = pthread_condattr_init;
121     test_pthread_condattr_setclock = pthread_condattr_setclock;
122     test_pthread_create = pthread_create;
123     test_pthread_detach = pthread_detach;
124     test_pthread_equal = pthread_equal;
125     test_pthread_exit = pthread_exit;
126     test_pthread_getcpuclockid = pthread_getcpuclockid;
127     test_pthread_getconcurrency = pthread_getconcurrency;
128     test_pthread_getschedparam = pthread_getschedparam;
129     test_pthread_getspecific = pthread_getspecific;
130     test_pthread_join = pthread_join;
131     test_pthread_key_create = pthread_key_create;
132     test_pthread_key_delete = pthread_key_delete;
133     test_pthread_mutex_destroy = pthread_mutex_destroy;
134     test_pthread_mutex_getprioceiling = pthread_mutex_getprioceiling;
135     test_pthread_mutex_init = pthread_mutex_init;
136     test_pthread_mutex_lock = pthread_mutex_lock;
137     test_pthread_mutex_setprioceiling = pthread_mutex_setprioceiling;
138     test_pthread_mutex_trylock = pthread_mutex_trylock;
139     test_pthread_mutex_unlock = pthread_mutex_unlock;
140     test_pthread_mutexattr_destroy = pthread_mutexattr_destroy;
141     test_pthread_mutexattr_getprioceiling = pthread_mutexattr_getprioceiling;
142     test_pthread_mutexattr_getprotocol = pthread_mutexattr_getprotocol;
143     test_pthread_mutexattr_gettype = pthread_mutexattr_gettype;
144     test_pthread_mutexattr_init = pthread_mutexattr_init;
145     test_pthread_mutexattr_setprioceiling = pthread_mutexattr_setprioceiling;
146     test_pthread_mutexattr_setprotocol = pthread_mutexattr_setprotocol;
147     test_pthread_mutexattr_settype = pthread_mutexattr_settype;
148     test_pthread_once = pthread_once;
149     test_pthread_self = pthread_self;
150     test_pthread_setcancelstate = pthread_setcancelstate;
151     test_pthread_setcanceltype = pthread_setcanceltype;
152     test_pthread_setconcurrency = pthread_setconcurrency;
153     test_pthread_setschedparam = pthread_setschedparam;
154     test_pthread_setschedprio = pthread_setschedprio;
155     test_pthread_setspecific = pthread_setspecific;
156     test_pthread_testcancel = pthread_testcancel;
157 
158     return;
159 }
160