diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-05 09:46:47 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-05 09:46:47 +0000 |
commit | 4df76d127b9cf830a15244da75976efb43752c6b (patch) | |
tree | 79074341a3cd73003186d0290ecad71cb9bed623 /Process.c | |
parent | 5ed2b85c847995da3f4dc01c4d2790358adeb03d (diff) |
Embed PLPA (Portable Linux Processor Affinity) in order to support
conflicting affinity API of different Linux kernel versions.
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -27,6 +27,8 @@ in the source distribution for its full text. #include <pwd.h> #include <sched.h> +#include <plpa.h> + // This works only with glibc 2.1+. On earlier versions // the behavior is similar to have a hardcoded page size. #ifndef PAGE_SIZE @@ -198,12 +200,12 @@ bool Process_setPriority(Process* this, int priority) { unsigned long Process_getAffinity(Process* this) { unsigned long mask = 0; - sched_getaffinity(this->pid, sizeof(unsigned long), (cpu_set_t*) &mask); + plpa_sched_getaffinity(this->pid, sizeof(unsigned long), (plpa_cpu_set_t*) &mask); return mask; } bool Process_setAffinity(Process* this, unsigned long mask) { - return (sched_setaffinity(this->pid, sizeof(unsigned long), (cpu_set_t*) &mask) == 0); + return (plpa_sched_setaffinity(this->pid, sizeof(unsigned long), (plpa_cpu_set_t*) &mask) == 0); } void Process_sendSignal(Process* this, int signal) { |