]> git.ipfire.org Git - thirdparty/glibc.git/blame - htl/pt-initialize.c
x86: In ld.so, diagnose missing APX support in APX-only builds
[thirdparty/glibc.git] / htl / pt-initialize.c
CommitLineData
33574c17 1/* Initialize pthreads library.
dff8da6b 2 Copyright (C) 2000-2024 Free Software Foundation, Inc.
33574c17
ST
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
ad2b41bf
ST
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.
33574c17
ST
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
ad2b41bf 13 Lesser General Public License for more details.
33574c17 14
ad2b41bf
ST
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
33574c17
ST
18
19#include <assert.h>
20#include <string.h>
21
22#include <pt-internal.h>
23#include <set-hooks.h>
24
25#include <pthread.h>
26#include <pthread-functions.h>
27
28#if IS_IN (libpthread)
29static const struct pthread_functions pthread_functions = {
30 .ptr_pthread_attr_destroy = __pthread_attr_destroy,
31 .ptr_pthread_attr_init = __pthread_attr_init,
33574c17 32 .ptr_pthread_attr_setschedparam = __pthread_attr_setschedparam,
33574c17
ST
33 .ptr_pthread_attr_getscope = __pthread_attr_getscope,
34 .ptr_pthread_attr_setscope = __pthread_attr_setscope,
35 .ptr_pthread_condattr_destroy = __pthread_condattr_destroy,
36 .ptr_pthread_condattr_init = __pthread_condattr_init,
37 .ptr_pthread_cond_broadcast = __pthread_cond_broadcast,
38 .ptr_pthread_cond_destroy = __pthread_cond_destroy,
39 .ptr_pthread_cond_init = __pthread_cond_init,
40 .ptr_pthread_cond_signal = __pthread_cond_signal,
41 .ptr_pthread_cond_wait = __pthread_cond_wait,
42 .ptr_pthread_cond_timedwait = __pthread_cond_timedwait,
33574c17 43 .ptr___pthread_exit = __pthread_exit,
e775f443
ST
44 .ptr_pthread_mutex_destroy = __pthread_mutex_destroy,
45 .ptr_pthread_mutex_init = __pthread_mutex_init,
33574c17
ST
46 .ptr_pthread_mutex_lock = __pthread_mutex_lock,
47 .ptr_pthread_mutex_trylock = __pthread_mutex_trylock,
48 .ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
33574c17
ST
49 .ptr___pthread_setcancelstate = __pthread_setcancelstate,
50 .ptr_pthread_setcanceltype = __pthread_setcanceltype,
51 .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack,
52 .ptr_pthread_once = __pthread_once,
53 .ptr_pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
54 .ptr_pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
55 .ptr_pthread_rwlock_unlock = __pthread_rwlock_unlock,
56 .ptr___pthread_key_create = __pthread_key_create,
57 .ptr___pthread_getspecific = __pthread_getspecific,
58 .ptr___pthread_setspecific = __pthread_setspecific,
59 .ptr__IO_flockfile = _cthreads_flockfile,
60 .ptr__IO_funlockfile = _cthreads_funlockfile,
61 .ptr__IO_ftrylockfile = _cthreads_ftrylockfile,
62};
63#endif /* IS_IN (libpthread) */
64
65/* Initialize the pthreads library. */
66void
67___pthread_init (void)
68{
69#if IS_IN (libpthread)
70 __libc_pthread_init (&pthread_functions);
71#endif
72}