]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/nptl/pthread-functions.h
nptl: Move pthread_attr_setinheritsched implementation into libc.
[thirdparty/glibc.git] / sysdeps / nptl / pthread-functions.h
CommitLineData
04277e02 1/* Copyright (C) 2003-2019 Free Software Foundation, Inc.
73e9ae88
UD
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
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
59ba27a6 16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
73e9ae88
UD
18
19#ifndef _PTHREAD_FUNCTIONS_H
20#define _PTHREAD_FUNCTIONS_H 1
21
22#include <pthread.h>
23#include <setjmp.h>
24#include <internaltypes.h>
ea1533e0 25#include <sysdep.h>
73e9ae88 26
ccd8de9a 27struct xid_command;
73e9ae88
UD
28
29/* Data type shared with libc. The libc uses it to pass on calls to
30 the thread functions. */
31struct pthread_functions
32{
73e9ae88
UD
33 int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
34 struct sched_param *);
35 int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
36 const struct sched_param *);
37 int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
38 int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
39 int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
40 int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
41 int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
42 int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
43 int (*ptr___pthread_cond_broadcast) (pthread_cond_t *);
44 int (*ptr___pthread_cond_destroy) (pthread_cond_t *);
45 int (*ptr___pthread_cond_init) (pthread_cond_t *,
46 const pthread_condattr_t *);
47 int (*ptr___pthread_cond_signal) (pthread_cond_t *);
48 int (*ptr___pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
c503d3dc
UD
49 int (*ptr___pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
50 const struct timespec *);
73e9ae88
UD
51 int (*ptr___pthread_cond_broadcast_2_0) (pthread_cond_2_0_t *);
52 int (*ptr___pthread_cond_destroy_2_0) (pthread_cond_2_0_t *);
53 int (*ptr___pthread_cond_init_2_0) (pthread_cond_2_0_t *,
54 const pthread_condattr_t *);
55 int (*ptr___pthread_cond_signal_2_0) (pthread_cond_2_0_t *);
56 int (*ptr___pthread_cond_wait_2_0) (pthread_cond_2_0_t *, pthread_mutex_t *);
c503d3dc
UD
57 int (*ptr___pthread_cond_timedwait_2_0) (pthread_cond_2_0_t *,
58 pthread_mutex_t *,
59 const struct timespec *);
356fa562 60 void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
73e9ae88
UD
61 int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
62 int (*ptr_pthread_setschedparam) (pthread_t, int,
63 const struct sched_param *);
64 int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
65 int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
66 const pthread_mutexattr_t *);
67 int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
68 int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
e5d19c08 69 int (*ptr___pthread_setcancelstate) (int, int *);
73e9ae88 70 int (*ptr_pthread_setcanceltype) (int, int *);
ea6a015b 71 void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *);
73e9ae88
UD
72 int (*ptr___pthread_once) (pthread_once_t *, void (*) (void));
73 int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *);
74 int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *);
75 int (*ptr___pthread_rwlock_unlock) (pthread_rwlock_t *);
76 int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
886d5973 77 void *(*ptr___pthread_getspecific) (pthread_key_t);
73e9ae88
UD
78 int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
79 void (*ptr__pthread_cleanup_push_defer) (struct _pthread_cleanup_buffer *,
80 void (*) (void *), void *);
81 void (*ptr__pthread_cleanup_pop_restore) (struct _pthread_cleanup_buffer *,
82 int);
47202270 83#define HAVE_PTR_NTHREADS
9cfe5381 84 unsigned int *ptr_nthreads;
09d65ff3
UD
85 void (*ptr___pthread_unwind) (__pthread_unwind_buf_t *)
86 __attribute ((noreturn)) __cleanup_fct_attribute;
3fa21fd8 87 void (*ptr__nptl_deallocate_tsd) (void);
ccd8de9a 88 int (*ptr__nptl_setxid) (struct xid_command *);
6f8326ca 89 void (*ptr_set_robust) (struct pthread *);
73e9ae88
UD
90};
91
92/* Variable in libc.so. */
93extern struct pthread_functions __libc_pthread_functions attribute_hidden;
ea1533e0
UD
94extern int __libc_pthread_functions_init attribute_hidden;
95
858ee15d 96#ifdef PTR_DEMANGLE
858ee15d 97# define PTHFCT_CALL(fct, params) \
ea1533e0
UD
98 ({ __typeof (__libc_pthread_functions.fct) __p; \
99 __p = __libc_pthread_functions.fct; \
100 PTR_DEMANGLE (__p); \
101 __p params; })
0f7769f7
UD
102#else
103# define PTHFCT_CALL(fct, params) \
104 __libc_pthread_functions.fct params
858ee15d 105#endif
73e9ae88
UD
106
107#endif /* pthread-functions.h */