Warning: This file is not a C or C++ file. It does not have highlighting.

1/* Declaration of libc stubs for pthread functions. Hurd version.
2 Copyright (C) 2003-2024 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 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.
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 Lesser General Public License for more details.
14
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 <https://www.gnu.org/licenses/>. */
18
19#ifndef _PTHREAD_FUNCTIONS_H
20#define _PTHREAD_FUNCTIONS_H 1
21
22#include <pthread.h>
23
24int __pthread_attr_destroy (pthread_attr_t *);
25int __pthread_attr_init (pthread_attr_t *);
26int __pthread_attr_setschedparam (pthread_attr_t *,
27 const struct sched_param *);
28int __pthread_attr_getscope (const pthread_attr_t *, int *);
29int __pthread_attr_setscope (pthread_attr_t *, int);
30int __pthread_condattr_destroy (pthread_condattr_t *);
31int __pthread_condattr_init (pthread_condattr_t *);
32int __pthread_cond_broadcast (pthread_cond_t *);
33int __pthread_cond_destroy (pthread_cond_t *);
34int __pthread_cond_init (pthread_cond_t *,
35 const pthread_condattr_t *);
36int __pthread_cond_signal (pthread_cond_t *);
37int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *);
38int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *,
39 const struct timespec *);
40void __pthread_exit (void *) __attribute__ ((__noreturn__));
41int _pthread_mutex_destroy (pthread_mutex_t *);
42int _pthread_mutex_init (pthread_mutex_t *,
43 const pthread_mutexattr_t *);
44int __pthread_mutex_lock (pthread_mutex_t *);
45int __pthread_mutex_trylock (pthread_mutex_t *);
46int __pthread_mutex_unlock (pthread_mutex_t *);
47int __pthread_setcancelstate (int, int *);
48int __pthread_setcanceltype (int, int *);
49struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
50int __pthread_once (pthread_once_t *, void (*) (void));
51int __pthread_rwlock_rdlock (pthread_rwlock_t *);
52int __pthread_rwlock_wrlock (pthread_rwlock_t *);
53int __pthread_rwlock_unlock (pthread_rwlock_t *);
54int __pthread_key_create (pthread_key_t *, void (*) (void *));
55void *__pthread_getspecific (pthread_key_t);
56int __pthread_setspecific (pthread_key_t, const void *);
57
58void _cthreads_flockfile (FILE *);
59void _cthreads_funlockfile (FILE *);
60int _cthreads_ftrylockfile (FILE *);
61
62/* Data type shared with libc. The libc uses it to pass on calls to
63 the thread functions. Wine pokes directly into this structure,
64 so if possible avoid breaking it and append new hooks to the end. */
65struct pthread_functions
66{
67 int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
68 int (*ptr_pthread_attr_init) (pthread_attr_t *);
69 int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
70 const struct sched_param *);
71 int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
72 int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
73 int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
74 int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
75 int (*ptr_pthread_cond_broadcast) (pthread_cond_t *);
76 int (*ptr_pthread_cond_destroy) (pthread_cond_t *);
77 int (*ptr_pthread_cond_init) (pthread_cond_t *,
78 const pthread_condattr_t *);
79 int (*ptr_pthread_cond_signal) (pthread_cond_t *);
80 int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
81 int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
82 const struct timespec *);
83 void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
84 int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
85 int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
86 const pthread_mutexattr_t *);
87 int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
88 int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
89 int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
90 int (*ptr___pthread_setcancelstate) (int, int *);
91 int (*ptr_pthread_setcanceltype) (int, int *);
92 struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
93 int (*ptr_pthread_once) (pthread_once_t *, void (*) (void));
94 int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *);
95 int (*ptr_pthread_rwlock_wrlock) (pthread_rwlock_t *);
96 int (*ptr_pthread_rwlock_unlock) (pthread_rwlock_t *);
97 int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
98 void *(*ptr___pthread_getspecific) (pthread_key_t);
99 int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
100 void (*ptr__IO_flockfile) (FILE *);
101 void (*ptr__IO_funlockfile) (FILE *);
102 int (*ptr__IO_ftrylockfile) (FILE *);
103};
104
105/* Variable in libc.so. */
106extern struct pthread_functions __libc_pthread_functions attribute_hidden;
107extern int __libc_pthread_functions_init attribute_hidden;
108
109void __libc_pthread_init (const struct pthread_functions *functions);
110
111#define PTHFCT_CALL(fct, params) \
112 __libc_pthread_functions.fct params
113
114#endif /* pthread-functions.h */
115

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of glibc/sysdeps/htl/pthread-functions.h