summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-16 02:04:54 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:38 +0200
commit29ba11d6053fe1267d00190c278e717b7d0a2fad (patch)
treeb2487e8e0f914bd658e0eed589d052d10a78ccb5 /libc
parentaf58093c1417a523b35f652ca8df97df1dd70508 (diff)
sched_setaffinity.c: make use of the syscall
Fix arg type (const missing). Reorganize a bit. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/common/sched_setaffinity.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/libc/sysdeps/linux/common/sched_setaffinity.c b/libc/sysdeps/linux/common/sched_setaffinity.c
index 980c44199..e239cd794 100644
--- a/libc/sysdeps/linux/common/sched_setaffinity.c
+++ b/libc/sysdeps/linux/common/sched_setaffinity.c
@@ -16,22 +16,17 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <features.h>
-#ifdef __USE_GNU
-
-#include <sched.h>
-#include <sys/types.h>
#include <sys/syscall.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <alloca.h>
-
-#if defined __NR_sched_setaffinity
-#define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
-static __inline__ _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid,
- size_t, cpusetsize, cpu_set_t *, cpuset)
+#if defined __NR_sched_setaffinity && defined __USE_GNU
+# include <sched.h>
+# include <sys/types.h>
+# include <string.h>
+# include <unistd.h>
+# include <alloca.h>
+# define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
+static __always_inline _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid,
+ size_t, cpusetsize, const cpu_set_t *, cpuset)
static size_t __kernel_cpumask_size;
@@ -68,7 +63,6 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
return -1;
}
- return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+ return __syscall_sched_setaffinity(pid, cpusetsize, cpuset);
}
#endif
-#endif /* __USE_GNU */