diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2005-01-04 05:31:25 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:31:25 -0800 |
| commit | 074927924e7135a5b2ec3b05d0f23f9d3bdcd11f (patch) | |
| tree | d34349846c01f633b9b4af41dcac9b3e7e7854ec /include/linux | |
| parent | c805134eaf79ca89f18c756c0719cef10fb7ea3e (diff) | |
[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: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index dfcb9bb20413..574f879c9bf4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -13,6 +13,7 @@ #include <linux/rbtree.h> #include <linux/thread_info.h> #include <linux/cpumask.h> +#include <linux/errno.h> #include <asm/system.h> #include <asm/semaphore.h> @@ -732,6 +733,8 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask); #else 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; } #endif |
