aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2008-03-03 08:28:13 +0000
committerDavid Xu <davidxu@FreeBSD.org>2008-03-03 08:28:13 +0000
commitc3f43618db385febd5b7ca91558e524f7bb36bc7 (patch)
treee8edffe264c733fc4b09aa96c7151550451cf909 /include
parent223a605ac5186dbd99288fb62d7531d09bdf7191 (diff)
downloadsrc-c3f43618db385febd5b7ca91558e524f7bb36bc7.tar.gz
src-c3f43618db385febd5b7ca91558e524f7bb36bc7.zip
Add cpu affinity APIs to get and set thread's cpu affinity mask, the
functions are intented to be are compatible with glibc.
Notes
Notes: svn path=/head/; revision=176760
Diffstat (limited to 'include')
-rw-r--r--include/pthread_np.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/pthread_np.h b/include/pthread_np.h
index 504c83bd0f21..b969988c350d 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);