xref: /haiku/headers/compatibility/gnu/pthread.h (revision 90dca2bc8ea3f248a1fe87fda98bc7f822dfcd38)
1ba56d0a5SJérôme Duval /*
2ba56d0a5SJérôme Duval  * Copyright 2019 Haiku, Inc. All Rights Reserved.
347a21c5cSAugustin Cavalier  * Distributed under the terms of the MIT License.
4ba56d0a5SJérôme Duval  */
5ba56d0a5SJérôme Duval #ifndef _GNU_PTHREAD_H_
6ba56d0a5SJérôme Duval #define _GNU_PTHREAD_H_
7ba56d0a5SJérôme Duval 
8ba56d0a5SJérôme Duval 
9ba56d0a5SJérôme Duval #include_next <pthread.h>
10f758e73fSJérôme Duval #include <features.h>
11ba56d0a5SJérôme Duval 
12*90dca2bcSAugustin Cavalier 
13*90dca2bcSAugustin Cavalier #ifdef _DEFAULT_SOURCE
14ba56d0a5SJérôme Duval 
15ba56d0a5SJérôme Duval 
16c5a740cdSJérôme Duval #include <sched.h>
17c5a740cdSJérôme Duval 
18c5a740cdSJérôme Duval 
19ba56d0a5SJérôme Duval #ifdef __cplusplus
20ba56d0a5SJérôme Duval extern "C" {
21ba56d0a5SJérôme Duval #endif
22ba56d0a5SJérôme Duval 
23ba56d0a5SJérôme Duval 
241754f053SJérôme Duval #define PTHREAD_MAX_NAMELEN_NP	32	// B_OS_NAME_LENGTH
251754f053SJérôme Duval 
261754f053SJérôme Duval 
27ba56d0a5SJérôme Duval extern int pthread_getattr_np(pthread_t thread, pthread_attr_t* attr);
28ba56d0a5SJérôme Duval 
2944cceee6SHan Pengfei extern int pthread_getname_np(pthread_t thread, char* buffer, size_t length);
3044cceee6SHan Pengfei extern int pthread_setname_np(pthread_t thread, const char* name);
3144cceee6SHan Pengfei 
329a4c5439SAugustin Cavalier extern int pthread_timedjoin_np(pthread_t thread, void** _value, const struct timespec* abstime);
339a4c5439SAugustin Cavalier 
34c5a740cdSJérôme Duval extern int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, const cpuset_t* mask);
35c5a740cdSJérôme Duval extern int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, cpuset_t* mask);
36c5a740cdSJérôme Duval 
37ba56d0a5SJérôme Duval 
38ba56d0a5SJérôme Duval #ifdef __cplusplus
39ba56d0a5SJérôme Duval }
40ba56d0a5SJérôme Duval #endif
41ba56d0a5SJérôme Duval 
42ba56d0a5SJérôme Duval 
43ba56d0a5SJérôme Duval #endif
44ba56d0a5SJérôme Duval 
45ba56d0a5SJérôme Duval 
46ba56d0a5SJérôme Duval #endif	/* _GNU_PTHREAD_H_ */
47ba56d0a5SJérôme Duval 
48