Deleted Added
full compact
_pthread_stubs.c (132849) _pthread_stubs.c (152333)
1/*
2 * Copyright (c) 2001 Daniel Eischen <deischen@FreeBSD.org>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2001 Daniel Eischen <deischen@FreeBSD.org>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libc/gen/_pthread_stubs.c 132849 2004-07-29 18:07:08Z kan $");
28__FBSDID("$FreeBSD: head/lib/libc/gen/_pthread_stubs.c 152333 2005-11-12 16:00:29Z deischen $");
29
30#include <signal.h>
31#include <pthread.h>
32
33#include "libc_private.h"
34
35/*
36 * Weak symbols: All libc internal usage of these functions should

--- 55 unchanged lines hidden (view full) ---

92 */
93#define WEAK_REF(sym, alias) __weak_reference(sym, alias)
94
95#define FUNC_TYPE(name) __CONCAT(name, _func_t)
96#define FUNC_INT(name) __CONCAT(name, _int)
97#define FUNC_EXP(name) __CONCAT(name, _exp)
98
99#define STUB_FUNC(name, idx, ret) \
29
30#include <signal.h>
31#include <pthread.h>
32
33#include "libc_private.h"
34
35/*
36 * Weak symbols: All libc internal usage of these functions should

--- 55 unchanged lines hidden (view full) ---

92 */
93#define WEAK_REF(sym, alias) __weak_reference(sym, alias)
94
95#define FUNC_TYPE(name) __CONCAT(name, _func_t)
96#define FUNC_INT(name) __CONCAT(name, _int)
97#define FUNC_EXP(name) __CONCAT(name, _exp)
98
99#define STUB_FUNC(name, idx, ret) \
100 static ret FUNC_EXP(name)(void) __used; \
101 static ret FUNC_INT(name)(void) __used; \
100 static ret FUNC_EXP(name)(void) __used; \
101 static ret FUNC_INT(name)(void) __used; \
102 WEAK_REF(FUNC_EXP(name), name); \
103 WEAK_REF(FUNC_INT(name), __CONCAT(_, name)); \
104 typedef ret (*FUNC_TYPE(name))(void); \
105 static ret FUNC_EXP(name)(void) \
106 { \
107 FUNC_TYPE(name) func; \
108 func = (FUNC_TYPE(name))__thr_jtable[idx][0]; \
109 return (func()); \

--- 61 unchanged lines hidden (view full) ---

171 func = (FUNC_TYPE(name))__thr_jtable[idx][1]; \
172 return (func(p0, p1, p2)); \
173 }
174
175STUB_FUNC1(pthread_cond_broadcast, PJT_COND_BROADCAST, int, void *)
176STUB_FUNC1(pthread_cond_destroy, PJT_COND_DESTROY, int, void *)
177STUB_FUNC2(pthread_cond_init, PJT_COND_INIT, int, void *, void *)
178STUB_FUNC1(pthread_cond_signal, PJT_COND_SIGNAL, int, void *)
102 WEAK_REF(FUNC_EXP(name), name); \
103 WEAK_REF(FUNC_INT(name), __CONCAT(_, name)); \
104 typedef ret (*FUNC_TYPE(name))(void); \
105 static ret FUNC_EXP(name)(void) \
106 { \
107 FUNC_TYPE(name) func; \
108 func = (FUNC_TYPE(name))__thr_jtable[idx][0]; \
109 return (func()); \

--- 61 unchanged lines hidden (view full) ---

171 func = (FUNC_TYPE(name))__thr_jtable[idx][1]; \
172 return (func(p0, p1, p2)); \
173 }
174
175STUB_FUNC1(pthread_cond_broadcast, PJT_COND_BROADCAST, int, void *)
176STUB_FUNC1(pthread_cond_destroy, PJT_COND_DESTROY, int, void *)
177STUB_FUNC2(pthread_cond_init, PJT_COND_INIT, int, void *, void *)
178STUB_FUNC1(pthread_cond_signal, PJT_COND_SIGNAL, int, void *)
179STUB_FUNC1(pthread_cond_wait, PJT_COND_WAIT, int, void *)
179STUB_FUNC2(pthread_cond_wait, PJT_COND_WAIT, int, void *, void *)
180STUB_FUNC1(pthread_getspecific, PJT_GETSPECIFIC, void *, pthread_key_t)
181STUB_FUNC2(pthread_key_create, PJT_KEY_CREATE, int, void *, void *)
182STUB_FUNC1(pthread_key_delete, PJT_KEY_DELETE, int, pthread_key_t)
183STUB_FUNC(pthread_main_np, PJT_MAIN_NP, int)
184STUB_FUNC1(pthread_mutex_destroy, PJT_MUTEX_DESTROY, int, void *)
185STUB_FUNC2(pthread_mutex_init, PJT_MUTEX_INIT, int, void *, void *)
186STUB_FUNC1(pthread_mutex_lock, PJT_MUTEX_LOCK, int, void *)
187STUB_FUNC1(pthread_mutex_trylock, PJT_MUTEX_TRYLOCK, int, void *)

--- 39 unchanged lines hidden ---
180STUB_FUNC1(pthread_getspecific, PJT_GETSPECIFIC, void *, pthread_key_t)
181STUB_FUNC2(pthread_key_create, PJT_KEY_CREATE, int, void *, void *)
182STUB_FUNC1(pthread_key_delete, PJT_KEY_DELETE, int, pthread_key_t)
183STUB_FUNC(pthread_main_np, PJT_MAIN_NP, int)
184STUB_FUNC1(pthread_mutex_destroy, PJT_MUTEX_DESTROY, int, void *)
185STUB_FUNC2(pthread_mutex_init, PJT_MUTEX_INIT, int, void *, void *)
186STUB_FUNC1(pthread_mutex_lock, PJT_MUTEX_LOCK, int, void *)
187STUB_FUNC1(pthread_mutex_trylock, PJT_MUTEX_TRYLOCK, int, void *)

--- 39 unchanged lines hidden ---