hurd: Avoid PLT ref for __pthread_get_cleanup_stack
[glibc.git] / sysdeps / htl / pthread-functions.h
blobbb901e3b7f0300ed0268584e325c5a1f0dec67e0
1 /* Declaration of libc stubs for pthread functions. Hurd version.
2 Copyright (C) 2003-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _PTHREAD_FUNCTIONS_H
20 #define _PTHREAD_FUNCTIONS_H 1
22 #include <pthread.h>
24 int __pthread_attr_destroy (pthread_attr_t *);
25 int __pthread_attr_init (pthread_attr_t *);
26 int __pthread_attr_getdetachstate (const pthread_attr_t *, int *);
27 int __pthread_attr_setdetachstate (pthread_attr_t *, int);
28 int __pthread_attr_getinheritsched (const pthread_attr_t *, int *);
29 int __pthread_attr_setinheritsched (pthread_attr_t *, int);
30 int __pthread_attr_getschedparam (const pthread_attr_t *,
31 struct sched_param *);
32 int __pthread_attr_setschedparam (pthread_attr_t *,
33 const struct sched_param *);
34 int __pthread_attr_getschedpolicy (const pthread_attr_t *, int *);
35 int __pthread_attr_setschedpolicy (pthread_attr_t *, int);
36 int __pthread_attr_getscope (const pthread_attr_t *, int *);
37 int __pthread_attr_setscope (pthread_attr_t *, int);
38 int __pthread_condattr_destroy (pthread_condattr_t *);
39 int __pthread_condattr_init (pthread_condattr_t *);
40 int __pthread_cond_broadcast (pthread_cond_t *);
41 int __pthread_cond_destroy (pthread_cond_t *);
42 int __pthread_cond_init (pthread_cond_t *,
43 const pthread_condattr_t *);
44 int __pthread_cond_signal (pthread_cond_t *);
45 int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *);
46 int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *,
47 const struct timespec *);
48 int __pthread_equal (pthread_t, pthread_t);
49 void __pthread_exit (void *);
50 int __pthread_getschedparam (pthread_t, int *, struct sched_param *);
51 int __pthread_setschedparam (pthread_t, int,
52 const struct sched_param *);
53 int _pthread_mutex_destroy (pthread_mutex_t *);
54 int _pthread_mutex_init (pthread_mutex_t *,
55 const pthread_mutexattr_t *);
56 int __pthread_mutex_lock (pthread_mutex_t *);
57 int __pthread_mutex_trylock (pthread_mutex_t *);
58 int __pthread_mutex_unlock (pthread_mutex_t *);
59 pthread_t __pthread_self (void);
60 int __pthread_setcancelstate (int, int *);
61 int __pthread_setcanceltype (int, int *);
62 struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
63 #if IS_IN (libpthread)
64 hidden_proto (__pthread_get_cleanup_stack)
65 #endif
66 int __pthread_once (pthread_once_t *, void (*) (void));
67 int __pthread_rwlock_rdlock (pthread_rwlock_t *);
68 int __pthread_rwlock_wrlock (pthread_rwlock_t *);
69 int __pthread_rwlock_unlock (pthread_rwlock_t *);
70 int __pthread_key_create (pthread_key_t *, void (*) (void *));
71 void *__pthread_getspecific (pthread_key_t);
72 int __pthread_setspecific (pthread_key_t, const void *);
74 void _cthreads_flockfile (FILE *);
75 void _cthreads_funlockfile (FILE *);
76 int _cthreads_ftrylockfile (FILE *);
78 /* Data type shared with libc. The libc uses it to pass on calls to
79 the thread functions. Wine pokes directly into this structure,
80 so if possible avoid breaking it and append new hooks to the end. */
81 struct pthread_functions
83 int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
84 int (*ptr_pthread_attr_init) (pthread_attr_t *);
85 int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
86 int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
87 int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
88 int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int);
89 int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
90 struct sched_param *);
91 int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
92 const struct sched_param *);
93 int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
94 int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
95 int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
96 int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
97 int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
98 int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
99 int (*ptr_pthread_cond_broadcast) (pthread_cond_t *);
100 int (*ptr_pthread_cond_destroy) (pthread_cond_t *);
101 int (*ptr_pthread_cond_init) (pthread_cond_t *,
102 const pthread_condattr_t *);
103 int (*ptr_pthread_cond_signal) (pthread_cond_t *);
104 int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
105 int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
106 const struct timespec *);
107 int (*ptr_pthread_equal) (pthread_t, pthread_t);
108 void (*ptr___pthread_exit) (void *);
109 int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
110 int (*ptr_pthread_setschedparam) (pthread_t, int,
111 const struct sched_param *);
112 int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
113 int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
114 const pthread_mutexattr_t *);
115 int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
116 int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
117 int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
118 pthread_t (*ptr_pthread_self) (void);
119 int (*ptr___pthread_setcancelstate) (int, int *);
120 int (*ptr_pthread_setcanceltype) (int, int *);
121 struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
122 int (*ptr_pthread_once) (pthread_once_t *, void (*) (void));
123 int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *);
124 int (*ptr_pthread_rwlock_wrlock) (pthread_rwlock_t *);
125 int (*ptr_pthread_rwlock_unlock) (pthread_rwlock_t *);
126 int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
127 void *(*ptr___pthread_getspecific) (pthread_key_t);
128 int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
129 void (*ptr__IO_flockfile) (FILE *);
130 void (*ptr__IO_funlockfile) (FILE *);
131 int (*ptr__IO_ftrylockfile) (FILE *);
134 /* Variable in libc.so. */
135 extern struct pthread_functions __libc_pthread_functions attribute_hidden;
136 extern int __libc_pthread_functions_init attribute_hidden;
138 void __libc_pthread_init (const struct pthread_functions *functions);
140 #define PTHFCT_CALL(fct, params) \
141 __libc_pthread_functions.fct params
143 #endif /* pthread-functions.h */