[patch] Coping with setfs[gu]id16() stupidness...

Sean Chittenden sean at gigave.com
Fri Jun 3 12:06:58 PDT 2005


Is there any necessary symbol table magic that I need to work in order
to get the following patch to work?  It compiles, but link_elf()
returns an error with "symbol linux_syscall_warn_enable not found".
At which point kldload(1) returns ENOENT (but that's another bug/story
all together).

The intent of the patch is to quiet warnings when programs make use of
stupid linux syscalls (setfsuid16() and setfsgid16() come to mind).
In the patch, warnings are enabled with the patch they can be disabled
by setting compat.linux.syscall_warn_enable=0.

Thanks in advance.  -sc


http://people.FreeBSD.org/~seanc/patches/#compat_linux_syscall_warning

-- 
Sean Chittenden
Charter member of the "FilePro sucks" fan club
-------------- next part --------------
Index: sys/compat/linux/linux_mib.c
===================================================================
RCS file: /home/ncvs/src/sys/compat/linux/linux_mib.c,v
retrieving revision 1.23
diff -u -r1.23 linux_mib.c
--- sys/compat/linux/linux_mib.c	14 Jan 2005 04:44:56 -0000	1.23
+++ sys/compat/linux/linux_mib.c	3 Jun 2005 01:33:24 -0000
@@ -359,4 +359,9 @@
             0, 0, linux_sysctl_debug, "A",
             "Linux debugging control");
 
+int linux_syscall_warn_enable = 1;
+
+SYSCTL_INT(_compat_linux, OID_AUTO, syscall_warn_enable, CTLFLAG_RW,
+	   &linux_syscall_warn_enable, 0, "warn when executing an unimplimented syscall");
+
 #endif /* DEBUG */
Index: sys/compat/linux/linux_mib.h
===================================================================
RCS file: /home/ncvs/src/sys/compat/linux/linux_mib.h,v
retrieving revision 1.8
diff -u -r1.8 linux_mib.h
--- sys/compat/linux/linux_mib.h	26 Mar 2003 18:29:44 -0000	1.8
+++ sys/compat/linux/linux_mib.h	3 Jun 2005 01:58:28 -0000
@@ -31,6 +31,8 @@
 #ifndef _LINUX_MIB_H_
 #define _LINUX_MIB_H_
 
+extern int linux_syscall_warn_enable;
+
 void	linux_mib_destroy(void);
 
 void	linux_get_osname(struct thread *td, char *dst);
Index: sys/compat/linux/linux_util.h
===================================================================
RCS file: /home/ncvs/src/sys/compat/linux/linux_util.h,v
retrieving revision 1.25
diff -u -r1.25 linux_util.h
--- sys/compat/linux/linux_util.h	1 Mar 2005 17:57:45 -0000	1.25
+++ sys/compat/linux/linux_util.h	3 Jun 2005 01:59:38 -0000
@@ -49,6 +49,8 @@
 #include <sys/cdefs.h>
 #include <sys/uio.h>
 
+#include <compat/linux/linux_mib.h>
+
 static __inline caddr_t stackgap_init(void);
 static __inline void *stackgap_alloc(caddr_t *, size_t);
 
@@ -108,7 +110,8 @@
 unimplemented_syscall(struct thread *td, const char *syscallname)
 {
 
-	linux_msg(td, "syscall %s not implemented", syscallname);
+	if (linux_syscall_warn_enable)
+		linux_msg(td, "syscall %s not implemented", syscallname);
 	return (ENOSYS);
 }
 


More information about the freebsd-emulation mailing list