[klibc] [PATCH] syscalls: Add sched_setaffinity, sched_getaffinity syscalls

Mike Waychison mikew at google.com
Sat Jun 18 23:30:32 PDT 2011


Add the sched_getaffinity and sched_setaffinity system calls.

Google-Bug-Id: 4725830
Signed-off-by: Mike Waychison <mikew at google.com>
---
 usr/include/sched.h    |    2 ++
 usr/klibc/SYSCALLS.def |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/usr/include/sched.h b/usr/include/sched.h
index fb4da8d..713cc7a 100644
--- a/usr/include/sched.h
+++ b/usr/include/sched.h
@@ -18,6 +18,8 @@ struct sched_param {
 };
 
 __extern int sched_setscheduler(pid_t, int, const struct sched_param *);
+__extern int sched_setaffinity(pid_t, unsigned int, unsigned long *);
+__extern int sched_getaffinity(pid_t, unsigned int, unsigned long *);
 __extern int sched_yield(void);
 
 /* Raw interfaces to clone(2); only actually usable for non-VM-cloning */
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index 437dfa7..9e1d349 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -49,6 +49,8 @@ int execve(const char *, char * const *, char * const *);
 int setpriority(int, int, int);
 int getrusage(int, struct rusage *);
 int sched_setscheduler(pid_t, int, const struct sched_param *);
+<?> int sched_setaffinity(pid_t, unsigned int, unsigned long *);
+<?> int sched_getaffinity(pid_t, unsigned int, unsigned long *);
 int sched_yield();
 <i386> int prctl at varadic(int, unsigned long, unsigned long, unsigned long, unsigned long);
 <!i386> int prctl(int, unsigned long, unsigned long, unsigned long, unsigned long);
-- 
1.7.3.1



More information about the klibc mailing list