From owner-freebsd-emulation@FreeBSD.ORG Fri Jun 3 19:06:58 2005 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2D2A16A41C for ; Fri, 3 Jun 2005 19:06:58 +0000 (GMT) (envelope-from sean@noc-phone.gigave.com) Received: from mailhost.gigave.com (mailhost.gigave.com [38.113.228.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8117143D49 for ; Fri, 3 Jun 2005 19:06:58 +0000 (GMT) (envelope-from sean@noc-phone.gigave.com) Date: Fri, 3 Jun 2005 12:06:58 -0700 From: Sean Chittenden To: freebsd-emulation@freebsd.org Message-ID: <20050603190658.GR8248@sean.gigave.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HeFlAV5LIbMFYYuh" Content-Disposition: inline Subject: [patch] Coping with setfs[gu]id16() stupidness... X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2005 19:06:58 -0000 --HeFlAV5LIbMFYYuh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --HeFlAV5LIbMFYYuh Content-Type: text/plain; charset=us-ascii Content-Description: linux sysctl patch Content-Disposition: attachment; filename=patch 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 #include +#include + 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); } --HeFlAV5LIbMFYYuh--