[uClibc-cvs] uClibc/libc/sysdeps/linux/common create_module.c, 1.9, 1.10 delete_module.c, 1.1, 1.2 init_module.c, 1.1, 1.2 query_module.c, 1.1, 1.2

Erik Andersen andersen at uclibc.org
Fri Mar 12 00:21:23 UTC 2004


Update of /var/cvs/uClibc/libc/sysdeps/linux/common
In directory nail:/tmp/cvs-serv14168

Modified Files:
	create_module.c delete_module.c init_module.c query_module.c 
Log Message:
Cope gracefully with missing module syscalls


Index: query_module.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/query_module.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/query_module.c	21 Jan 2004 23:27:40 -0000	1.1
+++ b/query_module.c	12 Mar 2004 00:21:20 -0000	1.2
@@ -8,14 +8,14 @@
  */
 
 #include "syscalls.h"
-#	ifdef __NR_query_module
+#ifdef __NR_query_module
 _syscall5(int, query_module, const char *, name, int, which,
 		  void *, buf, size_t, bufsize, size_t *, ret);
-#	else
+#else
 int query_module(const char *name, int which,
 				 void *buf, size_t bufsize, size_t * ret)
 {
 	__set_errno(ENOSYS);
 	return -1;
 }
-#	endif
+#endif

Index: init_module.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/init_module.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/init_module.c	21 Jan 2004 23:27:40 -0000	1.1
+++ b/init_module.c	12 Mar 2004 00:21:20 -0000	1.2
@@ -8,8 +8,17 @@
  */
 
 #include "syscalls.h"
+#ifdef __NR_init_module
 /* This may have 5 arguments (for old 2.0 kernels) or 2 arguments
  * (for 2.2 and 2.4 kernels).  Use the greatest common denominator,
  * and let the kernel cope with whatever it gets.  It's good at that. */
 _syscall5(int, init_module, void *, first, void *, second, void *, third,
 		  void *, fourth, void *, fifth);
+#else
+int init_module(void *first, void *second, void *third, void *fourth, void *fifth)
+{
+	__set_errno(ENOSYS);
+	return -1;
+}
+#endif
+

Index: delete_module.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/delete_module.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/delete_module.c	21 Jan 2004 23:27:39 -0000	1.1
+++ b/delete_module.c	12 Mar 2004 00:21:20 -0000	1.2
@@ -8,12 +8,12 @@
  */
 
 #include "syscalls.h"
-#	ifdef __NR_delete_module
+#ifdef __NR_delete_module
 _syscall1(int, delete_module, const char *, name);
-#	else
+#else
 int delete_module(const char *name)
 {
 	__set_errno(ENOSYS);
 	return -1;
 }
-#	endif
+#endif

Index: create_module.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/create_module.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- a/create_module.c	10 Feb 2004 20:52:00 -0000	1.9
+++ b/create_module.c	12 Mar 2004 00:21:20 -0000	1.10
@@ -66,5 +66,11 @@
 _syscall2(unsigned long, create_module, const char *, name, size_t, size);
 #endif
 
+#else
+unsigned long create_module(const char *name, size_t size)
+{
+	__set_errno(ENOSYS);
+	return (unsigned long)-1;
+}
 #endif
 




More information about the uClibc-cvs mailing list