From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C6D0O-0000xi-5j for qemu-devel@nongnu.org; Sat, 11 Sep 2004 14:53:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C6D0M-0000xW-MA for qemu-devel@nongnu.org; Sat, 11 Sep 2004 14:53:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6D0M-0000xT-Jh for qemu-devel@nongnu.org; Sat, 11 Sep 2004 14:53:46 -0400 Received: from [62.241.160.9] (helo=shockwave.systems.pipex.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C6Cus-00015a-Nv for qemu-devel@nongnu.org; Sat, 11 Sep 2004 14:48:06 -0400 Received: from nowt.org (81-178-249-118.dsl.pipex.com [81.178.249.118]) by shockwave.systems.pipex.net (Postfix) with ESMTP id 4FD931C000BF for ; Sat, 11 Sep 2004 19:48:06 +0100 (BST) Received: from wren.home (wren.home [192.168.1.7]) by nowt.org (Postfix) with ESMTP id BA0FFAC92 for ; Sat, 11 Sep 2004 19:48:05 +0100 (BST) From: Paul Brook Date: Sat, 11 Sep 2004 19:48:05 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409111948.05182.paul@codesourcery.com> Subject: [Qemu-devel] [patch] Make _sysctl less broken Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Qemu doesn't currently implement the _sysctl linux syscall, and complains loudly when it is used. For some reason my Debian arm-linux chroot calls this syscall extensively, and the "Unsupported syscall" errors were causing problems. The patch below makes it always return ENOTDIR. The sysctl names vary between kernel versions, so user applications should already gracefully accept this. Paul Index: syscall.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/syscall.c,v retrieving revision 1.50 diff -u -p -r1.50 syscall.c --- syscall.c 19 Jun 2004 16:59:03 -0000 1.50 +++ syscall.c 11 Sep 2004 18:35:28 -0000 @@ -2600,7 +2624,9 @@ long do_syscall(void *cpu_env, int num, ret = get_errno(fdatasync(arg1)); break; case TARGET_NR__sysctl: - goto unimplemented; + /* We don't implement this, but ENODIR is always a safe + return value. */ + return -ENOTDIR; case TARGET_NR_sched_setparam: { struct sched_param *target_schp = (void *)arg2;