xref: /haiku/headers/compatibility/gnu/pthread.h (revision fc7456e9b1ec38c941134ed6d01c438cf289381e)
1 /*
2  * Copyright 2019 Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _GNU_PTHREAD_H_
6 #define _GNU_PTHREAD_H_
7 
8 
9 #include_next <pthread.h>
10 #include <features.h>
11 
12 
13 #ifdef _DEFAULT_SOURCE
14 
15 
16 #include <sched.h>
17 
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 
24 #define PTHREAD_MAX_NAMELEN_NP	32	// B_OS_NAME_LENGTH
25 
26 
27 extern int pthread_getattr_np(pthread_t thread, pthread_attr_t* attr);
28 
29 extern int pthread_getname_np(pthread_t thread, char* buffer, size_t length);
30 extern int pthread_setname_np(pthread_t thread, const char* name);
31 
32 extern int pthread_timedjoin_np(pthread_t thread, void** _value, const struct timespec* abstime);
33 
34 extern int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, const cpuset_t* mask);
35 extern int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, cpuset_t* mask);
36 
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 
43 #endif
44 
45 
46 #endif	/* _GNU_PTHREAD_H_ */
47 
48