patch-1.3.52 linux/kernel/module.c

Next file: linux/mm/swap.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.51/linux/kernel/module.c linux/kernel/module.c
@@ -6,6 +6,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/malloc.h>
+#include <linux/config.h>
 /*
  * Originally by Anonymous (as far as I know...)
  * Linux version by Bas Laarhoven <bas@vimec.nl>
@@ -38,8 +39,13 @@
  * On 1-Aug-95:  <Matti.Aarnio@utu.fi>  altered code to use same style as
  *		 do  /proc/net/XXX  "files".  Namely allow more than 4kB
  *		 (or what the block size if) output.
+ *
+ *	- Use dummy syscall functions for users who disable all
+ *	  module support. Similar to kernel/sys.c (Paul Gortmaker)
  */
 
+#ifdef CONFIG_MODULES		/* a *big* #ifdef block... */
+
 #ifdef DEBUG_MODULE
 #define PRINTK(a) printk a
 #else
@@ -781,3 +787,30 @@
 
 	return 0;
 }
+
+#else		/* CONFIG_MODULES */
+
+/* Dummy syscalls for people who don't want modules */
+
+asmlinkage unsigned long sys_create_module(void)
+{
+	return -ENOSYS;
+}
+
+asmlinkage int sys_init_module(void)
+{
+	return -ENOSYS;
+}
+
+asmlinkage int sys_delete_module(void)
+{
+	return -ENOSYS;
+}
+
+asmlinkage int sys_get_kernel_syms(void)
+{
+	return -ENOSYS;
+}
+
+#endif	/* CONFIG_MODULES */
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this