LWN.net Logo

(3/4) [PATCH] cpuset - build without CPUSET configured

From:  Stephen Hemminger <shemminger@osdl.org>
To:  Simon Derr <Simon.Derr@bull.net>
Subject:  (3/4) [PATCH] cpuset - build without CPUSET configured
Date:  Tue, 21 Oct 2003 16:20:32 -0700
Cc:  linux-kernel@vger.kernel.org

The existing patch would not build a kernel unless CPUSET was enabled.
The following is a simple way to make those system calls conditional.

diff -Nru a/include/linux/cpuset.h b/include/linux/cpuset.h
--- a/include/linux/cpuset.h	Tue Oct 21 16:09:32 2003
+++ b/include/linux/cpuset.h	Tue Oct 21 16:09:32 2003
@@ -24,6 +24,13 @@
 
 int cpuset_realtologic_cpuid(struct cpuset * cs, int cpuid);
 
+extern asmlinkage long sys_cpuset_create(cpuset_t *cpusetp, int flags);
+extern asmlinkage long sys_cpuset_destroy(cpuset_t cpuset);
+extern asmlinkage long sys_cpuset_attach(cpuset_t cpuset, pid_t pid);
+extern asmlinkage long sys_cpuset_alloc(cpuset_t cpuset, int len, 
+					unsigned long *user_mask_ptr);
+extern asmlinkage long sys_cpuset_getfreecpus(int flags, int len, 
+					      unsigned long *user_mask_ptr);
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_CPUSET_H */
diff -Nru a/kernel/sys.c b/kernel/sys.c
--- a/kernel/sys.c	Tue Oct 21 16:09:32 2003
+++ b/kernel/sys.c	Tue Oct 21 16:09:32 2003
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/highuid.h>
 #include <linux/fs.h>
+#include <linux/cpuset.h>
 #include <linux/workqueue.h>
 #include <linux/device.h>
 #include <linux/times.h>
@@ -253,6 +254,12 @@
 cond_syscall(sys_epoll_wait)
 cond_syscall(sys_pciconfig_read)
 cond_syscall(sys_pciconfig_write)
+cond_syscall(sys_cpuset_create);
+cond_syscall(sys_cpuset_destroy);
+cond_syscall(sys_cpuset_alloc);
+cond_syscall(sys_cpuset_attach);
+cond_syscall(sys_cpuset_getfreecpus);
+
 
 static int set_one_prio(struct task_struct *p, int niceval, int error)
 {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Copyright © 2003, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds