1 |
1325 |
phoenix |
/* The weak pthread functions for Linux.
|
2 |
|
|
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
3 |
|
|
This file is part of the GNU C Library.
|
4 |
|
|
|
5 |
|
|
The GNU C Library is free software; you can redistribute it and/or
|
6 |
|
|
modify it under the terms of the GNU Library General Public License as
|
7 |
|
|
published by the Free Software Foundation; either version 2 of the
|
8 |
|
|
License, or (at your option) any later version.
|
9 |
|
|
|
10 |
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
11 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13 |
|
|
Library General Public License for more details.
|
14 |
|
|
|
15 |
|
|
You should have received a copy of the GNU Library General Public
|
16 |
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
17 |
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
18 |
|
|
Boston, MA 02111-1307, USA. */
|
19 |
|
|
|
20 |
|
|
#include <errno.h>
|
21 |
|
|
#include <limits.h>
|
22 |
|
|
#include <stdlib.h>
|
23 |
|
|
|
24 |
|
|
extern int __pthread_return_0 __P ((void));
|
25 |
|
|
extern int __pthread_return_1 __P ((void));
|
26 |
|
|
extern void __pthread_return_void __P ((void));
|
27 |
|
|
|
28 |
|
|
/**********************************************************************/
|
29 |
|
|
/* Weaks for application/library use.
|
30 |
|
|
*
|
31 |
|
|
* Verified by comparing to glibc's linuxthreads/forward.c and defined
|
32 |
|
|
* only those that are in the glibc abi.
|
33 |
|
|
* The commented aliases are ones that were previously defined in uClibc
|
34 |
|
|
* and which I left in for documentation.
|
35 |
|
|
*/
|
36 |
|
|
|
37 |
|
|
weak_alias (__pthread_return_0, pthread_attr_destroy)
|
38 |
|
|
weak_alias (__pthread_return_0, pthread_attr_getdetachstate)
|
39 |
|
|
weak_alias (__pthread_return_0, pthread_attr_getinheritsched)
|
40 |
|
|
weak_alias (__pthread_return_0, pthread_attr_getschedparam)
|
41 |
|
|
weak_alias (__pthread_return_0, pthread_attr_getschedpolicy)
|
42 |
|
|
weak_alias (__pthread_return_0, pthread_attr_getscope)
|
43 |
|
|
/* weak_alias (__pthread_return_0, pthread_attr_getstackaddr) */
|
44 |
|
|
/* weak_alias (__pthread_return_0, pthread_attr_getstacksize) */
|
45 |
|
|
weak_alias (__pthread_return_0, pthread_attr_init)
|
46 |
|
|
weak_alias (__pthread_return_0, pthread_attr_setdetachstate)
|
47 |
|
|
weak_alias (__pthread_return_0, pthread_attr_setinheritsched)
|
48 |
|
|
weak_alias (__pthread_return_0, pthread_attr_setschedparam)
|
49 |
|
|
weak_alias (__pthread_return_0, pthread_attr_setschedpolicy)
|
50 |
|
|
weak_alias (__pthread_return_0, pthread_attr_setscope)
|
51 |
|
|
/* weak_alias (__pthread_return_0, pthread_attr_setstackaddr) */
|
52 |
|
|
/* weak_alias (__pthread_return_0, pthread_attr_setstacksize) */
|
53 |
|
|
weak_alias (__pthread_return_0, pthread_cond_broadcast)
|
54 |
|
|
weak_alias (__pthread_return_0, pthread_cond_destroy)
|
55 |
|
|
weak_alias (__pthread_return_0, pthread_cond_init)
|
56 |
|
|
weak_alias (__pthread_return_0, pthread_cond_signal)
|
57 |
|
|
weak_alias (__pthread_return_0, pthread_cond_timedwait)
|
58 |
|
|
weak_alias (__pthread_return_0, pthread_cond_wait)
|
59 |
|
|
weak_alias (__pthread_return_0, pthread_condattr_destroy)
|
60 |
|
|
weak_alias (__pthread_return_0, pthread_condattr_init)
|
61 |
|
|
weak_alias (__pthread_return_0, pthread_getschedparam)
|
62 |
|
|
/* weak_alias (__pthread_return_0, pthread_getcancelstate) */
|
63 |
|
|
/* weak_alias (__pthread_return_0, pthread_getconcurrency) */
|
64 |
|
|
/* weak_alias (__pthread_return_0, pthread_getschedparam) */
|
65 |
|
|
weak_alias (__pthread_return_0, pthread_mutex_destroy)
|
66 |
|
|
weak_alias (__pthread_return_0, pthread_mutex_init)
|
67 |
|
|
weak_alias (__pthread_return_0, pthread_mutex_lock)
|
68 |
|
|
/* weak_alias (__pthread_return_0, pthread_mutex_trylock) */
|
69 |
|
|
weak_alias (__pthread_return_0, pthread_mutex_unlock)
|
70 |
|
|
/* weak_alias (__pthread_return_0, pthread_mutexattr_destroy) */
|
71 |
|
|
/* weak_alias (__pthread_return_0, pthread_mutexattr_gettype) */
|
72 |
|
|
/* weak_alias (__pthread_return_0, pthread_mutexattr_init) */
|
73 |
|
|
/* weak_alias (__pthread_return_0, pthread_mutexattr_settype) */
|
74 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_destroy) */
|
75 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_init) */
|
76 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_rdlock) */
|
77 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_tryrdlock) */
|
78 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_trywrlock) */
|
79 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_unlock) */
|
80 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlock_wrlock) */
|
81 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlockattr_destroy) */
|
82 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlockattr_getpshared) */
|
83 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlockattr_init) */
|
84 |
|
|
/* weak_alias (__pthread_return_0, pthread_rwlockattr_setpshared) */
|
85 |
|
|
weak_alias (__pthread_return_0, pthread_self)
|
86 |
|
|
weak_alias (__pthread_return_0, pthread_setcancelstate)
|
87 |
|
|
weak_alias (__pthread_return_0, pthread_setcanceltype)
|
88 |
|
|
/* weak_alias (__pthread_return_0, pthread_setconcurrency) */
|
89 |
|
|
weak_alias (__pthread_return_0, pthread_setschedparam)
|
90 |
|
|
|
91 |
|
|
/* Those are pthread functions which return 1 if successful. */
|
92 |
|
|
weak_alias (__pthread_return_1, pthread_equal)
|
93 |
|
|
|
94 |
|
|
/* pthread_exit () is a special case. */
|
95 |
|
|
void weak_function
|
96 |
|
|
pthread_exit (void *retval)
|
97 |
|
|
{
|
98 |
|
|
exit (EXIT_SUCCESS);
|
99 |
|
|
}
|
100 |
|
|
|
101 |
|
|
/**********************************************************************/
|
102 |
|
|
/* Weaks used internally by the C library. */
|
103 |
|
|
weak_alias (__pthread_return_0, __pthread_mutex_init)
|
104 |
|
|
weak_alias (__pthread_return_0, __pthread_mutex_lock)
|
105 |
|
|
weak_alias (__pthread_return_0, __pthread_mutex_trylock)
|
106 |
|
|
weak_alias (__pthread_return_0, __pthread_mutex_unlock)
|
107 |
|
|
|
108 |
|
|
/* Weaks used internally by the C library rpc code only. */
|
109 |
|
|
weak_alias (__pthread_return_0, __pthread_once)
|
110 |
|
|
weak_alias (__pthread_return_void, __pthread_initialize_minimal)
|
111 |
|
|
|
112 |
|
|
/**********************************************************************/
|
113 |
|
|
|
114 |
|
|
int
|
115 |
|
|
__pthread_return_0 (void)
|
116 |
|
|
{
|
117 |
|
|
return 0;
|
118 |
|
|
}
|
119 |
|
|
|
120 |
|
|
int
|
121 |
|
|
__pthread_return_1 (void)
|
122 |
|
|
{
|
123 |
|
|
return 1;
|
124 |
|
|
}
|
125 |
|
|
|
126 |
|
|
void
|
127 |
|
|
__pthread_return_void (void)
|
128 |
|
|
{
|
129 |
|
|
}
|