HAMMER utilities: feature add.
[dfdiff.git] / lib / libc / gen / pthread_fake.c
blobdd2d989c30e1c731ac8dbb64a1b175c7eae9a818
1 /*
2 * Copyright (c) 2004 The DragonFly Project. All rights reserved.
3 *
4 * This code is derived from software contributed to The DragonFly Project
5 * by Simon Schubert <corecode@fs.ei.tum.de>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
34 * $DragonFly: src/lib/libc/gen/pthread_fake.c,v 1.2 2005/04/26 08:41:44 joerg Exp $
37 #ifndef _THREAD_SAFE
39 * Provide the functions for non-threaded programs using
40 * thread-aware dynamic modules.
42 * This list explicitly lakes pthread_create, since an application
43 * using this function clearly should be linked against -lc_r.
44 * Leaving this function out allows the linker to catch this.
45 * Same reason applies for thread-aware modules.
48 #include <sys/cdefs.h>
50 #include <errno.h>
51 #include <stddef.h>
53 int _pthread_fake_inval(void);
54 void *_pthread_fake_null(void);
56 __weak_reference(_pthread_fake_inval, pthread_attr_destroy);
57 __weak_reference(_pthread_fake_inval, pthread_attr_get_np);
58 __weak_reference(_pthread_fake_inval, pthread_attr_getdetachstate);
59 __weak_reference(_pthread_fake_inval, pthread_attr_getinheritsched);
60 __weak_reference(_pthread_fake_inval, pthread_attr_getschedparam);
61 __weak_reference(_pthread_fake_inval, pthread_attr_getschedpolicy);
62 __weak_reference(_pthread_fake_inval, pthread_attr_getscope);
63 __weak_reference(_pthread_fake_inval, pthread_attr_getstack);
64 __weak_reference(_pthread_fake_inval, pthread_attr_getstackaddr);
65 __weak_reference(_pthread_fake_inval, pthread_attr_getstacksize);
66 __weak_reference(_pthread_fake_inval, pthread_attr_init);
67 __weak_reference(_pthread_fake_inval, pthread_attr_setcreatesuspend_np);
68 __weak_reference(_pthread_fake_inval, pthread_attr_setdetachstate);
69 __weak_reference(_pthread_fake_inval, pthread_attr_setinheritsched);
70 __weak_reference(_pthread_fake_inval, pthread_attr_setschedparam);
71 __weak_reference(_pthread_fake_inval, pthread_attr_setschedpolicy);
72 __weak_reference(_pthread_fake_inval, pthread_attr_setscope);
73 __weak_reference(_pthread_fake_inval, pthread_attr_setstack);
74 __weak_reference(_pthread_fake_inval, pthread_attr_setstackaddr);
75 __weak_reference(_pthread_fake_inval, pthread_attr_setstacksize);
76 __weak_reference(_pthread_fake_inval, pthread_cancel);
77 __weak_reference(_pthread_fake_inval, pthread_setcancelstate);
78 __weak_reference(_pthread_fake_inval, pthread_setcanceltype);
79 __weak_reference(_pthread_fake_inval, pthread_testcancel);/*XXX void */
80 __weak_reference(_pthread_fake_inval, pthread_cleanup_push);/*XXX void */
81 __weak_reference(_pthread_fake_inval, pthread_cleanup_pop);/*XXX void */
82 __weak_reference(_pthread_fake_inval, pthread_getconcurrency);
83 __weak_reference(_pthread_fake_inval, pthread_setconcurrency);
84 __weak_reference(_pthread_fake_inval, pthread_cond_init);
85 __weak_reference(_pthread_fake_inval, pthread_cond_destroy);
86 __weak_reference(_pthread_fake_inval, pthread_cond_wait);
87 __weak_reference(_pthread_fake_inval, pthread_cond_timedwait);
88 __weak_reference(_pthread_fake_inval, pthread_cond_signal);
89 __weak_reference(_pthread_fake_inval, pthread_cond_broadcast);
90 __weak_reference(_pthread_fake_inval, pthread_condattr_destroy);
91 __weak_reference(_pthread_fake_inval, pthread_condattr_init);
92 __weak_reference(_pthread_fake_inval, pthread_detach);
93 __weak_reference(_pthread_fake_inval, pthread_equal);/*XXX*/
94 __weak_reference(_pthread_fake_inval, pthread_exit);/*XXX void*/
95 __weak_reference(_pthread_fake_inval, pthread_getprio);
96 __weak_reference(_pthread_fake_inval, pthread_getschedparam);
97 __weak_reference(_pthread_fake_inval, pthread_set_name_np);/*XXX void*/
98 __weak_reference(_pthread_fake_inval, pthread_join);
99 __weak_reference(_pthread_fake_inval, pthread_kill);
100 __weak_reference(_pthread_fake_inval, pthread_main_np);
101 __weak_reference(_pthread_fake_inval, pthread_mutexattr_init);
102 __weak_reference(_pthread_fake_inval, pthread_mutexattr_setkind_np);
103 __weak_reference(_pthread_fake_inval, pthread_mutexattr_getkind_np);
104 __weak_reference(_pthread_fake_inval, pthread_mutexattr_gettype);
105 __weak_reference(_pthread_fake_inval, pthread_mutexattr_settype);
106 __weak_reference(_pthread_fake_inval, pthread_multi_np);
107 __weak_reference(_pthread_fake_inval, pthread_mutex_init);
108 __weak_reference(_pthread_fake_inval, pthread_mutex_destroy);
109 __weak_reference(_pthread_fake_inval, pthread_mutex_trylock);
110 __weak_reference(_pthread_fake_inval, pthread_mutex_lock);
111 __weak_reference(_pthread_fake_inval, pthread_mutex_unlock);
112 __weak_reference(_pthread_fake_inval, pthread_mutexattr_getprioceiling);
113 __weak_reference(_pthread_fake_inval, pthread_mutexattr_setprioceiling);
114 __weak_reference(_pthread_fake_inval, pthread_mutex_getprioceiling);
115 __weak_reference(_pthread_fake_inval, pthread_mutex_setprioceiling);
116 __weak_reference(_pthread_fake_inval, pthread_mutexattr_getprotocol);
117 __weak_reference(_pthread_fake_inval, pthread_mutexattr_setprotocol);
118 __weak_reference(_pthread_fake_inval, pthread_mutexattr_destroy);
119 __weak_reference(_pthread_fake_inval, pthread_once);
120 __weak_reference(_pthread_fake_inval, pthread_resume_np);
121 __weak_reference(_pthread_fake_inval, pthread_resume_all_np);/*XXX void*/
122 __weak_reference(_pthread_fake_inval, pthread_rwlock_destroy);
123 __weak_reference(_pthread_fake_inval, pthread_rwlock_init);
124 __weak_reference(_pthread_fake_inval, pthread_rwlock_rdlock);
125 __weak_reference(_pthread_fake_inval, pthread_rwlock_tryrdlock);
126 __weak_reference(_pthread_fake_inval, pthread_rwlock_trywrlock);
127 __weak_reference(_pthread_fake_inval, pthread_rwlock_unlock);
128 __weak_reference(_pthread_fake_inval, pthread_rwlock_wrlock);
129 __weak_reference(_pthread_fake_inval, pthread_rwlockattr_destroy);
130 __weak_reference(_pthread_fake_inval, pthread_rwlockattr_getpshared);
131 __weak_reference(_pthread_fake_inval, pthread_rwlockattr_init);
132 __weak_reference(_pthread_fake_inval, pthread_rwlockattr_setpshared);
133 __weak_reference(_pthread_fake_null, pthread_self);/*XXX pthread_t */
134 __weak_reference(_pthread_fake_inval, sem_init);
135 __weak_reference(_pthread_fake_inval, sem_destroy);
136 __weak_reference(_pthread_fake_inval, sem_open);
137 __weak_reference(_pthread_fake_inval, sem_close);
138 __weak_reference(_pthread_fake_inval, sem_unlink);
139 __weak_reference(_pthread_fake_inval, sem_wait);
140 __weak_reference(_pthread_fake_inval, sem_trywait);
141 __weak_reference(_pthread_fake_inval, sem_post);
142 __weak_reference(_pthread_fake_inval, sem_getvalue);
143 __weak_reference(_pthread_fake_inval, pthread_setprio);
144 __weak_reference(_pthread_fake_inval, pthread_setschedparam);
145 __weak_reference(_pthread_fake_inval, pthread_sigmask);
146 __weak_reference(_pthread_fake_inval, pthread_single_np);
147 __weak_reference(_pthread_fake_inval, pthread_key_create);
148 __weak_reference(_pthread_fake_inval, pthread_key_delete);
149 __weak_reference(_pthread_fake_inval, pthread_getspecific);
150 __weak_reference(_pthread_fake_inval, pthread_setspecific);
151 __weak_reference(_pthread_fake_inval, pthread_suspend_np);
152 __weak_reference(_pthread_fake_inval, pthread_suspend_all_np);/*XXX void*/
153 __weak_reference(_pthread_fake_inval, pthread_switch_add_np);
154 __weak_reference(_pthread_fake_inval, pthread_switch_delete_np);
155 __weak_reference(_pthread_fake_inval, sched_yield);
156 __weak_reference(_pthread_fake_inval, pthread_yield);/*XXX void*/
159 _pthread_fake_inval(void)
161 return EINVAL;
164 void *
165 _pthread_fake_null(void)
167 return NULL;
170 #endif /* _THREAD_SAFE */