gthr-posix.c revision 169689
1102714Sphk/* POSIX threads dummy routines for systems without weak definitions.  */
2102714Sphk/* Compile this one with gcc.  */
3102714Sphk/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
4102714Sphk
5102714SphkThis file is part of GCC.
6102714Sphk
7102714SphkGCC is free software; you can redistribute it and/or modify it under
8102714Sphkthe terms of the GNU General Public License as published by the Free
9102714SphkSoftware Foundation; either version 2, or (at your option) any later
10102714Sphkversion.
11140040Simp
12102714SphkGCC is distributed in the hope that it will be useful, but WITHOUT ANY
13102714SphkWARRANTY; without even the implied warranty of MERCHANTABILITY or
14102714SphkFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15102714Sphkfor more details.
16140040Simp
17140040SimpYou should have received a copy of the GNU General Public License
18140040Simpalong with GCC; see the file COPYING.  If not, write to the Free
19140040SimpSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20140040Simp02110-1301, USA.  */
21140040Simp
22140040Simp/* As a special exception, if you link this library with other files,
23140040Simp   some of which are compiled with GCC, to produce an executable,
24140040Simp   this library does not by itself cause the resulting executable
25140040Simp   to be covered by the GNU General Public License.
26140040Simp   This exception does not however invalidate any other reasons why
27102714Sphk   the executable file might be covered by the GNU General Public License.  */
28102714Sphk
29139749Simp#include "tconfig.h"
30102714Sphk#include "tm.h"
31102714Sphk/* Define so we provide weak definitions of functions used by libobjc only.  */
32102714Sphk#define _LIBOBJC_WEAK
33102714Sphk#include "gthr.h"
34102714Sphk
35102714Sphkint
36102714Sphkpthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
37102714Sphk	      void (*func) (void) ATTRIBUTE_UNUSED)
38102714Sphk{
39102714Sphk  return -1;
40102714Sphk}
41102714Sphk
42102714Sphkint
43102714Sphkpthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
44102714Sphk		    void (*dtor) (void *) ATTRIBUTE_UNUSED)
45102714Sphk{
46102714Sphk  return -1;
47102714Sphk}
48102714Sphk
49102714Sphkint
50102714Sphkpthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
51102714Sphk{
52102714Sphk  return 0;
53102714Sphk}
54102714Sphk
55102714Sphkvoid *
56102714Sphkpthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
57102714Sphk{
58102714Sphk  return 0;
59102714Sphk}
60102714Sphk
61102714Sphkint
62102714Sphkpthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
63102714Sphk		     const void *ptr ATTRIBUTE_UNUSED)
64102714Sphk{
65102714Sphk  return 0;
66129879Sphk}
67102714Sphk
68102714Sphkint
69102714Sphkpthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
70263109Srstone		const pthread_attr_t *attr ATTRIBUTE_UNUSED,
71102714Sphk		void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
72102714Sphk		void *arg ATTRIBUTE_UNUSED)
73102714Sphk{
74102714Sphk  return 0;
75102714Sphk}
76102714Sphk
77102714Sphkint
78102714Sphkpthread_cancel(pthread_t thread ATTRIBUTE_UNUSED)
79160030Sobrien{
80158124Smarcel  return 0;
81102714Sphk}
82263109Srstone
83267992Shselaskyint
84263109Srstonepthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
85263109Srstone{
86158124Smarcel  return 0;
87158124Smarcel}
88119814Smarcel
89172617Sdesint
90172617Sdespthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
91119814Smarcel{
92158124Smarcel  return 0;
93158124Smarcel}
94172617Sdes
95172617Sdesint
96172617Sdespthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
97172617Sdes{
98172617Sdes  return 0;
99172617Sdes}
100172617Sdes
101172617Sdesint
102172617Sdespthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
103172617Sdes{
104172617Sdes  return 0;
105172617Sdes}
106172617Sdes
107158124Smarcelint
108172617Sdespthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
109172617Sdes			   int type ATTRIBUTE_UNUSED)
110172617Sdes{
111172617Sdes  return 0;
112119814Smarcel}
113119814Smarcel
114102714Sphkint
115102714Sphkpthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
116102714Sphk{
117158124Smarcel  return 0;
118102714Sphk}
119119539Sjhb
120102714Sphkint
121102714Sphkpthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
122158124Smarcel{
123102714Sphk  return 0;
124102714Sphk}
125158124Smarcel
126102714Sphkint
127102714Sphkpthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
128263109Srstone{
129263109Srstone  return 0;
130263109Srstone}
131263109Srstone
132263109Srstoneint
133263109Srstonepthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
134263109Srstone		   const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
135263109Srstone{
136263109Srstone  return 0;
137263109Srstone}
138263109Srstone
139263109Srstoneint
140263109Srstonepthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
141263109Srstone{
142263109Srstone  return 0;
143263109Srstone}
144263109Srstone
145263109Srstoneint
146263109Srstonepthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
147263109Srstone		   pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
148263109Srstone{
149263109Srstone  return 0;
150263109Srstone}
151263109Srstone
152263109Srstonevoid
153263109Srstonepthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
154263109Srstone{
155263109Srstone}
156263109Srstone
157263109Srstoneint
158263109Srstonepthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
159263109Srstone		    const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
160263109Srstone{
161263109Srstone  return 0;
162263109Srstone}
163263109Srstone
164263109Srstoneint
165263109Srstonepthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
166263109Srstone{
167263109Srstone  return 0;
168263109Srstone}
169263109Srstone
170263109Srstonepthread_t
171263109Srstonepthread_self (void)
172263109Srstone{
173102714Sphk  return (pthread_t) 0;
174102714Sphk}
175102714Sphk#ifdef _POSIX_PRIORITY_SCHEDULING
176263109Srstone#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
177263109Srstoneint
178102714Sphksched_get_priority_max (int policy ATTRIBUTE_UNUSED)
179158124Smarcel{
180158124Smarcel  return 0;
181158124Smarcel}
182158124Smarcel
183158124Smarcelint
184158124Smarcelsched_get_priority_min (int policy ATTRIBUTE_UNUSED)
185223091Sjhb{
186223091Sjhb  return 0;
187223091Sjhb}
188227843Smarius#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
189227843Smarius#endif /* _POSIX_PRIORITY_SCHEDULING */
190102714Sphk
191102714Sphkint
192102714Sphksched_yield (void)
193158124Smarcel{
194102714Sphk  return 0;
195102714Sphk}
196102714Sphk
197102714Sphkint
198102714Sphkpthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
199{
200  return 0;
201}
202
203int
204pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
205{
206  return 0;
207}
208
209int
210pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
211			     int detachstate ATTRIBUTE_UNUSED)
212{
213  return 0;
214}
215
216#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
217int
218pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
219		       int *policy ATTRIBUTE_UNUSED,
220		       struct sched_param *param ATTRIBUTE_UNUSED)
221{
222  return 0;
223}
224
225int
226pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
227		       int policy ATTRIBUTE_UNUSED,
228		       const struct sched_param *param ATTRIBUTE_UNUSED)
229{
230  return 0;
231}
232#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
233
234