]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/gthr-posix.c
Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.
[thirdparty/gcc.git] / gcc / gthr-posix.c
CommitLineData
2a4e8ebc
RO
1/* POSIX threads dummy routines for systems without weak definitions. */
2/* Compile this one with gcc. */
748086b7 3/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
2a4e8ebc
RO
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
748086b7 9Software Foundation; either version 3, or (at your option) any later
2a4e8ebc
RO
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
748086b7
JJ
17Under Section 7 of GPL version 3, you are granted additional
18permissions described in the GCC Runtime Library Exception, version
193.1, as published by the Free Software Foundation.
2a4e8ebc 20
748086b7
JJ
21You should have received a copy of the GNU General Public License and
22a copy of the GCC Runtime Library Exception along with this program;
23see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24<http://www.gnu.org/licenses/>. */
2a4e8ebc
RO
25
26#include "tconfig.h"
27#include "tm.h"
b36e79e5 28# define __gthrw_pragma(pragma) _Pragma (#pragma)
2a4e8ebc
RO
29/* Define so we provide weak definitions of functions used by libobjc only. */
30#define _LIBOBJC_WEAK
31#include "gthr.h"
32
33int
34pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
35 void (*func) (void) ATTRIBUTE_UNUSED)
36{
37 return -1;
38}
39
40int
41pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
42 void (*dtor) (void *) ATTRIBUTE_UNUSED)
43{
44 return -1;
45}
46
47int
48pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
49{
50 return 0;
51}
52
53void *
54pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
55{
56 return 0;
57}
58
59int
60pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
61 const void *ptr ATTRIBUTE_UNUSED)
62{
63 return 0;
64}
65
66int
67pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
68 const pthread_attr_t *attr ATTRIBUTE_UNUSED,
69 void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
70 void *arg ATTRIBUTE_UNUSED)
71{
72 return 0;
73}
74
a75150ae
CF
75int
76pthread_join (pthread_t thread ATTRIBUTE_UNUSED,
77 void **value_ptr ATTRIBUTE_UNUSED)
78{
79 return 0;
80}
81
82void
83pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
84{
85}
86
87int
88pthread_detach (pthread_t thread ATTRIBUTE_UNUSED)
89{
90 return 0;
91}
92
35205e8f 93int
b36e79e5 94pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
35205e8f
RO
95{
96 return 0;
97}
98
2a4e8ebc
RO
99int
100pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
101{
102 return 0;
103}
104
105int
106pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
107{
108 return 0;
109}
110
a75150ae 111#ifdef _POSIX_TIMEOUTS
1cd8b853 112#if _POSIX_TIMEOUTS >= 0
a75150ae
CF
113int
114pthread_mutex_timedlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
115 const struct timespec *abs_timeout ATTRIBUTE_UNUSED)
116{
117 return 0;
118}
1cd8b853 119#endif
a75150ae
CF
120#endif /* _POSIX_TIMEOUTS */
121
2a4e8ebc
RO
122int
123pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
124{
125 return 0;
126}
127
35205e8f
RO
128int
129pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
130{
131 return 0;
132}
133
134int
135pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
136 int type ATTRIBUTE_UNUSED)
137{
138 return 0;
139}
140
141int
142pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
143{
144 return 0;
145}
146
2a4e8ebc
RO
147int
148pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
149{
150 return 0;
151}
152
153int
154pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
155{
156 return 0;
157}
158
159int
160pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
161 const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
162{
163 return 0;
164}
165
166int
167pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
168{
169 return 0;
170}
171
172int
173pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
174 pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
175{
176 return 0;
177}
178
a75150ae
CF
179int
180pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED, \r
181 pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
182 const struct timespec *abstime ATTRIBUTE_UNUSED)
2a4e8ebc 183{
a75150ae 184 return 0;
2a4e8ebc
RO
185}
186
187int
188pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
189 const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
190{
191 return 0;
192}
193
194int
195pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
196{
197 return 0;
198}
199
200pthread_t
201pthread_self (void)
202{
203 return (pthread_t) 0;
204}
a75150ae 205
45863ba3 206#ifdef _POSIX_PRIORITY_SCHEDULING
2a4e8ebc
RO
207#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
208int
209sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
210{
211 return 0;
212}
213
214int
215sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
216{
217 return 0;
218}
219#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
45863ba3 220#endif /* _POSIX_PRIORITY_SCHEDULING */
2a4e8ebc
RO
221
222int
223sched_yield (void)
224{
225 return 0;
226}
227
228int
229pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
230{
231 return 0;
232}
233
234int
235pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
236{
237 return 0;
238}
239
240int
241pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
242 int detachstate ATTRIBUTE_UNUSED)
243{
244 return 0;
245}
246
247#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
248int
249pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
250 int *policy ATTRIBUTE_UNUSED,
251 struct sched_param *param ATTRIBUTE_UNUSED)
252{
253 return 0;
254}
255
256int
257pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
258 int policy ATTRIBUTE_UNUSED,
259 const struct sched_param *param ATTRIBUTE_UNUSED)
260{
261 return 0;
262}
263#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
264