From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 23 21:50:22 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 463D216A540 for ; Tue, 23 Nov 2004 21:50:22 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26DC843D45 for ; Tue, 23 Nov 2004 21:50:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iANLoM41050280 for ; Tue, 23 Nov 2004 21:50:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iANLoLsw050279; Tue, 23 Nov 2004 21:50:21 GMT (envelope-from gnats) Resent-Date: Tue, 23 Nov 2004 21:50:21 GMT Resent-Message-Id: <200411232150.iANLoLsw050279@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Travis Poppe Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B67C016A4CF for ; Tue, 23 Nov 2004 21:40:29 +0000 (GMT) Received: from smtpauth.kewlio.net (smtpauth.kewlio.net [195.22.134.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id E480C43D4C for ; Tue, 23 Nov 2004 21:40:28 +0000 (GMT) (envelope-from tlp@LiquidX.org) Received: from maya.liquidx.org (70-56-157-27.bois.qwest.net [70.56.157.27]) (authenticated bits=0) by smtpauth.kewlio.net (8.12.10/8.12.10) with ESMTP id iANLeOdk003392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 23 Nov 2004 21:40:27 GMT Message-Id: <20041123144038.43d6f9c5@maya.liquidx.org> Date: Tue, 23 Nov 2004 14:40:38 -0700 From: Travis Poppe To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/74302: [PATCH] Our Linux binary support does not appear to behandling UNIMPL syscalls correctly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 21:50:22 -0000 >Number: 74302 >Category: kern >Synopsis: [PATCH] Our Linux binary support does not appear to be >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Nov 23 21:50:21 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Travis Poppe >Release: >Organization: >Environment: >Description: Our Linux compatibility module does not appear to be handling UNIMPL syscalls correctly, causing at least one application (Cedega, aka WineX) to crash on start. To the best of Peter Hunnisett's knowledge (peter@transgaming.com), the default behavior should be to return ENOSYS for an UNIMPL syscall. This is how Linux behaves. The following patch effectively does this and corrects Cedega from crashing at start. It is now possible to run a few Windows games using Cedega (Linux version) with this patch. Without this patch, FreeBSD sends a signal and _then_ returns ENOSYS. Coded by: Peter Hunnisett (peter@transgaming.com) Tested by: Travis Poppe (tlp@liquidx.org) >How-To-Repeat: >Fix: --- linux_sysproto.h.orig Tue Nov 23 13:13:33 2004 +++ linux_sysproto.h Tue Nov 23 13:13:33 2004 @@ -0,0 +1,7 @@ +#ifndef LINUX_EMUL_PROTO +#define LINUX_EMUL_PROTO + +int linux_nosys( struct thread* td, struct nosys_args* ignore ); +#define nosys linux_nosys + +#endif /* LINUX_EMUL_PROTO */ --- linux_sysvec.c.orig Thu Jul 15 01:26:05 2004 +++ linux_sysvec.c Tue Nov 23 13:13:33 2004 @@ -188,6 +188,13 @@ _bsd_to_linux_trapcode[(code)]: \ LINUX_T_UNKNOWN) +int linux_nosys( struct thread* td, struct nosys_args* ignore ) +{ + return (ENOSYS); +} + + + /* * If FreeBSD & Linux have a difference of opinion about what a trap * means, deal with it here. --- syscalls.master.orig Tue Nov 23 13:12:37 2004 +++ syscalls.master Tue Nov 23 13:12:57 2004 @@ -27,6 +27,7 @@ #include #include #include +#include ; #ifdef's, etc. may be included, and are copied to the output files. >Release-Note: >Audit-Trail: >Unformatted: handling UNIMPL syscalls correctly, causing at least one application to crash.