From 4df76d127b9cf830a15244da75976efb43752c6b Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 5 Mar 2008 09:46:47 +0000 Subject: Embed PLPA (Portable Linux Processor Affinity) in order to support conflicting affinity API of different Linux kernel versions. --- Process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Process.c') diff --git a/Process.c b/Process.c index ef97451a..8721b73d 100644 --- a/Process.c +++ b/Process.c @@ -27,6 +27,8 @@ in the source distribution for its full text. #include #include +#include + // 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) { -- cgit v1.2.3