kern/74302: [PATCH] Our Linux binary support does not appear to behandling UNIMPL syscalls correctly

Travis Poppe tlp at LiquidX.org
Tue Nov 23 21:50:22 GMT 2004


>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 <tlp at LiquidX.org>
>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 at 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 at transgaming.com)
Tested by: Travis Poppe (tlp at 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 <sys/sysproto.h>
 #include <i386/linux/linux.h>
 #include <i386/linux/linux_proto.h>
+#include <i386/linux/linux_sysproto.h>
 
 ; #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.


More information about the freebsd-bugs mailing list