Commit 07492792 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] sys_sched_setaffinity() on UP should fail for non-zero CPUs.

Return EINVAL for invalid sched_setaffinity on UP.  I was a little
surprised that sys_sched_setaffinity for CPU 1 didn't fail on my UP box.
With CONFIG_SMP it would have.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c805134e
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/thread_info.h> #include <linux/thread_info.h>
#include <linux/cpumask.h> #include <linux/cpumask.h>
#include <linux/errno.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
...@@ -732,6 +733,8 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask); ...@@ -732,6 +733,8 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask);
#else #else
static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
{ {
if (!cpus_intersects(new_mask, cpu_online_map))
return -EINVAL;
return 0; return 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment