about summary refs log tree commit diff
path: root/src/sched/sched_getaffinity.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sched/sched_getaffinity.c')
-rw-r--r--src/sched/sched_getaffinity.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sched/sched_getaffinity.c b/src/sched/sched_getaffinity.c
new file mode 100644
index 00000000..0aa4c65a
--- /dev/null
+++ b/src/sched/sched_getaffinity.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include <sched.h>
+#include "syscall.h"
+
+int sched_getaffinity(pid_t tid, size_t size, cpu_set_t *set)
+{
+	long ret = __syscall(SYS_sched_getaffinity, tid, size, set);
+	if (ret > 0) ret = 0;
+	return __syscall_ret(ret);
+}