diff options
author | davidxu <davidxu@FreeBSD.org> | 2008-03-03 08:28:13 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2008-03-03 08:28:13 +0000 |
commit | 195c58423a7d7ac50d2f089c8a0dab227052420c (patch) | |
tree | e8edffe264c733fc4b09aa96c7151550451cf909 /include/pthread_np.h | |
parent | 673fb1f907346041c0e75ead71537aacabb8bfe0 (diff) | |
download | FreeBSD-src-195c58423a7d7ac50d2f089c8a0dab227052420c.zip FreeBSD-src-195c58423a7d7ac50d2f089c8a0dab227052420c.tar.gz |
Add cpu affinity APIs to get and set thread's cpu affinity mask, the
functions are intented to be are compatible with glibc.
Diffstat (limited to 'include/pthread_np.h')
-rw-r--r-- | include/pthread_np.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/pthread_np.h b/include/pthread_np.h index 504c83b..b969988 100644 --- a/include/pthread_np.h +++ b/include/pthread_np.h @@ -31,6 +31,9 @@ #ifndef _PTHREAD_NP_H_ #define _PTHREAD_NP_H_ +#include <sys/param.h> +#include <sys/cpuset.h> + /* * Non-POSIX type definitions: */ @@ -42,6 +45,9 @@ typedef void (*pthread_switch_routine_t)(pthread_t, pthread_t); __BEGIN_DECLS int pthread_attr_setcreatesuspend_np(pthread_attr_t *); int pthread_attr_get_np(pthread_t, pthread_attr_t *); +int pthread_attr_getaffinity_np(const pthread_attr_t *, size_t, cpuset_t *); +int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const cpuset_t *); +int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *); int pthread_main_np(void); int pthread_multi_np(void); int pthread_mutexattr_getkind_np(pthread_mutexattr_t); @@ -54,6 +60,7 @@ int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count); int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count); int pthread_mutex_isowned_np(pthread_mutex_t *mutex); +int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *); int pthread_single_np(void); void pthread_suspend_all_np(void); int pthread_suspend_np(pthread_t); |