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 #ifdef _GNU_SOURCE 13 14 15 #include <sched.h> 16 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 23 #define PTHREAD_MAX_NAMELEN_NP 32 // B_OS_NAME_LENGTH 24 25 26 extern int pthread_getattr_np(pthread_t thread, pthread_attr_t* attr); 27 28 extern int pthread_getname_np(pthread_t thread, char* buffer, size_t length); 29 extern int pthread_setname_np(pthread_t thread, const char* name); 30 31 extern int pthread_timedjoin_np(pthread_t thread, void** _value, const struct timespec* abstime); 32 33 extern int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, const cpuset_t* mask); 34 extern int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, cpuset_t* mask); 35 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 42 #endif 43 44 45 #endif /* _GNU_PTHREAD_H_ */ 46 47