Handle unimplemented syscall by instantly returning ENOSYS instead of sending
signal first and only then returning ENOSYS to match what real linux does. PR: kern/74302 Submitted by: Travis Poppe <tlp@LiquidX.org>
This commit is contained in:
parent
5c16270365
commit
e3478fe000
@ -31,9 +31,13 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <compat/linux/linux_sysproto.h>
|
||||
#include <alpha/linux/linux.h>
|
||||
#include <alpha/linux/linux_proto.h>
|
||||
|
||||
; Isn't pretty, but there seems to be no other way to trap nosys
|
||||
#define nosys linux_nosys
|
||||
|
||||
; #ifdef's, etc. may be included, and are copied to the output files.
|
||||
|
||||
0 UNIMPL
|
||||
|
@ -25,9 +25,13 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <compat/linux/linux_sysproto.h>
|
||||
#include <amd64/linux32/linux.h>
|
||||
#include <amd64/linux32/linux32_proto.h>
|
||||
|
||||
; Isn't pretty, but there seems to be no other way to trap nosys
|
||||
#define nosys linux_nosys
|
||||
|
||||
; #ifdef's, etc. may be included, and are copied to the output files.
|
||||
|
||||
0 UNIMPL setup
|
||||
|
@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_compat.h"
|
||||
|
||||
#include <compat/linux/linux_sysproto.h>
|
||||
|
||||
#ifdef COMPAT_LINUX32
|
||||
#include <machine/../linux32/linux.h>
|
||||
#include <machine/../linux32/linux32_proto.h>
|
||||
@ -1392,3 +1394,10 @@ linux_getsid(struct thread *td, struct linux_getsid_args *args)
|
||||
bsd.pid = args->pid;
|
||||
return getsid(td, &bsd);
|
||||
}
|
||||
|
||||
int
|
||||
linux_nosys(struct thread *td, struct nosys_args *ignore)
|
||||
{
|
||||
|
||||
return (ENOSYS);
|
||||
}
|
||||
|
36
sys/compat/linux/linux_sysproto.h
Normal file
36
sys/compat/linux/linux_sysproto.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*-
|
||||
* Copyright (c) 2005 Travis Poppe
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef LINUX_SYSPROTO
|
||||
#define LINUX_SYSPROTO
|
||||
|
||||
int linux_nosys(struct thread *, struct nosys_args *);
|
||||
|
||||
#endif
|
@ -25,9 +25,13 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <compat/linux/linux_sysproto.h>
|
||||
#include <i386/linux/linux.h>
|
||||
#include <i386/linux/linux_proto.h>
|
||||
|
||||
; Isn't pretty, but there seems to be no other way to trap nosys
|
||||
#define nosys linux_nosys
|
||||
|
||||
; #ifdef's, etc. may be included, and are copied to the output files.
|
||||
|
||||
0 UNIMPL setup
|
||||
|
Loading…
Reference in New Issue
Block a user