Remove SVR4 (System V Release 4) binary compatibility support.

UNIX System V Release 4 is operating system released in 1988. It ceased
to exist in early 2000-s.
This commit is contained in:
Gleb Smirnoff 2017-02-28 05:14:42 +00:00
parent d61db6be37
commit efe3b0de14
83 changed files with 12 additions and 14975 deletions

View File

@ -38,6 +38,11 @@
# xargs -n1 | sort | uniq -d;
# done
# 20170226: SVR4 compatibility removed
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
OLD_FILES+=usr/share/man/man4/streams.4
OLD_FILES+=usr/share/man/man4/svr4.4
.endif
# 20170219: OpenPAM RADULA upgrade removed the libpam tests
OLD_FILES+=usr/tests/lib/libpam/Kyuafile
OLD_FILES+=usr/tests/lib/libpam/t_openpam_ctype

View File

@ -630,7 +630,6 @@ firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if
# Emulation/compatibility services provided by /etc/rc.d/abi
sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO).
linux_enable="NO" # Linux binary compatibility loaded at startup (or NO).
svr4_enable="NO" # SysVR4 emulation loaded at startup (or NO).
clear_tmp_enable="NO" # Clear /tmp at startup.
clear_tmp_X="YES" # Clear and recreate X11-related directories in /tmp
ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks

View File

@ -43,25 +43,18 @@ linux_start()
fi
}
svr4_start()
{
echo -n ' svr4'
load_kld -m svr4elf svr4
}
abi_start()
{
local _echostop
_echostop=
if checkyesno sysvipc_enable || checkyesno linux_enable || checkyesno svr4_enable; then
if checkyesno sysvipc_enable || checkyesno linux_enable; then
echo -n 'Additional ABI support:'
_echostop=yes
fi
checkyesno sysvipc_enable && sysv_start
checkyesno linux_enable && linux_start
checkyesno svr4_enable && svr4_start
[ -n "${_echostop}" ] && echo '.'
}

View File

@ -319,7 +319,7 @@ The additional word delimiters
and
.Ql \e>
are provided to ease compatibility with traditional
.Xr svr4 4
SVR4
systems but are not portable and should be avoided.
.Pp
In the event that an RE could match more than one substring of a given

View File

@ -25,8 +25,6 @@ MAN= aic.4 \
pnpbios.4 \
sbni.4 \
smapi.4 \
streams.4 \
svr4.4 \
vpd.4 \
vx.4

View File

@ -1,85 +0,0 @@
.\" Copyright (c) 2000 Mark Newton
.\" 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.
.\" 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.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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$
.\"
.Dd March 17, 2008
.Dt STREAMS 4 i386
.Os
.Sh NAME
.Nm streams
.Nd System V STREAMS networking ABI support
.Sh SYNOPSIS
To compile support for this ABI into the kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device streams"
.Ed
.Pp
Alternatively, to load the ABI as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
streams_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
module provides limited
System V Release 4 STREAMS interprocess communication ABI
(application binary interface) compatibility
for userland applications.
.Pp
Internally,
.Nm
provides STREAMS handles by using socket creation kernel routines, and
adding state-tracking information to the socket to permit manipulation
by STREAMS emulation code in
.Xr svr4 4 .
Hence, opening a stream device produces a result similar to what would be
obtained by calling
.Xr socket 2 .
.Pp
Applications should never use this interface directly: STREAMS
emulation is only provided as a service to support ABI requirements in
the SVR4 environment which
.Xr svr4 4
needs to present to client binaries.
.Sh SEE ALSO
.Xr svr4 4
.Sh HISTORY
System V Release 4 ABI support first appeared in
.Fx 4.0 .
The ABI was ported from an equivalent facility present in
.Nx 1.3
written by Christos Zoulas.
.Sh BUGS
This whole interface is a crude hack to produce STREAMS semantics
through emulation over sockets.
.Pp
Programmers who hope to be able to use this interface to provide
SVR4 STREAMS services to
.Bx
applications will be sorely disappointed.

View File

@ -1,225 +0,0 @@
.\" Copyright (c) 2000 Mark Newton
.\" 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.
.\" 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.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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$
.\"
.Dd March 17, 2008
.Dt SVR4 4 i386
.Os
.Sh NAME
.Nm svr4
.Nd System V Release 4 ABI support
.Sh SYNOPSIS
To compile support for this ABI into the kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "options COMPAT_SVR4"
.Ed
.Pp
Alternatively, to load the ABI as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
svr4_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
module provides limited
System V Release 4 ABI (application binary interface) compatibility
for userland applications.
The module provides the following significant facilities:
.Bl -bullet
.It
An image activator
for correctly branded
.Xr elf 5
executable images
.It
Special signal handling for activated images
.It
SVR4 to native system call translation
.It
STREAMS network API emulation (via the
.Xr streams 4
loadable module, or by means of
.Dl device streams
in a kernel configuration file)
.It
Mappings between
.Fx
and SVR4
.Xr ioctl 2
calls, or, where no such mappings exist, reverse-engineered implementations
of the SVR4 calls.
.El
.Pp
It is important to note that the SVR4 ABI support
it not provided through an emulator.
Rather, a true (albeit limited) "clean room" reverse-engineered ABI
implementation is provided.
.Sh LIMITATIONS
Because the provided ABI has been developed in ignorance of actual SVR4
source code, there are bound to be unforeseen interactions between SVR4
client applications and the emulated ABI which cause applications to
malfunction.
.Pp
Additionally, some SVR4 operating systems do not adhere to the SVR4
ELF standard.
In particular, Solaris does not set the ELF interpreter field in the
ELF header to a value which would allow the kernel to correctly
identify a client executable as an SVR4 application.
Thus, in certain instances it is necessary to use the
.Xr brandelf 1
utility to explicitly brand the executable, or to set the
kern.fallback_elf_brand
.Xr sysctl 8
variable to define a "default" ABI for unbranded executables.
Value ELFOSABI_SOLARIS represents Solaris; ELFOSABI_SYSV represents other
SysVR4 operating systems.
See
.In sys/elf_common.h
for ELFOSABI branding definitions, and
.Xr brandelf 1
for information on branding executables.
.Pp
The
.Nm
module can be linked into the kernel statically with the
.Dv COMPAT_SVR4
kernel configuration option
or loaded as required.
The following command will load the module
if it is neither linked into the kernel
nor already loaded as a module:
.Bd -literal -offset indent
if ! kldstat -v | grep -E 'svr4elf' > /dev/null; then
kldload svr4 > /dev/null 2>&1
fi
.Ed
.Pp
The kernel
will check for the presence of the
.Xr streams 4
module, and load it if necessary.
.Pp
Note that dynamically linked SVR4 executables
will require a suitable environment in
.Pa /compat/svr4 .
.Pp
For information on loading the
.Nm
kernel loadable module automatically on system startup,
see
.Xr rc.conf 5 .
This information applies
regardless of whether the
.Nm
module is statically linked into the kernel
or loaded as a module.
.Pp
STREAMS emulation is limited but (largely) functional.
Assuming the
.Xr streams 4
module is loaded, a STREAMS handle can be obtained by opening one of the
relevant files in
.Pa /dev
or
.Pa /compat/svr4/dev .
Internally, the
.Xr streams 4
driver produces a socket descriptor and
.Dq tags
it with additional STREAMS
state information before returning it to the client application.
The
.Nm
environment uses the additional state information to recognize and
manipulate emulated STREAMS handles when STREAMS-specific
.Xr ioctl 2
calls are executed.
.Pp
The subset of STREAMS functionality which is provided is small, probably
little more than what is required to enable programs on the Solaris CD
sets to run.
.Sh FILES
.Bl -tag -width /sys/compat/svr4/syscalls.master -compact
.It Pa /compat/svr4
minimal SVR4 run-time environment
.It Pa /sys/compat/svr4/syscalls.master
mappings between SVR4 syscalls and
.Nm
module entrypoints.
.El
.Sh SEE ALSO
.Xr brandelf 1 ,
.Xr streams 4 ,
.Xr elf 5
.Sh HISTORY
System V Release 4 ABI support first appeared in
.Fx 4.0 .
The ABI was ported from an equivalent facility present in
.Nx 1.3
written by Christos Zoulas.
.Sh BUGS
Emulation of signal handlers is buggy.
.Pp
Emulated connectionless STREAMS fail to receive data from the network in
some circumstances (but succeed in others -- probably due to particular
ways of initializing them which the
.Xr streams 4
module is mishandling, and interaction between STREAMS and
.Xr poll 2 ) .
Connection-oriented STREAMS appear to be functional.
.Pp
Ironically, this SVR4 emulator does not (yet) support SVR4 semaphores or
shared memory.
.Pp
.Xr ports 7
to automatically create the
.Pa /compat/svr4
environment do not exist.
.Xr tar 1
archives containing pre-populated trees can be obtained from
.Pa http://people.FreeBSD.org/~newton/freebsd-svr4/ .
.Pp
Extensive testing has only really been carried out with Solaris 2.x binaries,
with anecdotal reports of limited success coming from testers with
early-revision SCO media.
In theory, the basic SVR4 ABI should be constant
across the set of vendors who produce SVR4 operating systems, but in
practice that is probably not the case.
If necessary, future work can
either implement additional
.Xr kld 4
modules which produce functionality which contains OS-dependent
departures from the behaviour which has been implemented in this
ABI implementation.
Alternatively,
.Xr sysctl 8
variables could set the
.Dq personality
the environment should present to
client applications.

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 10, 2016
.Dd February 26, 2017
.Dt RC.CONF 5
.Os
.Sh NAME
@ -3631,11 +3631,6 @@ Set to
.Dq Li YES
to enable Linux/ELF binary emulation at system initial
boot time.
.It Va svr4_enable
.Pq Vt bool
If set to
.Dq Li YES ,
enable SysVR4 emulation at boot time.
.It Va sysvipc_enable
.Pq Vt bool
If set to

View File

@ -633,27 +633,6 @@ options LINPROCFS
# and PSEUDOFS)
options LINSYSFS
#
# SysVR4 ABI emulation
#
# The svr4 ABI emulator can be statically compiled into the kernel or loaded as
# a KLD module.
# The STREAMS network emulation code can also be compiled statically or as a
# module. If loaded as a module, it must be loaded before the svr4 module
# (the /usr/sbin/svr4 script does this for you). If compiling statically,
# the `streams' device must be configured into any kernel which also
# specifies COMPAT_SVR4. It is possible to have a statically-configured
# STREAMS device and a dynamically loadable svr4 emulator; the /usr/sbin/svr4
# script understands that it doesn't need to load the `streams' module under
# those circumstances.
# Caveat: At this time, `options KTRACE' is required for the svr4 emulator
# (whether static or dynamic).
#
#XXX#options COMPAT_SVR4 # build emulator statically
#XXX#options DEBUG_SVR4 # enable verbose debugging
#XXX#device streams # STREAMS network driver (required for svr4).
#####################################################################
# VM OPTIONS

View File

@ -273,8 +273,6 @@ cloudabi64_load="NO" # 64-bit CloudABI executables support
ibcs2_load="NO" # IBCS2 (SCO) emulation
ibcs2_coff_load="NO"
linux_load="NO" # Linux emulation
svr4_load="NO" # SystemV R4 emulation
streams_load="NO" # System V streams module
##############################################################

View File

@ -1,13 +0,0 @@
# Makefile for syscall tables
#
# $FreeBSD$
all:
@echo "make sysent only"
sysent: svr4_sysent.c svr4_syscall.h svr4_proto.h
svr4_syscallnames.c svr4_sysent.c svr4_syscall.h svr4_proto.h: \
../../kern/makesyscalls.sh syscalls.master syscalls.conf
sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf

View File

@ -1,38 +0,0 @@
This is a SysVR4 emulator derived from work done as part of the NetBSD
Project by Christos Zoulas. It has been ported to FreeBSD by Mark Newton.
To use it:
1. Choose one of:
a. Add "device streams" to your kernel config file and rebuild,
reboot; or
b. Build and install the streams module in /sys/modules/streams
2. Build and install the svr4 module in /sys/modules/svr4
3. Type "kldload svr4" to start it up.
4. Grab compat_sol26.tar.gz or compat_svr4.tar.gz from
http://www.freebsd.org/~newton/freebsd-svr4 and install them in
/compat/svr4
5. Run "sh SVR4_MAKEDEV all" in /compat/svr4/dev
6. Mount a Solaris/x86 v2.6 or v7 CD-ROM on /cdrom (also works with
v2.4 and v2.5.1, but you need different symlinks in /compat/svr4)
7. Brand any executables you want to run, and/or set the
kern.fallback_elf_brand sysctl to 'SVR4' to establish this as the
default emulator for unbranded executables.
8. See if your SysVR4 programs work.
It's early days yet, folks -- You'll probably have trouble getting 100%
functionality out of most things (specifically, poll() on a socket doesn't
look like it works at the moment, so Netscape doesn't work (among other
things)). Patches will be appreciated.
- Mark Newton
newton@atdot.dotat.org
$FreeBSD$

View File

@ -1,15 +0,0 @@
TO-DO list
----------
* svr4_getdents64() doesn't work properly in 'large' directories.
* signals are still suspect
* networking is notworking
* VM86 and USER_LDT are currently disabled (low-priority)
* Make SysV emulator use SysV shared memory support (duh)
$FreeBSD$

View File

@ -1,238 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994-1996 Søren Schmidt
* All rights reserved.
*
* Based heavily on /sys/kern/imgact_aout.c which is:
* Copyright (c) 1993, David Greenman
*
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/exec.h>
#include <sys/imgact.h>
#include <sys/imgact_aout.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mman.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/vnode.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
#include <compat/svr4/svr4.h>
static int exec_svr4_imgact(struct image_params *iparams);
static int
exec_svr4_imgact(imgp)
struct image_params *imgp;
{
const struct exec *a_out = (const struct exec *) imgp->image_header;
struct vmspace *vmspace;
vm_offset_t vmaddr;
unsigned long virtual_offset, file_offset;
unsigned long bss_size;
ssize_t aresid;
int error;
if (((a_out->a_magic >> 16) & 0xff) != 0x64)
return -1;
/*
* Set file/virtual offset based on a.out variant.
*/
switch ((int)(a_out->a_magic & 0xffff)) {
case 0413:
virtual_offset = 0;
file_offset = 1024;
break;
case 0314:
virtual_offset = 4096;
file_offset = 0;
break;
default:
return (-1);
}
bss_size = round_page(a_out->a_bss);
#ifdef DEBUG
printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", (u_long)a_out->a_text, (u_long)a_out->a_data, bss_size);
#endif
/*
* Check various fields in header for validity/bounds.
*/
if (a_out->a_entry < virtual_offset ||
a_out->a_entry >= virtual_offset + a_out->a_text ||
a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK)
return (-1);
/* text + data can't exceed file size */
if (a_out->a_data + a_out->a_text > imgp->attr->va_size)
return (EFAULT);
/*
* text/data/bss must not exceed limits
*/
PROC_LOCK(imgp->proc);
if (a_out->a_text > maxtsiz ||
a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) ||
racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) {
PROC_UNLOCK(imgp->proc);
return (ENOMEM);
}
PROC_UNLOCK(imgp->proc);
VOP_UNLOCK(imgp->vp, 0);
/*
* Destroy old process VM and create a new one (with a new stack)
*/
error = exec_new_vmspace(imgp, &svr4_sysvec);
if (error)
goto fail;
vmspace = imgp->proc->p_vmspace;
/*
* Check if file_offset page aligned,.
* Currently we cannot handle misalinged file offsets,
* and so we read in the entire image (what a waste).
*/
if (file_offset & PAGE_MASK) {
#ifdef DEBUG
printf("imgact: Non page aligned binary %lu\n", file_offset);
#endif
/*
* Map text+data+bss read/write/execute
*/
vmaddr = virtual_offset;
error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE,
VM_PROT_ALL, VM_PROT_ALL, 0);
if (error)
goto fail;
error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset,
a_out->a_text + a_out->a_data, UIO_USERSPACE, 0,
curthread->td_ucred, NOCRED, &aresid, curthread);
if (error != 0)
goto fail;
if (aresid != 0) {
error = ENOEXEC;
goto fail;
}
/*
* remove write enable on the 'text' part
*/
error = vm_map_protect(&vmspace->vm_map,
vmaddr,
vmaddr + a_out->a_text,
VM_PROT_EXECUTE|VM_PROT_READ,
TRUE);
if (error)
goto fail;
}
else {
#ifdef DEBUG
printf("imgact: Page aligned binary %lu\n", file_offset);
#endif
/*
* Map text+data read/execute
*/
vmaddr = virtual_offset;
error = vm_mmap(&vmspace->vm_map, &vmaddr,
a_out->a_text + a_out->a_data,
VM_PROT_READ | VM_PROT_EXECUTE,
VM_PROT_ALL,
MAP_PRIVATE | MAP_FIXED,
OBJT_VNODE, imgp->vp, file_offset);
if (error)
goto fail;
#ifdef DEBUG
printf("imgact: startaddr=%08lx, length=%08lx\n", (u_long)vmaddr,
(u_long)a_out->a_text + a_out->a_data);
#endif
/*
* allow read/write of data
*/
error = vm_map_protect(&vmspace->vm_map,
vmaddr + a_out->a_text,
vmaddr + a_out->a_text + a_out->a_data,
VM_PROT_ALL,
FALSE);
if (error)
goto fail;
/*
* Allocate anon demand-zeroed area for uninitialized data
*/
if (bss_size != 0) {
vmaddr = virtual_offset + a_out->a_text + a_out->a_data;
error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr,
bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
if (error)
goto fail;
#ifdef DEBUG
printf("imgact: bssaddr=%08lx, length=%08lx\n",
(u_long)vmaddr, bss_size);
#endif
}
}
/* Fill in process VM information */
vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT;
vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT;
vmspace->vm_taddr = (caddr_t)virtual_offset;
vmspace->vm_daddr = (caddr_t)virtual_offset + a_out->a_text;
/* Fill in image_params */
imgp->interpreted = 0;
imgp->entry_addr = a_out->a_entry;
imgp->proc->p_sysent = &svr4_sysvec;
fail:
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
return (error);
}
/*
* Tell kern_execve.c about it, with a little help from the linker.
*/
struct execsw svr4_execsw = { exec_svr4_imgact, "svr4 ELF" };
EXEC_SET(execsw_set, svr4_execsw);

View File

@ -1,39 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* 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.
* 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$
*/
#include "opt_svr4.h"
#if !defined(_SVR4_H)
#define _SVR4_H
extern struct sysentvec svr4_sysvec;
#define COMPAT_SVR4_SOLARIS2
#endif

View File

@ -1,46 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1996 Christos Zoulas.
* 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.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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 _SVR4_ACL_H_
#define _SVR4_ACL_H_
typedef struct svr4_aclent {
int a_type;
svr4_uid_t a_id;
svr4_o_mode_t a_perm;
} svr4_aclent_t;
#define SVR4_SYS_GETACL 1
#define SVR4_SYS_SETACL 2
#define SVR4_SYS_GETACLCNT 3
#endif /* !_SVR4_ACL_H_ */

View File

@ -1,53 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_DIRENT_H_
#define _SVR4_DIRENT_H_
#define SVR4_MAXNAMLEN 512
struct svr4_dirent {
svr4_ino_t d_ino;
svr4_off_t d_off;
u_short d_reclen;
char d_name[SVR4_MAXNAMLEN + 1];
};
struct svr4_dirent64 {
svr4_ino64_t d_ino;
svr4_off64_t d_off;
u_short d_reclen;
char d_name[SVR4_MAXNAMLEN + 1];
};
#define SVR4_NAMEOFF(dp) ((char *)&(dp)->d_name - (char *)dp)
#define SVR4_RECLEN(de,namlen) ALIGN((SVR4_NAMEOFF(de) + (namlen) + 1))
#endif /* !_SVR4_DIRENT_H_ */

View File

@ -1,172 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_ERRNO_H_
#define _SVR4_ERRNO_H_
#define SVR4_EPERM 1
#define SVR4_ENOENT 2
#define SVR4_ESRCH 3
#define SVR4_EINTR 4
#define SVR4_EIO 5
#define SVR4_ENXIO 6
#define SVR4_E2BIG 7
#define SVR4_ENOEXEC 8
#define SVR4_EBADF 9
#define SVR4_ECHILD 10
#define SVR4_EAGAIN 11
#define SVR4_ENOMEM 12
#define SVR4_EACCES 13
#define SVR4_EFAULT 14
#define SVR4_ENOTBLK 15
#define SVR4_EBUSY 16
#define SVR4_EEXIST 17
#define SVR4_EXDEV 18
#define SVR4_ENODEV 19
#define SVR4_ENOTDIR 20
#define SVR4_EISDIR 21
#define SVR4_EINVAL 22
#define SVR4_ENFILE 23
#define SVR4_EMFILE 24
#define SVR4_ENOTTY 25
#define SVR4_ETXTBSY 26
#define SVR4_EFBIG 27
#define SVR4_ENOSPC 28
#define SVR4_ESPIPE 29
#define SVR4_EROFS 30
#define SVR4_EMLINK 31
#define SVR4_EPIPE 32
#define SVR4_EDOM 33
#define SVR4_ERANGE 34
#define SVR4_ENOMSG 35
#define SVR4_EIDRM 36
#define SVR4_ECHRNG 37
#define SVR4_EL2NSYNC 38
#define SVR4_EL3HLT 39
#define SVR4_EL3RST 40
#define SVR4_ELNRNG 41
#define SVR4_EUNATCH 42
#define SVR4_ENOCSI 43
#define SVR4_EL2HLT 44
#define SVR4_EDEADLK 45
#define SVR4_ENOLCK 46
#define SVR4_EBADE 50
#define SVR4_EBADR 51
#define SVR4_EXFULL 52
#define SVR4_ENOANO 53
#define SVR4_EBADRQC 54
#define SVR4_EBADSLT 55
#define SVR4_EDEADLOCK 56
#define SVR4_EBFONT 57
#define SVR4_ENOSTR 60
#define SVR4_ENODATA 61
#define SVR4_ETIME 62
#define SVR4_ENOSR 63
#define SVR4_ENONET 64
#define SVR4_ENOPKG 65
#define SVR4_EREMOTE 66
#define SVR4_ENOLINK 67
#define SVR4_EADV 68
#define SVR4_ESRMNT 69
#define SVR4_ECOMM 70
#define SVR4_EPROTO 71
#define SVR4_EMULTIHOP 74
#define SVR4_EBADMSG 77
#define SVR4_ENAMETOOLONG 78
#define SVR4_EOVERFLOW 79
#define SVR4_ENOTUNIQ 80
#define SVR4_EBADFD 81
#define SVR4_EREMCHG 82
#define SVR4_ELIBACC 83
#define SVR4_ELIBBAD 84
#define SVR4_ELIBSCN 85
#define SVR4_ELIBMAX 86
#define SVR4_ELIBEXEC 87
#define SVR4_EILSEQ 88
#define SVR4_ENOSYS 89
#define SVR4_ELOOP 90
#define SVR4_ERESTART 91
#define SVR4_ESTRPIPE 92
#define SVR4_ENOTEMPTY 93
#define SVR4_EUSERS 94
#define SVR4_ENOTSOCK 95
#define SVR4_EDESTADDRREQ 96
#define SVR4_EMSGSIZE 97
#define SVR4_EPROTOTYPE 98
#define SVR4_ENOPROTOOPT 99
#define SVR4_EPROTONOSUPPORT 120
#define SVR4_ESOCKTNOSUPPORT 121
#define SVR4_EOPNOTSUPP 122
#define SVR4_EPFNOSUPPORT 123
#define SVR4_EAFNOSUPPORT 124
#define SVR4_EADDRINUSE 125
#define SVR4_EADDRNOTAVAIL 126
#define SVR4_ENETDOWN 127
#define SVR4_ENETUNREACH 128
#define SVR4_ENETRESET 129
#define SVR4_ECONNABORTED 130
#define SVR4_ECONNRESET 131
#define SVR4_ENOBUFS 132
#define SVR4_EISCONN 133
#define SVR4_ENOTCONN 134
#define SVR4_EUCLEAN 135
#define SVR4_ENOTNAM 137
#define SVR4_ENAVAIL 138
#define SVR4_EISNAM 139
#define SVR4_EREMOTEIO 140
#define SVR4_EINIT 141
#define SVR4_EREMDEV 142
#define SVR4_ESHUTDOWN 143
#define SVR4_ETOOMANYREFS 144
#define SVR4_ETIMEDOUT 145
#define SVR4_ECONNREFUSED 146
#define SVR4_EHOSTDOWN 147
#define SVR4_EHOSTUNREACH 148
#define SVR4_EWOULDBLOCK SVR4_EAGAIN
#define SVR4_EALREADY 149
#define SVR4_EINPROGRESS 150
#define SVR4_ESTALE 151
#define SVR4_EIORESID 500
/*
* These ones are not translated...
*/
#define SVR4_EPROCLIM SVR4_ENOSYS
#define SVR4_EDQUOT SVR4_ENOSYS
#define SVR4_EBADRPC SVR4_ENOSYS
#define SVR4_ERPCMISMATCH SVR4_ENOSYS
#define SVR4_EPROGUNAVAIL SVR4_ENOSYS
#define SVR4_EPROGMISMATCH SVR4_ENOSYS
#define SVR4_EPROCUNAVAIL SVR4_ENOSYS
#define SVR4_EFTYPE SVR4_ENOSYS
#define SVR4_EAUTH SVR4_ENOSYS
#define SVR4_ENEEDAUTH SVR4_ENOSYS
#endif /* !_SVR4_ERRNO_H_ */

View File

@ -1,70 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_EXEC_H_
#define _SVR4_EXEC_H_
#ifdef SVR4_COMPAT_SOLARIS2
# define SVR4_AUX_ARGSIZ (sizeof(AuxInfo) * 12 / sizeof(char *))
#else
# define SVR4_AUX_ARGSIZ (sizeof(AuxInfo) * 8 / sizeof(char *))
#endif
#if 0
/* Don't think we need all this NetBSD stuff */
/*
* The following is horrible; there must be a better way. I need to
* play with brk(2) a bit more.
*/
#ifdef __i386__
/*
* I cannot load the interpreter after the data segment because brk(2)
* breaks. I have to load it somewhere before. Programs start at
* 0x08000000 so I load the interpreter far before.
*/
#define SVR4_INTERP_ADDR 0x01000000
#endif
#ifdef sparc
/*
* Here programs load at 0x00010000, so I load the interpreter far after
* the end of the data segment.
*/
#define SVR4_INTERP_ADDR 0x10000000
#endif
#ifndef SVR4_INTERP_ADDR
# define SVR4_INTERP_ADDR 0
#endif
#endif
/*void svr4_setregs(struct thread *, struct exec_package *, u_long);*/
#endif /* !_SVR4_EXEC_H_ */

View File

@ -1,732 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994, 1997 Christos Zoulas.
* 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.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/capsicum.h>
#include <sys/systm.h>
#include <sys/file.h>
#include <sys/filedesc.h>
/*#include <sys/ioctl.h>*/
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/syscallsubr.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/sysproto.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_fcntl.h>
#include <security/mac/mac_framework.h>
static int svr4_to_bsd_flags(int);
static u_long svr4_to_bsd_cmd(u_long);
static int fd_revoke(struct thread *, int);
static int fd_truncate(struct thread *, int, struct flock *);
static int bsd_to_svr4_flags(int);
static void bsd_to_svr4_flock(struct flock *, struct svr4_flock *);
static void svr4_to_bsd_flock(struct svr4_flock *, struct flock *);
static void bsd_to_svr4_flock64(struct flock *, struct svr4_flock64 *);
static void svr4_to_bsd_flock64(struct svr4_flock64 *, struct flock *);
static u_long
svr4_to_bsd_cmd(cmd)
u_long cmd;
{
switch (cmd) {
case SVR4_F_DUPFD:
return F_DUPFD;
case SVR4_F_DUP2FD:
return F_DUP2FD;
case SVR4_F_GETFD:
return F_GETFD;
case SVR4_F_SETFD:
return F_SETFD;
case SVR4_F_GETFL:
return F_GETFL;
case SVR4_F_SETFL:
return F_SETFL;
case SVR4_F_GETLK:
return F_GETLK;
case SVR4_F_SETLK:
return F_SETLK;
case SVR4_F_SETLKW:
return F_SETLKW;
default:
return -1;
}
}
static int
svr4_to_bsd_flags(l)
int l;
{
int r = 0;
r |= (l & SVR4_O_RDONLY) ? O_RDONLY : 0;
r |= (l & SVR4_O_WRONLY) ? O_WRONLY : 0;
r |= (l & SVR4_O_RDWR) ? O_RDWR : 0;
r |= (l & SVR4_O_NDELAY) ? O_NONBLOCK : 0;
r |= (l & SVR4_O_APPEND) ? O_APPEND : 0;
r |= (l & SVR4_O_SYNC) ? O_FSYNC : 0;
r |= (l & SVR4_O_NONBLOCK) ? O_NONBLOCK : 0;
r |= (l & SVR4_O_PRIV) ? O_EXLOCK : 0;
r |= (l & SVR4_O_CREAT) ? O_CREAT : 0;
r |= (l & SVR4_O_TRUNC) ? O_TRUNC : 0;
r |= (l & SVR4_O_EXCL) ? O_EXCL : 0;
r |= (l & SVR4_O_NOCTTY) ? O_NOCTTY : 0;
return r;
}
static int
bsd_to_svr4_flags(l)
int l;
{
int r = 0;
r |= (l & O_RDONLY) ? SVR4_O_RDONLY : 0;
r |= (l & O_WRONLY) ? SVR4_O_WRONLY : 0;
r |= (l & O_RDWR) ? SVR4_O_RDWR : 0;
r |= (l & O_NDELAY) ? SVR4_O_NONBLOCK : 0;
r |= (l & O_APPEND) ? SVR4_O_APPEND : 0;
r |= (l & O_FSYNC) ? SVR4_O_SYNC : 0;
r |= (l & O_NONBLOCK) ? SVR4_O_NONBLOCK : 0;
r |= (l & O_EXLOCK) ? SVR4_O_PRIV : 0;
r |= (l & O_CREAT) ? SVR4_O_CREAT : 0;
r |= (l & O_TRUNC) ? SVR4_O_TRUNC : 0;
r |= (l & O_EXCL) ? SVR4_O_EXCL : 0;
r |= (l & O_NOCTTY) ? SVR4_O_NOCTTY : 0;
return r;
}
static void
bsd_to_svr4_flock(iflp, oflp)
struct flock *iflp;
struct svr4_flock *oflp;
{
switch (iflp->l_type) {
case F_RDLCK:
oflp->l_type = SVR4_F_RDLCK;
break;
case F_WRLCK:
oflp->l_type = SVR4_F_WRLCK;
break;
case F_UNLCK:
oflp->l_type = SVR4_F_UNLCK;
break;
default:
oflp->l_type = -1;
break;
}
oflp->l_whence = (short) iflp->l_whence;
oflp->l_start = (svr4_off_t) iflp->l_start;
oflp->l_len = (svr4_off_t) iflp->l_len;
oflp->l_sysid = 0;
oflp->l_pid = (svr4_pid_t) iflp->l_pid;
}
static void
svr4_to_bsd_flock(iflp, oflp)
struct svr4_flock *iflp;
struct flock *oflp;
{
switch (iflp->l_type) {
case SVR4_F_RDLCK:
oflp->l_type = F_RDLCK;
break;
case SVR4_F_WRLCK:
oflp->l_type = F_WRLCK;
break;
case SVR4_F_UNLCK:
oflp->l_type = F_UNLCK;
break;
default:
oflp->l_type = -1;
break;
}
oflp->l_whence = iflp->l_whence;
oflp->l_start = (off_t) iflp->l_start;
oflp->l_len = (off_t) iflp->l_len;
oflp->l_pid = (pid_t) iflp->l_pid;
oflp->l_sysid = iflp->l_sysid;
}
static void
bsd_to_svr4_flock64(iflp, oflp)
struct flock *iflp;
struct svr4_flock64 *oflp;
{
switch (iflp->l_type) {
case F_RDLCK:
oflp->l_type = SVR4_F_RDLCK;
break;
case F_WRLCK:
oflp->l_type = SVR4_F_WRLCK;
break;
case F_UNLCK:
oflp->l_type = SVR4_F_UNLCK;
break;
default:
oflp->l_type = -1;
break;
}
oflp->l_whence = (short) iflp->l_whence;
oflp->l_start = (svr4_off64_t) iflp->l_start;
oflp->l_len = (svr4_off64_t) iflp->l_len;
oflp->l_sysid = iflp->l_sysid;
oflp->l_pid = (svr4_pid_t) iflp->l_pid;
}
static void
svr4_to_bsd_flock64(iflp, oflp)
struct svr4_flock64 *iflp;
struct flock *oflp;
{
switch (iflp->l_type) {
case SVR4_F_RDLCK:
oflp->l_type = F_RDLCK;
break;
case SVR4_F_WRLCK:
oflp->l_type = F_WRLCK;
break;
case SVR4_F_UNLCK:
oflp->l_type = F_UNLCK;
break;
default:
oflp->l_type = -1;
break;
}
oflp->l_whence = iflp->l_whence;
oflp->l_start = (off_t) iflp->l_start;
oflp->l_len = (off_t) iflp->l_len;
oflp->l_pid = (pid_t) iflp->l_pid;
}
static int
fd_revoke(td, fd)
struct thread *td;
int fd;
{
struct vnode *vp;
struct mount *mp;
struct vattr vattr;
cap_rights_t rights;
int error, *retval;
retval = td->td_retval;
/*
* If we ever want to support Capsicum on SVR4 processes (unlikely)
* or FreeBSD grows a native frevoke() (more likely), we will need a
* CAP_FREVOKE here.
*
* In the meantime, use CAP_ALL(): if a SVR4 process wants to
* do an frevoke(), it needs to do it on either a regular file
* descriptor or a fully-privileged capability (which is effectively
* the same as a non-capability-restricted file descriptor).
*/
CAP_ALL(&rights);
if ((error = fgetvp(td, fd, &rights, &vp)) != 0)
return (error);
if (vp->v_type != VCHR && vp->v_type != VBLK) {
error = EINVAL;
goto out;
}
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = mac_vnode_check_revoke(td->td_ucred, vp);
VOP_UNLOCK(vp, 0);
if (error)
goto out;
#endif
if ((error = VOP_GETATTR(vp, &vattr, td->td_ucred)) != 0)
goto out;
if (td->td_ucred->cr_uid != vattr.va_uid &&
(error = priv_check(td, PRIV_VFS_ADMIN)) != 0)
goto out;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
goto out;
if (vcount(vp) > 1)
VOP_REVOKE(vp, REVOKEALL);
vn_finished_write(mp);
out:
vrele(vp);
return error;
}
static int
fd_truncate(td, fd, flp)
struct thread *td;
int fd;
struct flock *flp;
{
off_t start, length;
struct file *fp;
struct vnode *vp;
struct vattr vattr;
int error, *retval;
struct ftruncate_args ft;
cap_rights_t rights;
retval = td->td_retval;
/*
* We only support truncating the file.
*/
error = fget(td, fd, cap_rights_init(&rights, CAP_FTRUNCATE), &fp);
if (error != 0)
return (error);
vp = fp->f_vnode;
if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) {
fdrop(fp, td);
return ESPIPE;
}
if ((error = VOP_GETATTR(vp, &vattr, td->td_ucred)) != 0) {
fdrop(fp, td);
return error;
}
length = vattr.va_size;
switch (flp->l_whence) {
case SEEK_CUR:
start = fp->f_offset + flp->l_start;
break;
case SEEK_END:
start = flp->l_start + length;
break;
case SEEK_SET:
start = flp->l_start;
break;
default:
fdrop(fp, td);
return EINVAL;
}
if (start + flp->l_len < length) {
/* We don't support free'ing in the middle of the file */
fdrop(fp, td);
return EINVAL;
}
ft.fd = fd;
ft.length = start;
error = sys_ftruncate(td, &ft);
fdrop(fp, td);
return (error);
}
int
svr4_sys_open(td, uap)
struct thread *td;
struct svr4_sys_open_args *uap;
{
struct proc *p = td->td_proc;
char *newpath;
int bsd_flags, error, retval;
CHECKALTEXIST(td, uap->path, &newpath);
bsd_flags = svr4_to_bsd_flags(uap->flags);
error = kern_openat(td, AT_FDCWD, newpath, UIO_SYSSPACE, bsd_flags,
uap->mode);
free(newpath, M_TEMP);
if (error) {
/* uprintf("svr4_open(%s, 0x%0x, 0%o): %d\n", uap->path,
uap->flags, uap->mode, error);*/
return error;
}
retval = td->td_retval[0];
PROC_LOCK(p);
if (!(bsd_flags & O_NOCTTY) && SESS_LEADER(p) &&
!(p->p_flag & P_CONTROLT)) {
#if defined(NOTYET)
cap_rights_t rights;
struct file *fp;
error = fget(td, retval,
cap_rights_init(&rights, CAP_IOCTL), &fp);
PROC_UNLOCK(p);
/*
* we may have lost a race the above open() and
* another thread issuing a close()
*/
if (error)
return (EBADF); /* XXX: correct errno? */
/* ignore any error, just give it a try */
if (fp->f_type == DTYPE_VNODE)
fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td->td_ucred,
td);
fdrop(fp, td);
} else {
PROC_UNLOCK(p);
}
#else
}
PROC_UNLOCK(p);
#endif
return error;
}
int
svr4_sys_open64(td, uap)
struct thread *td;
struct svr4_sys_open64_args *uap;
{
return svr4_sys_open(td, (struct svr4_sys_open_args *)uap);
}
int
svr4_sys_creat(td, uap)
struct thread *td;
struct svr4_sys_creat_args *uap;
{
char *newpath;
int error;
CHECKALTEXIST(td, uap->path, &newpath);
error = kern_openat(td, AT_FDCWD, newpath, UIO_SYSSPACE,
O_WRONLY | O_CREAT | O_TRUNC, uap->mode);
free(newpath, M_TEMP);
return (error);
}
int
svr4_sys_creat64(td, uap)
struct thread *td;
struct svr4_sys_creat64_args *uap;
{
return svr4_sys_creat(td, (struct svr4_sys_creat_args *)uap);
}
int
svr4_sys_llseek(td, uap)
struct thread *td;
struct svr4_sys_llseek_args *uap;
{
struct lseek_args ap;
ap.fd = uap->fd;
#if BYTE_ORDER == BIG_ENDIAN
ap.offset = (((u_int64_t) uap->offset1) << 32) |
uap->offset2;
#else
ap.offset = (((u_int64_t) uap->offset2) << 32) |
uap->offset1;
#endif
ap.whence = uap->whence;
return sys_lseek(td, &ap);
}
int
svr4_sys_access(td, uap)
struct thread *td;
struct svr4_sys_access_args *uap;
{
char *newpath;
int error;
CHECKALTEXIST(td, uap->path, &newpath);
error = kern_accessat(td, AT_FDCWD, newpath, UIO_SYSSPACE,
0, uap->amode);
free(newpath, M_TEMP);
return (error);
}
#if defined(NOTYET)
int
svr4_sys_pread(td, uap)
struct thread *td;
struct svr4_sys_pread_args *uap;
{
struct pread_args pra;
/*
* Just translate the args structure and call the NetBSD
* pread(2) system call (offset type is 64-bit in NetBSD).
*/
pra.fd = uap->fd;
pra.buf = uap->buf;
pra.nbyte = uap->nbyte;
pra.offset = uap->off;
return pread(td, &pra);
}
#endif
#if defined(NOTYET)
int
svr4_sys_pread64(td, v, retval)
struct thread *td;
void *v;
register_t *retval;
{
struct svr4_sys_pread64_args *uap = v;
struct sys_pread_args pra;
/*
* Just translate the args structure and call the NetBSD
* pread(2) system call (offset type is 64-bit in NetBSD).
*/
pra.fd = uap->fd;
pra.buf = uap->buf;
pra.nbyte = uap->nbyte;
pra.offset = uap->off;
return (sys_pread(td, &pra, retval));
}
#endif /* NOTYET */
#if defined(NOTYET)
int
svr4_sys_pwrite(td, uap)
struct thread *td;
struct svr4_sys_pwrite_args *uap;
{
struct pwrite_args pwa;
/*
* Just translate the args structure and call the NetBSD
* pwrite(2) system call (offset type is 64-bit in NetBSD).
*/
pwa.fd = uap->fd;
pwa.buf = uap->buf;
pwa.nbyte = uap->nbyte;
pwa.offset = uap->off;
return pwrite(td, &pwa);
}
#endif
#if defined(NOTYET)
int
svr4_sys_pwrite64(td, v, retval)
struct thread *td;
void *v;
register_t *retval;
{
struct svr4_sys_pwrite64_args *uap = v;
struct sys_pwrite_args pwa;
/*
* Just translate the args structure and call the NetBSD
* pwrite(2) system call (offset type is 64-bit in NetBSD).
*/
pwa.fd = uap->fd;
pwa.buf = uap->buf;
pwa.nbyte = uap->nbyte;
pwa.offset = uap->off;
return (sys_pwrite(td, &pwa, retval));
}
#endif /* NOTYET */
int
svr4_sys_fcntl(td, uap)
struct thread *td;
struct svr4_sys_fcntl_args *uap;
{
int cmd, error, *retval;
retval = td->td_retval;
cmd = svr4_to_bsd_cmd(uap->cmd);
switch (cmd) {
case F_DUPFD:
case F_DUP2FD:
case F_GETFD:
case F_SETFD:
return (kern_fcntl(td, uap->fd, cmd, (intptr_t)uap->arg));
case F_GETFL:
error = kern_fcntl(td, uap->fd, cmd, (intptr_t)uap->arg);
if (error)
return (error);
*retval = bsd_to_svr4_flags(*retval);
return (error);
case F_SETFL:
{
/*
* we must save the O_ASYNC flag, as that is
* handled by ioctl(_, I_SETSIG, _) emulation.
*/
int flags;
DPRINTF(("Setting flags %p\n", uap->arg));
error = kern_fcntl(td, uap->fd, F_GETFL, 0);
if (error)
return (error);
flags = *retval;
flags &= O_ASYNC;
flags |= svr4_to_bsd_flags((u_long) uap->arg);
return (kern_fcntl(td, uap->fd, F_SETFL, flags));
}
case F_GETLK:
case F_SETLK:
case F_SETLKW:
{
struct svr4_flock ifl;
struct flock fl;
error = copyin(uap->arg, &ifl, sizeof (ifl));
if (error)
return (error);
svr4_to_bsd_flock(&ifl, &fl);
error = kern_fcntl(td, uap->fd, cmd, (intptr_t)&fl);
if (error || cmd != F_GETLK)
return (error);
bsd_to_svr4_flock(&fl, &ifl);
return (copyout(&ifl, uap->arg, sizeof (ifl)));
}
case -1:
switch (uap->cmd) {
case SVR4_F_FREESP:
{
struct svr4_flock ifl;
struct flock fl;
error = copyin(uap->arg, &ifl,
sizeof ifl);
if (error)
return error;
svr4_to_bsd_flock(&ifl, &fl);
return fd_truncate(td, uap->fd, &fl);
}
case SVR4_F_GETLK64:
case SVR4_F_SETLK64:
case SVR4_F_SETLKW64:
{
struct svr4_flock64 ifl;
struct flock fl;
switch (uap->cmd) {
case SVR4_F_GETLK64:
cmd = F_GETLK;
break;
case SVR4_F_SETLK64:
cmd = F_SETLK;
break;
case SVR4_F_SETLKW64:
cmd = F_SETLKW;
break;
}
error = copyin(uap->arg, &ifl,
sizeof (ifl));
if (error)
return (error);
svr4_to_bsd_flock64(&ifl, &fl);
error = kern_fcntl(td, uap->fd, cmd,
(intptr_t)&fl);
if (error || cmd != F_GETLK)
return (error);
bsd_to_svr4_flock64(&fl, &ifl);
return (copyout(&ifl, uap->arg,
sizeof (ifl)));
}
case SVR4_F_FREESP64:
{
struct svr4_flock64 ifl;
struct flock fl;
error = copyin(uap->arg, &ifl,
sizeof ifl);
if (error)
return error;
svr4_to_bsd_flock64(&ifl, &fl);
return fd_truncate(td, uap->fd, &fl);
}
case SVR4_F_REVOKE:
return fd_revoke(td, uap->fd);
default:
return ENOSYS;
}
default:
return ENOSYS;
}
}

View File

@ -1,134 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_FCNTL_H_
#define _SVR4_FCNTL_H_
#include <compat/svr4/svr4_types.h>
#include <sys/fcntl.h>
#define SVR4_O_RDONLY 0x0000
#define SVR4_O_WRONLY 0x0001
#define SVR4_O_RDWR 0x0002
#define SVR4_O_ACCMODE 0x0003
#define SVR4_O_NDELAY 0x0004
#define SVR4_O_APPEND 0x0008
#define SVR4_O_SYNC 0x0010
#define SVR4_O_NONBLOCK 0x0080
#define SVR4_O_CREAT 0x0100
#define SVR4_O_TRUNC 0x0200
#define SVR4_O_EXCL 0x0400
#define SVR4_O_NOCTTY 0x0800
#define SVR4_O_PRIV 0x1000
#define SVR4_FD_CLOEXEC 1
#define SVR4_F_DUPFD 0
#define SVR4_F_GETFD 1
#define SVR4_F_SETFD 2
#define SVR4_F_GETFL 3
#define SVR4_F_SETFL 4
#define SVR4_F_GETLK_SVR3 5
#define SVR4_F_SETLK 6
#define SVR4_F_SETLKW 7
#define SVR4_F_CHKFL 8
#define SVR4_F_DUP2FD 9
#define SVR4_F_ALLOCSP 10
#define SVR4_F_FREESP 11
#define SVR4_F_ISSTREAM 13
#define SVR4_F_GETLK 14
#define SVR4_F_PRIV 15
#define SVR4_F_NPRIV 16
#define SVR4_F_QUOTACTL 17
#define SVR4_F_BLOCKS 18
#define SVR4_F_BLKSIZE 19
#define SVR4_F_RSETLK 20
#define SVR4_F_RGETLK 21
#define SVR4_F_RSETLKW 22
#define SVR4_F_GETOWN 23
#define SVR4_F_SETOWN 24
#define SVR4_F_REVOKE 25
#define SVR4_F_HASREMOTELOCKS 26
#define SVR4_F_FREESP64 27
#define SVR4_F_GETLK64 33
#define SVR4_F_SETLK64 34
#define SVR4_F_SETLKW64 35
#define SVR4_F_SHARE 40
#define SVR4_F_UNSHARE 41
#define SVR4_F_CHSIZE_XENIX 0x6000
#define SVR4_F_RDCHK_XENIX 0x6001
#define SVR4_F_LK_UNLCK_XENIX 0x6300
#define SVR4_F_LK_LOCK_XENIX 0x7200
#define SVR4_F_LK_NBLCK_XENIX 0x6200
#define SVR4_F_LK_RLCK_XENIX 0x7100
#define SVR4_F_LK_NBRLCK_XENIX 0x6100
#define SVR4_LK_CMDTYPE(x) (((x) >> 12) & 0x7)
#define SVR4_LK_LCKTYPE(x) (((x) >> 8) & 0x7)
#define SVR4_F_RDLCK 1
#define SVR4_F_WRLCK 2
#define SVR4_F_UNLCK 3
struct svr4_flock_svr3 {
short l_type;
short l_whence;
svr4_off_t l_start;
svr4_off_t l_len;
short l_sysid;
svr4_o_pid_t l_pid;
};
struct svr4_flock {
short l_type;
short l_whence;
svr4_off_t l_start;
svr4_off_t l_len;
long l_sysid;
svr4_pid_t l_pid;
long pad[4];
};
struct svr4_flock64 {
short l_type;
short l_whence;
svr4_off64_t l_start;
svr4_off64_t l_len;
long l_sysid;
svr4_pid_t l_pid;
long pad[4];
};
#endif /* !_SVR4_FCNTL_H_ */

View File

@ -1,269 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/capsicum.h>
#include <sys/file.h>
#include <sys/filio.h>
#include <sys/lock.h>
#include <sys/signal.h>
#include <sys/filedesc.h>
#include <sys/poll.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/sysproto.h>
#include <sys/syscallsubr.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_ioctl.h>
#include <compat/svr4/svr4_filio.h>
/*#define GROTTY_READ_HACK*/
int
svr4_sys_poll(td, uap)
struct thread *td;
struct svr4_sys_poll_args *uap;
{
int error;
struct poll_args pa;
struct pollfd *pfd;
int idx = 0, cerr;
u_long siz;
if (uap->nfds > maxfilesperproc && uap->nfds > FD_SETSIZE)
return (EINVAL);
pa.fds = uap->fds;
pa.nfds = uap->nfds;
pa.timeout = uap->timeout;
siz = uap->nfds * sizeof(struct pollfd);
pfd = (struct pollfd *)malloc(siz, M_TEMP, M_WAITOK);
error = sys_poll(td, (struct poll_args *)uap);
if ((cerr = copyin(uap->fds, pfd, siz)) != 0) {
error = cerr;
goto done;
}
for (idx = 0; idx < uap->nfds; idx++) {
/* POLLWRNORM already equals POLLOUT, so we don't worry about that */
if (pfd[idx].revents & (POLLOUT | POLLWRNORM | POLLWRBAND))
pfd[idx].revents |= (POLLOUT | POLLWRNORM | POLLWRBAND);
}
if ((cerr = copyout(pfd, uap->fds, siz)) != 0) {
error = cerr;
goto done; /* yeah, I know it's the next line, but this way I won't
forget to update it if I add more code */
}
done:
free(pfd, M_TEMP);
return error;
}
#if defined(READ_TEST)
int
svr4_sys_read(td, uap)
struct thread *td;
struct svr4_sys_read_args *uap;
{
struct read_args ra;
cap_rights_t rights;
struct file *fp;
struct socket *so = NULL;
int so_state;
sigset_t sigmask;
int rv;
ra.fd = uap->fd;
ra.buf = uap->buf;
ra.nbyte = uap->nbyte;
if (fget(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp) != 0) {
DPRINTF(("Something fishy with the user-supplied file descriptor...\n"));
return EBADF;
}
if (fp->f_type == DTYPE_SOCKET) {
so = fp->f_data;
DPRINTF(("fd %d is a socket\n", uap->fd));
if (so->so_state & SS_ASYNC) {
DPRINTF(("fd %d is an ASYNC socket!\n", uap->fd));
}
DPRINTF(("Here are its flags: 0x%x\n", so->so_state));
#if defined(GROTTY_READ_HACK)
so_state = so->so_state;
so->so_state &= ~SS_NBIO;
#endif
}
rv = read(td, &ra);
DPRINTF(("svr4_read(%d, 0x%0x, %d) = %d\n",
uap->fd, uap->buf, uap->nbyte, rv));
if (rv == EAGAIN) {
#ifdef DEBUG_SVR4
struct sigacts *ps;
PROC_LOCK(td->td_proc);
ps = td->td_proc->p_sigacts;
mtx_lock(&ps->ps_mtx);
#endif
DPRINTF(("sigmask = 0x%x\n", td->td_sigmask));
DPRINTF(("sigignore = 0x%x\n", ps->ps_sigignore));
DPRINTF(("sigcaught = 0x%x\n", ps->ps_sigcatch));
DPRINTF(("siglist = 0x%x\n", td->td_siglist));
#ifdef DEBUG_SVR4
mtx_unlock(&ps->ps_mtx);
PROC_UNLOCK(td->td_proc);
#endif
}
#if defined(GROTTY_READ_HACK)
if (so) { /* We've already checked to see if this is a socket */
so->so_state = so_state;
}
#endif
fdrop(fp, td);
return(rv);
}
#endif /* READ_TEST */
#if defined(BOGUS)
int
svr4_sys_write(td, uap)
struct thread *td;
struct svr4_sys_write_args *uap;
{
struct write_args wa;
struct file *fp;
int rv;
wa.fd = uap->fd;
wa.buf = uap->buf;
wa.nbyte = uap->nbyte;
rv = write(td, &wa);
DPRINTF(("svr4_write(%d, 0x%0x, %d) = %d\n",
uap->fd, uap->buf, uap->nbyte, rv));
return(rv);
}
#endif /* BOGUS */
int
svr4_fil_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
struct thread *td;
register_t *retval;
int fd;
u_long cmd;
caddr_t data;
{
struct filedesc *fdp = td->td_proc->p_fd;
struct filedescent *fde;
int error, num;
*retval = 0;
switch (cmd) {
case SVR4_FIOCLEX:
FILEDESC_XLOCK(fdp);
fde = &fdp->fd_ofiles[fd];
fde->fde_flags |= UF_EXCLOSE;
FILEDESC_XUNLOCK(fdp);
return 0;
case SVR4_FIONCLEX:
FILEDESC_XLOCK(fdp);
fde = &fdp->fd_ofiles[fd];
fde->fde_flags &= ~UF_EXCLOSE;
FILEDESC_XUNLOCK(fdp);
return 0;
case SVR4_FIOGETOWN:
case SVR4_FIOSETOWN:
case SVR4_FIOASYNC:
case SVR4_FIONBIO:
case SVR4_FIONREAD:
if ((error = copyin(data, &num, sizeof(num))) != 0)
return error;
switch (cmd) {
case SVR4_FIOGETOWN: cmd = FIOGETOWN; break;
case SVR4_FIOSETOWN: cmd = FIOSETOWN; break;
case SVR4_FIOASYNC: cmd = FIOASYNC; break;
case SVR4_FIONBIO: cmd = FIONBIO; break;
case SVR4_FIONREAD: cmd = FIONREAD; break;
}
#ifdef SVR4_DEBUG
if (cmd == FIOASYNC) DPRINTF(("FIOASYNC\n"));
#endif
error = fo_ioctl(fp, cmd, (caddr_t) &num, td->td_ucred, td);
if (error)
return error;
return copyout(&num, data, sizeof(num));
default:
DPRINTF(("Unknown svr4 filio %lx\n", cmd));
return 0; /* ENOSYS really */
}
}
int
svr4_pipe(struct thread *td, struct svr4_pipe_args *uap) {
int error;
int fildes[2];
error = kern_pipe(td, fildes, 0, NULL, NULL);
if (error)
return (error);
td->td_retval[0] = fildes[0];
td->td_retval[1] = fildes[1];
return (0);
}

View File

@ -1,45 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_FILIO_H_
#define _SVR4_FILIO_H_
#define SVR4_FIOC ('f' << 8)
#define SVR4_FIOCLEX SVR4_IO('f', 1)
#define SVR4_FIONCLEX SVR4_IO('f', 2)
#define SVR4_FIOGETOWN SVR4_IOR('f', 123, int)
#define SVR4_FIOSETOWN SVR4_IOW('f', 124, int)
#define SVR4_FIOASYNC SVR4_IOW('f', 125, int)
#define SVR4_FIONBIO SVR4_IOW('f', 126, int)
#define SVR4_FIONREAD SVR4_IOR('f', 127, int)
#endif /* !_SVR4_FILIO_H_ */

View File

@ -1,90 +0,0 @@
/*
* $FreeBSD$
* Derived from:
* $NetBSD: svr4_fuser.h,v 1.4 1998/09/04 19:54:38 christos Exp $ */
/*-
* Original Copyright:
*
* Copyright (c) 1994 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* 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.
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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.
*/
/*-
* Portions of this code have been derived from code contributed to the
* FreeBSD Project by Mark Newton.
*
* Copyright (c) 1999 Mark Newton
* 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.
* 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.
*/
#ifndef _SVR4_FUSER_H_
#define _SVR4_FUSER_H_
#include <compat/svr4/svr4_types.h>
struct svr4_f_user {
svr4_pid_t fu_pid;
int fu_flags;
uid_t fu_uid;
};
#define SVR4_F_FILE_ONLY 1
#define SVR4_F_CONTAINED 2
#define SVR4_F_CDIR 0x01
#define SVR4_F_RDIR 0x02
#define SVR4_F_TEXT 0x04
#define SVR4_F_MAP 0x08
#define SVR4_F_OPEN 0x10
#define SVR4_F_TRACE 0x20
#define SVR4_F_TTY 0x40
#endif /* !_SVR4_FUSER_H_ */

View File

@ -1,87 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_HRT_H_
#define _SVR4_HRT_H_
#define SVR4_HRT_CNTL 0
#define SVR4_HRT_CNTL_RES 0
#define SVR4_HRT_CNTL_TOFD 1
#define SVR4_HRT_CNTL_START 2
#define SVR4_HRT_CNTL_GET 3
#define SVR4_HRT_ALRM 1
#define SVR4_HRT_ALRM_DO 4
#define SVR4_HRT_ALRM_REP 5
#define SVR4_HRT_ALRM_TOD 6
#define SVR4_HRT_ALRM_FUTREP 7
#define SVR4_HRT_ALRM_TODREP 8
#define SVR4_HRT_ALRM_PEND 9
#define SVR4_HRT_SLP 2
#define SVR4_HRT_SLP_INT 10
#define SVR4_HRT_SLP_TOD 11
#define SVR4_HRT_BSD 12
#define SVR4_HRT_BSD_PEND 13
#define SVR4_HRT_BSD_REP1 14
#define SVR4_HRT_BSD_REP2 15
#define SVR4_HRT_BSD_CANCEL 16
#define SVR4_HRT_CAN 3
#define SVR4_HRT_SEC 1
#define SVR4_HRT_MSEC 1000
#define SVR4_HRT_USEC 1000000
#define SVR4_HRT_NSEC 1000000000
#define SVR4_HRT_TRUNC 0
#define SVR4_HRT_RND 1
typedef struct {
u_long i_word1;
u_long i_word2;
int i_clock;
} svr4_hrt_interval_t;
typedef struct {
u_long h_sec;
long h_rem;
u_long h_res;
} svr4_hrt_time_t;
#define SVR4_HRT_DONE 1
#define SVR4_HRT_ERROR 2
#define SVR4_HRT_CLK_STD 1
#define SVR4_HRT_CLK_USERVIRT 2
#define SVR4_HRT_CLK_PROCVIRT 4
#endif /* !_SVR4_HRT_H_ */

View File

@ -1,165 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/capsicum.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/fcntl.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/systm.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_stropts.h>
#include <compat/svr4/svr4_ioctl.h>
#include <compat/svr4/svr4_termios.h>
#include <compat/svr4/svr4_filio.h>
#include <compat/svr4/svr4_sockio.h>
#ifdef DEBUG_SVR4
static void svr4_decode_cmd(u_long, char *, char *, int *, int *);
/*
* Decode an ioctl command symbolically
*/
static void
svr4_decode_cmd(cmd, dir, c, num, argsiz)
u_long cmd;
char *dir, *c;
int *num, *argsiz;
{
if (cmd & SVR4_IOC_VOID)
*dir++ = 'V';
if (cmd & SVR4_IOC_IN)
*dir++ = 'R';
if (cmd & SVR4_IOC_OUT)
*dir++ = 'W';
*dir = '\0';
if (cmd & SVR4_IOC_INOUT)
*argsiz = (cmd >> 16) & 0xff;
else
*argsiz = -1;
*c = (cmd >> 8) & 0xff;
*num = cmd & 0xff;
}
#endif
int
svr4_sys_ioctl(td, uap)
struct thread *td;
struct svr4_sys_ioctl_args *uap;
{
int *retval;
cap_rights_t rights;
struct file *fp;
u_long cmd;
int (*fun)(struct file *, struct thread *, register_t *,
int, u_long, caddr_t);
int error;
#ifdef DEBUG_SVR4
char dir[4];
char c;
int num;
int argsiz;
svr4_decode_cmd(uap->com, dir, &c, &num, &argsiz);
DPRINTF(("svr4_ioctl[%lx](%d, _IO%s(%c, %d, %d), %p);\n", uap->com, uap->fd,
dir, c, num, argsiz, uap->data));
#endif
retval = td->td_retval;
cmd = uap->com;
error = fget(td, uap->fd, cap_rights_init(&rights, CAP_IOCTL), &fp);
if (error != 0)
return (error);
if ((fp->f_flag & (FREAD | FWRITE)) == 0) {
fdrop(fp, td);
return EBADF;
}
#if defined(DEBUG_SVR4)
if (fp->f_type == DTYPE_SOCKET) {
struct socket *so = fp->f_data;
DPRINTF(("<<< IN: so_state = 0x%x\n", so->so_state));
}
#endif
switch (cmd & 0xff00) {
case SVR4_TIOC:
DPRINTF(("term\n"));
fun = svr4_term_ioctl;
break;
case SVR4_STR:
DPRINTF(("stream\n"));
fun = svr4_stream_ioctl;
break;
case SVR4_FIOC:
DPRINTF(("file\n"));
fun = svr4_fil_ioctl;
break;
case SVR4_SIOC:
DPRINTF(("socket\n"));
fun = svr4_sock_ioctl;
break;
case SVR4_XIOC:
/* We do not support those */
fdrop(fp, td);
return EINVAL;
default:
fdrop(fp, td);
DPRINTF(("Unimplemented ioctl %lx\n", cmd));
return 0; /* XXX: really ENOSYS */
}
#if defined(DEBUG_SVR4)
if (fp->f_type == DTYPE_SOCKET) {
struct socket *so;
so = fp->f_data;
DPRINTF((">>> OUT: so_state = 0x%x\n", so->so_state));
}
#endif
error = (*fun)(fp, td, retval, uap->fd, cmd, uap->data);
fdrop(fp, td);
return (error);
}

View File

@ -1,60 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_IOCTL_H_
#define _SVR4_IOCTL_H_
#define SVR4_IOC_VOID 0x20000000
#define SVR4_IOC_OUT 0x40000000
#define SVR4_IOC_IN 0x80000000
#define SVR4_IOC_INOUT (SVR4_IOC_IN|SVR4_IOC_OUT)
#define SVR4_IOC(inout,group,num,len) \
(inout | ((len & 0xff) << 16) | ((group) << 8) | (num))
#define SVR4_XIOC ('X' << 8)
#define SVR4_IO(g,n) SVR4_IOC(SVR4_IOC_VOID, (g), (n), 0)
#define SVR4_IOR(g,n,t) SVR4_IOC(SVR4_IOC_OUT, (g), (n), sizeof(t))
#define SVR4_IOW(g,n,t) SVR4_IOC(SVR4_IOC_IN, (g), (n), sizeof(t))
#define SVR4_IOWR(g,n,t) SVR4_IOC(SVR4_IOC_INOUT,(g), (n), sizeof(t))
int svr4_stream_ti_ioctl(struct file *, struct thread *, register_t *,
int, u_long, caddr_t);
int svr4_stream_ioctl(struct file *, struct thread *, register_t *,
int, u_long, caddr_t);
int svr4_term_ioctl(struct file *, struct thread *, register_t *,
int, u_long, caddr_t);
int svr4_fil_ioctl (struct file *, struct thread *, register_t *,
int, u_long, caddr_t);
int svr4_sock_ioctl (struct file *, struct thread *, register_t *,
int, u_long, caddr_t);
#endif /* !_SVR4_IOCTL_H_ */

View File

@ -1,679 +0,0 @@
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* 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.
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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.
*/
/*-
* Portions of this code have been derived from software contributed
* to the FreeBSD Project by Mark Newton.
*
* Copyright (c) 1999 Mark Newton
* 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.
* 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.
*
* XXX- This code is presently a no-op on FreeBSD (and isn't compiled due
* to preprocessor conditionals). A nice project for a kernel hacking
* novice might be to MakeItGo, but I have more important fish to fry
* at present.
*
* Derived from: $NetBSD: svr4_ipc.c,v 1.7 1998/10/19 22:43:00 tron Exp $
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_sysvipc.h"
#include <sys/param.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/proc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/syscallsubr.h>
#include <sys/sysproto.h>
#include <sys/systm.h>
#include <sys/time.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_ipc.h>
static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *,
struct ipc_perm *);
static void bsd_to_svr4_ipc_perm(const struct ipc_perm *,
struct svr4_ipc_perm *);
static void bsd_to_svr4_semid_ds(const struct semid_ds *,
struct svr4_semid_ds *);
static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *,
struct semid_ds *);
static int svr4_semop(struct thread *, void *);
static int svr4_semget(struct thread *, void *);
static int svr4_semctl(struct thread *, void *);
static void bsd_to_svr4_msqid_ds(const struct msqid_ds *,
struct svr4_msqid_ds *);
static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *,
struct msqid_ds *);
static int svr4_msgsnd(struct thread *, void *);
static int svr4_msgrcv(struct thread *, void *);
static int svr4_msgget(struct thread *, void *);
static int svr4_msgctl(struct thread *, void *);
static void bsd_to_svr4_shmid_ds(const struct shmid_ds *,
struct svr4_shmid_ds *);
static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *,
struct shmid_ds *);
static int svr4_shmat(struct thread *, void *);
static int svr4_shmdt(struct thread *, void *);
static int svr4_shmget(struct thread *, void *);
static int svr4_shmctl(struct thread *, void *);
static void
svr4_to_bsd_ipc_perm(spp, bpp)
const struct svr4_ipc_perm *spp;
struct ipc_perm *bpp;
{
bpp->key = spp->key;
bpp->uid = spp->uid;
bpp->gid = spp->gid;
bpp->cuid = spp->cuid;
bpp->cgid = spp->cgid;
bpp->mode = spp->mode;
bpp->seq = spp->seq;
}
static void
bsd_to_svr4_ipc_perm(bpp, spp)
const struct ipc_perm *bpp;
struct svr4_ipc_perm *spp;
{
spp->key = bpp->key;
spp->uid = bpp->uid;
spp->gid = bpp->gid;
spp->cuid = bpp->cuid;
spp->cgid = bpp->cgid;
spp->mode = bpp->mode;
spp->seq = bpp->seq;
}
static void
bsd_to_svr4_semid_ds(bds, sds)
const struct semid_ds *bds;
struct svr4_semid_ds *sds;
{
bzero(sds, sizeof(*sds));
bsd_to_svr4_ipc_perm(&bds->sem_perm, &sds->sem_perm);
sds->sem_base = (struct svr4_sem *) bds->sem_base;
sds->sem_nsems = bds->sem_nsems;
sds->sem_otime = bds->sem_otime;
sds->sem_ctime = bds->sem_ctime;
}
static void
svr4_to_bsd_semid_ds(sds, bds)
const struct svr4_semid_ds *sds;
struct semid_ds *bds;
{
svr4_to_bsd_ipc_perm(&sds->sem_perm, &bds->sem_perm);
bds->sem_base = (struct sem *) bds->sem_base;
bds->sem_nsems = sds->sem_nsems;
bds->sem_otime = sds->sem_otime;
bds->sem_ctime = sds->sem_ctime;
}
struct svr4_sys_semctl_args {
int what;
int semid;
int semnum;
int cmd;
union semun arg;
};
static int
svr4_semctl(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_semctl_args *uap = v;
struct svr4_semid_ds ss;
struct semid_ds bs;
union semun semun;
register_t rval;
int cmd, error;
switch (uap->cmd) {
case SVR4_SEM_GETZCNT:
cmd = GETZCNT;
break;
case SVR4_SEM_GETNCNT:
cmd = GETNCNT;
break;
case SVR4_SEM_GETPID:
cmd = GETPID;
break;
case SVR4_SEM_GETVAL:
cmd = GETVAL;
break;
case SVR4_SEM_SETVAL:
cmd = SETVAL;
break;
case SVR4_SEM_GETALL:
cmd = GETVAL;
break;
case SVR4_SEM_SETALL:
cmd = SETVAL;
break;
case SVR4_IPC_STAT:
cmd = IPC_STAT;
semun.buf = &bs;
error = kern_semctl(td, uap->semid, uap->semnum, cmd, &semun,
&rval);
if (error)
return (error);
bsd_to_svr4_semid_ds(&bs, &ss);
error = copyout(&ss, uap->arg.buf, sizeof(ss));
if (error == 0)
td->td_retval[0] = rval;
return (error);
case SVR4_IPC_SET:
cmd = IPC_SET;
error = copyin(uap->arg.buf, (caddr_t) &ss, sizeof ss);
if (error)
return (error);
svr4_to_bsd_semid_ds(&ss, &bs);
semun.buf = &bs;
return (kern_semctl(td, uap->semid, uap->semnum, cmd, &semun,
td->td_retval));
case SVR4_IPC_RMID:
cmd = IPC_RMID;
break;
default:
return EINVAL;
}
return (kern_semctl(td, uap->semid, uap->semnum, cmd, &uap->arg,
td->td_retval));
}
struct svr4_sys_semget_args {
int what;
svr4_key_t key;
int nsems;
int semflg;
};
static int
svr4_semget(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_semget_args *uap = v;
struct semget_args ap;
ap.key = uap->key;
ap.nsems = uap->nsems;
ap.semflg = uap->semflg;
return sys_semget(td, &ap);
}
struct svr4_sys_semop_args {
int what;
int semid;
struct svr4_sembuf * sops;
u_int nsops;
};
static int
svr4_semop(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_semop_args *uap = v;
struct semop_args ap;
ap.semid = uap->semid;
/* These are the same */
ap.sops = (struct sembuf *) uap->sops;
ap.nsops = uap->nsops;
return sys_semop(td, &ap);
}
int
svr4_sys_semsys(td, uap)
struct thread *td;
struct svr4_sys_semsys_args *uap;
{
DPRINTF(("svr4_semsys(%d)\n", uap->what));
switch (uap->what) {
case SVR4_semctl:
return svr4_semctl(td, uap);
case SVR4_semget:
return svr4_semget(td, uap);
case SVR4_semop:
return svr4_semop(td, uap);
default:
return EINVAL;
}
}
static void
bsd_to_svr4_msqid_ds(bds, sds)
const struct msqid_ds *bds;
struct svr4_msqid_ds *sds;
{
bzero(sds, sizeof(*sds));
bsd_to_svr4_ipc_perm(&bds->msg_perm, &sds->msg_perm);
sds->msg_first = (struct svr4_msg *) bds->msg_first;
sds->msg_last = (struct svr4_msg *) bds->msg_last;
sds->msg_cbytes = bds->msg_cbytes;
sds->msg_qnum = bds->msg_qnum;
sds->msg_qbytes = bds->msg_qbytes;
sds->msg_lspid = bds->msg_lspid;
sds->msg_lrpid = bds->msg_lrpid;
sds->msg_stime = bds->msg_stime;
sds->msg_rtime = bds->msg_rtime;
sds->msg_ctime = bds->msg_ctime;
}
static void
svr4_to_bsd_msqid_ds(sds, bds)
const struct svr4_msqid_ds *sds;
struct msqid_ds *bds;
{
svr4_to_bsd_ipc_perm(&sds->msg_perm, &bds->msg_perm);
bds->msg_first = (struct msg *) sds->msg_first;
bds->msg_last = (struct msg *) sds->msg_last;
bds->msg_cbytes = sds->msg_cbytes;
bds->msg_qnum = sds->msg_qnum;
bds->msg_qbytes = sds->msg_qbytes;
bds->msg_lspid = sds->msg_lspid;
bds->msg_lrpid = sds->msg_lrpid;
bds->msg_stime = sds->msg_stime;
bds->msg_rtime = sds->msg_rtime;
bds->msg_ctime = sds->msg_ctime;
}
struct svr4_sys_msgsnd_args {
int what;
int msqid;
void * msgp;
size_t msgsz;
int msgflg;
};
static int
svr4_msgsnd(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_msgsnd_args *uap = v;
struct msgsnd_args ap;
ap.msqid = uap->msqid;
ap.msgp = uap->msgp;
ap.msgsz = uap->msgsz;
ap.msgflg = uap->msgflg;
return sys_msgsnd(td, &ap);
}
struct svr4_sys_msgrcv_args {
int what;
int msqid;
void * msgp;
size_t msgsz;
long msgtyp;
int msgflg;
};
static int
svr4_msgrcv(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_msgrcv_args *uap = v;
struct msgrcv_args ap;
ap.msqid = uap->msqid;
ap.msgp = uap->msgp;
ap.msgsz = uap->msgsz;
ap.msgtyp = uap->msgtyp;
ap.msgflg = uap->msgflg;
return sys_msgrcv(td, &ap);
}
struct svr4_sys_msgget_args {
int what;
svr4_key_t key;
int msgflg;
};
static int
svr4_msgget(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_msgget_args *uap = v;
struct msgget_args ap;
ap.key = uap->key;
ap.msgflg = uap->msgflg;
return sys_msgget(td, &ap);
}
struct svr4_sys_msgctl_args {
int what;
int msqid;
int cmd;
struct svr4_msqid_ds * buf;
};
static int
svr4_msgctl(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_msgctl_args *uap = v;
struct svr4_msqid_ds ss;
struct msqid_ds bs;
int error;
switch (uap->cmd) {
case SVR4_IPC_STAT:
error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs);
if (error)
return error;
bsd_to_svr4_msqid_ds(&bs, &ss);
return copyout(&ss, uap->buf, sizeof ss);
case SVR4_IPC_SET:
error = copyin(uap->buf, &ss, sizeof ss);
if (error)
return error;
svr4_to_bsd_msqid_ds(&ss, &bs);
return (kern_msgctl(td, uap->msqid, IPC_SET, &bs));
case SVR4_IPC_RMID:
return (kern_msgctl(td, uap->msqid, IPC_RMID, NULL));
default:
return EINVAL;
}
}
int
svr4_sys_msgsys(td, uap)
struct thread *td;
struct svr4_sys_msgsys_args *uap;
{
DPRINTF(("svr4_msgsys(%d)\n", uap->what));
switch (uap->what) {
case SVR4_msgsnd:
return svr4_msgsnd(td, uap);
case SVR4_msgrcv:
return svr4_msgrcv(td, uap);
case SVR4_msgget:
return svr4_msgget(td, uap);
case SVR4_msgctl:
return svr4_msgctl(td, uap);
default:
return EINVAL;
}
}
static void
bsd_to_svr4_shmid_ds(bds, sds)
const struct shmid_ds *bds;
struct svr4_shmid_ds *sds;
{
bzero(sds, sizeof(*sds));
bsd_to_svr4_ipc_perm(&bds->shm_perm, &sds->shm_perm);
sds->shm_segsz = bds->shm_segsz;
sds->shm_lkcnt = 0;
sds->shm_lpid = bds->shm_lpid;
sds->shm_cpid = bds->shm_cpid;
sds->shm_amp = 0;
sds->shm_nattch = bds->shm_nattch;
sds->shm_cnattch = 0;
sds->shm_atime = bds->shm_atime;
sds->shm_dtime = bds->shm_dtime;
sds->shm_ctime = bds->shm_ctime;
}
static void
svr4_to_bsd_shmid_ds(sds, bds)
const struct svr4_shmid_ds *sds;
struct shmid_ds *bds;
{
svr4_to_bsd_ipc_perm(&sds->shm_perm, &bds->shm_perm);
bds->shm_segsz = sds->shm_segsz;
bds->shm_lpid = sds->shm_lpid;
bds->shm_cpid = sds->shm_cpid;
bds->shm_nattch = sds->shm_nattch;
bds->shm_atime = sds->shm_atime;
bds->shm_dtime = sds->shm_dtime;
bds->shm_ctime = sds->shm_ctime;
}
struct svr4_sys_shmat_args {
int what;
int shmid;
void * shmaddr;
int shmflg;
};
static int
svr4_shmat(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_shmat_args *uap = v;
struct shmat_args ap;
ap.shmid = uap->shmid;
ap.shmaddr = uap->shmaddr;
ap.shmflg = uap->shmflg;
return sys_shmat(td, &ap);
}
struct svr4_sys_shmdt_args {
int what;
void * shmaddr;
};
static int
svr4_shmdt(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_shmdt_args *uap = v;
struct shmdt_args ap;
ap.shmaddr = uap->shmaddr;
return sys_shmdt(td, &ap);
}
struct svr4_sys_shmget_args {
int what;
key_t key;
int size;
int shmflg;
};
static int
svr4_shmget(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_shmget_args *uap = v;
struct shmget_args ap;
ap.key = uap->key;
ap.size = uap->size;
ap.shmflg = uap->shmflg;
return sys_shmget(td, &ap);
}
struct svr4_sys_shmctl_args {
int what;
int shmid;
int cmd;
struct svr4_shmid_ds * buf;
};
int
svr4_shmctl(td, v)
struct thread *td;
void *v;
{
struct svr4_sys_shmctl_args *uap = v;
struct shmid_ds bs;
struct svr4_shmid_ds ss;
size_t bufsize;
int cmd, error;
if (uap->buf != NULL) {
switch (uap->cmd) {
case SVR4_IPC_SET:
case SVR4_SHM_LOCK:
case SVR4_SHM_UNLOCK:
error = copyin(uap->buf, &ss, sizeof(ss));
if (error)
return (error);
svr4_to_bsd_shmid_ds(&ss, &bs);
break;
default:
return (EINVAL);
}
}
switch (uap->cmd) {
case SVR4_IPC_STAT:
cmd = IPC_STAT;
break;
case SVR4_IPC_SET:
cmd = IPC_SET;
break;
case SVR4_IPC_RMID:
cmd = IPC_RMID;
break;
case SVR4_SHM_LOCK:
cmd = SHM_LOCK;
break;
case SVR4_SHM_UNLOCK:
cmd = SHM_UNLOCK;
break;
default:
return (EINVAL);
}
error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize);
if (error)
return (error);
switch (uap->cmd) {
case SVR4_IPC_STAT:
if (uap->buf != NULL) {
bsd_to_svr4_shmid_ds(&bs, &ss);
error = copyout(&ss, uap->buf, sizeof(ss));
}
break;
}
return (error);
}
int
svr4_sys_shmsys(td, uap)
struct thread *td;
struct svr4_sys_shmsys_args *uap;
{
DPRINTF(("svr4_shmsys(%d)\n", uap->what));
switch (uap->what) {
case SVR4_shmat:
return svr4_shmat(td, uap);
case SVR4_shmdt:
return svr4_shmdt(td, uap);
case SVR4_shmget:
return svr4_shmget(td, uap);
case SVR4_shmctl:
return svr4_shmctl(td, uap);
default:
return ENOSYS;
}
}
MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1);
MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1);
MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1);

View File

@ -1,176 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1995 Christos Zoulas. 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.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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 _SVR4_IPC_H_
#define _SVR4_IPC_H_
/*
* General IPC
*/
#define SVR4_IPC_RMID 10
#define SVR4_IPC_SET 11
#define SVR4_IPC_STAT 12
struct svr4_ipc_perm {
svr4_uid_t uid;
svr4_gid_t gid;
svr4_uid_t cuid;
svr4_gid_t cgid;
svr4_mode_t mode;
u_long seq;
svr4_key_t key;
long pad[4];
};
/*
* Message queues
*/
#define SVR4_msgget 0
#define SVR4_msgctl 1
#define SVR4_msgrcv 2
#define SVR4_msgsnd 3
struct svr4_msg {
struct svr4_msg *msg_next;
long msg_type;
u_short msg_ts;
short msg_spot;
};
struct svr4_msqid_ds {
struct svr4_ipc_perm msg_perm;
struct svr4_msg *msg_first;
struct svr4_msg *msg_last;
u_long msg_cbytes;
u_long msg_qnum;
u_long msg_qbytes;
svr4_pid_t msg_lspid;
svr4_pid_t msg_lrpid;
svr4_time_t msg_stime;
long msg_pad1;
svr4_time_t msg_rtime;
long msg_pad2;
svr4_time_t msg_ctime;
long msg_pad3;
short msg_cv;
short msg_qnum_cv;
long msg_pad4[3];
};
struct svr4_msgbuf {
long mtype; /* message type */
char mtext[1]; /* message text */
};
struct svr4_msginfo {
int msgmap;
int msgmax;
int msgmnb;
int msgmni;
int msgssz;
int msgtql;
u_short msgseg;
};
/*
* Shared memory
*/
#define SVR4_shmat 0
#define SVR4_shmctl 1
#define SVR4_shmdt 2
#define SVR4_shmget 3
/* shmctl() operations */
#define SVR4_SHM_LOCK 3
#define SVR4_SHM_UNLOCK 4
struct svr4_shmid_ds {
struct svr4_ipc_perm shm_perm;
int shm_segsz;
void *shm_amp;
u_short shm_lkcnt;
svr4_pid_t shm_lpid;
svr4_pid_t shm_cpid;
u_long shm_nattch;
u_long shm_cnattch;
svr4_time_t shm_atime;
long shm_pad1;
svr4_time_t shm_dtime;
long shm_pad2;
svr4_time_t shm_ctime;
long shm_pad3;
long shm_pad4[4];
};
/*
* Semaphores
*/
#define SVR4_semctl 0
#define SVR4_semget 1
#define SVR4_semop 2
/* semctl() operations */
#define SVR4_SEM_GETNCNT 3
#define SVR4_SEM_GETPID 4
#define SVR4_SEM_GETVAL 5
#define SVR4_SEM_GETALL 6
#define SVR4_SEM_GETZCNT 7
#define SVR4_SEM_SETVAL 8
#define SVR4_SEM_SETALL 9
struct svr4_sem {
u_short semval;
svr4_pid_t sempid;
u_short semncnt;
u_short semzcnt;
u_short semncnt_cv;
u_short semzcnt_cv;
};
struct svr4_semid_ds {
struct svr4_ipc_perm sem_perm;
struct svr4_sem *sem_base;
u_short sem_nsems;
svr4_time_t sem_otime;
long sem_pad1;
svr4_time_t sem_ctime;
long sem_pad2;
long sem_pad3[4];
};
struct svr4_sembuf {
u_short sem_num;
short sem_op;
short sem_flg;
};
#endif /* _SVR4_IPC_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1997 Todd Vierling
* 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.
* 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 _SVR4_MMAN_H_
#define _SVR4_MMAN_H_
/*
* Commands and flags passed to memcntl().
* Most of them are the same as <sys/mman.h>, but we need the MC_
* memcntl command definitions.
*/
#define SVR4_MC_SYNC 1
#define SVR4_MC_LOCK 2
#define SVR4_MC_UNLOCK 3
#define SVR4_MC_ADVISE 4
#define SVR4_MC_LOCKAS 5
#define SVR4_MC_UNLOCKAS 6
#endif /* !_SVR4_MMAN_H */

View File

@ -1,608 +0,0 @@
/*
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
*/
#ifndef _SVR4_SYSPROTO_H_
#define _SVR4_SYSPROTO_H_
#include <sys/signal.h>
#include <sys/acl.h>
#include <sys/cpuset.h>
#include <sys/_ffcounter.h>
#include <sys/_semaphore.h>
#include <sys/ucontext.h>
#include <sys/wait.h>
#include <bsm/audit_kevents.h>
struct proc;
struct thread;
#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
0 : sizeof(register_t) - sizeof(t))
#if BYTE_ORDER == LITTLE_ENDIAN
#define PADL_(t) 0
#define PADR_(t) PAD_(t)
#else
#define PADL_(t) PAD_(t)
#define PADR_(t) 0
#endif
struct svr4_sys_open_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct svr4_sys_wait_args {
char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)];
};
struct svr4_sys_creat_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct svr4_sys_execv_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
};
struct svr4_sys_time_args {
char t_l_[PADL_(time_t *)]; time_t * t; char t_r_[PADR_(time_t *)];
};
struct svr4_sys_mknod_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)];
};
struct svr4_sys_break_args {
char nsize_l_[PADL_(caddr_t)]; caddr_t nsize; char nsize_r_[PADR_(caddr_t)];
};
struct svr4_sys_stat_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char ub_l_[PADL_(struct svr4_stat *)]; struct svr4_stat * ub; char ub_r_[PADR_(struct svr4_stat *)];
};
struct svr4_sys_alarm_args {
char sec_l_[PADL_(unsigned)]; unsigned sec; char sec_r_[PADR_(unsigned)];
};
struct svr4_sys_fstat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char sb_l_[PADL_(struct svr4_stat *)]; struct svr4_stat * sb; char sb_r_[PADR_(struct svr4_stat *)];
};
struct svr4_sys_pause_args {
register_t dummy;
};
struct svr4_sys_utime_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char ubuf_l_[PADL_(struct svr4_utimbuf *)]; struct svr4_utimbuf * ubuf; char ubuf_r_[PADR_(struct svr4_utimbuf *)];
};
struct svr4_sys_access_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)];
};
struct svr4_sys_nice_args {
char prio_l_[PADL_(int)]; int prio; char prio_r_[PADR_(int)];
};
struct svr4_sys_kill_args {
char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)];
};
struct svr4_sys_pgrpsys_args {
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)];
};
struct svr4_pipe_args {
register_t dummy;
};
struct svr4_sys_times_args {
char tp_l_[PADL_(struct tms *)]; struct tms * tp; char tp_r_[PADR_(struct tms *)];
};
struct svr4_sys_signal_args {
char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)];
char handler_l_[PADL_(svr4_sig_t)]; svr4_sig_t handler; char handler_r_[PADR_(svr4_sig_t)];
};
struct svr4_sys_msgsys_args {
char what_l_[PADL_(int)]; int what; char what_r_[PADR_(int)];
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
};
struct svr4_sys_sysarch_args {
char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
char a1_l_[PADL_(void *)]; void * a1; char a1_r_[PADR_(void *)];
};
struct svr4_sys_shmsys_args {
char what_l_[PADL_(int)]; int what; char what_r_[PADR_(int)];
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
};
struct svr4_sys_semsys_args {
char what_l_[PADL_(int)]; int what; char what_r_[PADR_(int)];
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
};
struct svr4_sys_ioctl_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char com_l_[PADL_(u_long)]; u_long com; char com_r_[PADR_(u_long)];
char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)];
};
struct svr4_sys_utssys_args {
char a1_l_[PADL_(void *)]; void * a1; char a1_r_[PADR_(void *)];
char a2_l_[PADL_(void *)]; void * a2; char a2_r_[PADR_(void *)];
char sel_l_[PADL_(int)]; int sel; char sel_r_[PADR_(int)];
char a3_l_[PADL_(void *)]; void * a3; char a3_r_[PADR_(void *)];
};
struct svr4_sys_execve_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)];
};
struct svr4_sys_fcntl_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char arg_l_[PADL_(char *)]; char * arg; char arg_r_[PADR_(char *)];
};
struct svr4_sys_ulimit_args {
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char newlimit_l_[PADL_(long)]; long newlimit; char newlimit_r_[PADR_(long)];
};
struct svr4_sys_getdents_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char nbytes_l_[PADL_(int)]; int nbytes; char nbytes_r_[PADR_(int)];
};
struct svr4_sys_getmsg_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char ctl_l_[PADL_(struct svr4_strbuf *)]; struct svr4_strbuf * ctl; char ctl_r_[PADR_(struct svr4_strbuf *)];
char dat_l_[PADL_(struct svr4_strbuf *)]; struct svr4_strbuf * dat; char dat_r_[PADR_(struct svr4_strbuf *)];
char flags_l_[PADL_(int *)]; int * flags; char flags_r_[PADR_(int *)];
};
struct svr4_sys_putmsg_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char ctl_l_[PADL_(struct svr4_strbuf *)]; struct svr4_strbuf * ctl; char ctl_r_[PADR_(struct svr4_strbuf *)];
char dat_l_[PADL_(struct svr4_strbuf *)]; struct svr4_strbuf * dat; char dat_r_[PADR_(struct svr4_strbuf *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct svr4_sys_poll_args {
char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)];
char nfds_l_[PADL_(unsigned int)]; unsigned int nfds; char nfds_r_[PADR_(unsigned int)];
char timeout_l_[PADL_(int)]; int timeout; char timeout_r_[PADR_(int)];
};
struct svr4_sys_lstat_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char ub_l_[PADL_(struct svr4_stat *)]; struct svr4_stat * ub; char ub_r_[PADR_(struct svr4_stat *)];
};
struct svr4_sys_sigprocmask_args {
char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)];
char set_l_[PADL_(svr4_sigset_t *)]; svr4_sigset_t * set; char set_r_[PADR_(svr4_sigset_t *)];
char oset_l_[PADL_(svr4_sigset_t *)]; svr4_sigset_t * oset; char oset_r_[PADR_(svr4_sigset_t *)];
};
struct svr4_sys_sigsuspend_args {
char ss_l_[PADL_(svr4_sigset_t *)]; svr4_sigset_t * ss; char ss_r_[PADR_(svr4_sigset_t *)];
};
struct svr4_sys_sigaltstack_args {
char nss_l_[PADL_(struct svr4_sigaltstack *)]; struct svr4_sigaltstack * nss; char nss_r_[PADR_(struct svr4_sigaltstack *)];
char oss_l_[PADL_(struct svr4_sigaltstack *)]; struct svr4_sigaltstack * oss; char oss_r_[PADR_(struct svr4_sigaltstack *)];
};
struct svr4_sys_sigaction_args {
char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)];
char nsa_l_[PADL_(struct svr4_sigaction *)]; struct svr4_sigaction * nsa; char nsa_r_[PADR_(struct svr4_sigaction *)];
char osa_l_[PADL_(struct svr4_sigaction *)]; struct svr4_sigaction * osa; char osa_r_[PADR_(struct svr4_sigaction *)];
};
struct svr4_sys_sigpending_args {
char what_l_[PADL_(int)]; int what; char what_r_[PADR_(int)];
char mask_l_[PADL_(svr4_sigset_t *)]; svr4_sigset_t * mask; char mask_r_[PADR_(svr4_sigset_t *)];
};
struct svr4_sys_context_args {
char func_l_[PADL_(int)]; int func; char func_r_[PADR_(int)];
char uc_l_[PADL_(struct svr4_ucontext *)]; struct svr4_ucontext * uc; char uc_r_[PADR_(struct svr4_ucontext *)];
};
struct svr4_sys_statvfs_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char fs_l_[PADL_(struct svr4_statvfs *)]; struct svr4_statvfs * fs; char fs_r_[PADR_(struct svr4_statvfs *)];
};
struct svr4_sys_fstatvfs_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char fs_l_[PADL_(struct svr4_statvfs *)]; struct svr4_statvfs * fs; char fs_r_[PADR_(struct svr4_statvfs *)];
};
struct svr4_sys_waitsys_args {
char grp_l_[PADL_(int)]; int grp; char grp_r_[PADR_(int)];
char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)];
char info_l_[PADL_(union svr4_siginfo *)]; union svr4_siginfo * info; char info_r_[PADR_(union svr4_siginfo *)];
char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)];
};
struct svr4_sys_hrtsys_args {
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char fun_l_[PADL_(int)]; int fun; char fun_r_[PADR_(int)];
char sub_l_[PADL_(int)]; int sub; char sub_r_[PADR_(int)];
char rv1_l_[PADL_(void *)]; void * rv1; char rv1_r_[PADR_(void *)];
char rv2_l_[PADL_(void *)]; void * rv2; char rv2_r_[PADR_(void *)];
};
struct svr4_sys_pathconf_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
};
struct svr4_sys_mmap_args {
char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
char len_l_[PADL_(svr4_size_t)]; svr4_size_t len; char len_r_[PADR_(svr4_size_t)];
char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char pos_l_[PADL_(svr4_off_t)]; svr4_off_t pos; char pos_r_[PADR_(svr4_off_t)];
};
struct svr4_sys_fpathconf_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
};
struct svr4_sys_xstat_args {
char two_l_[PADL_(int)]; int two; char two_r_[PADR_(int)];
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char ub_l_[PADL_(struct svr4_xstat *)]; struct svr4_xstat * ub; char ub_r_[PADR_(struct svr4_xstat *)];
};
struct svr4_sys_lxstat_args {
char two_l_[PADL_(int)]; int two; char two_r_[PADR_(int)];
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char ub_l_[PADL_(struct svr4_xstat *)]; struct svr4_xstat * ub; char ub_r_[PADR_(struct svr4_xstat *)];
};
struct svr4_sys_fxstat_args {
char two_l_[PADL_(int)]; int two; char two_r_[PADR_(int)];
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char sb_l_[PADL_(struct svr4_xstat *)]; struct svr4_xstat * sb; char sb_r_[PADR_(struct svr4_xstat *)];
};
struct svr4_sys_xmknod_args {
char two_l_[PADL_(int)]; int two; char two_r_[PADR_(int)];
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char mode_l_[PADL_(svr4_mode_t)]; svr4_mode_t mode; char mode_r_[PADR_(svr4_mode_t)];
char dev_l_[PADL_(svr4_dev_t)]; svr4_dev_t dev; char dev_r_[PADR_(svr4_dev_t)];
};
struct svr4_sys_setrlimit_args {
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
char rlp_l_[PADL_(const struct svr4_rlimit *)]; const struct svr4_rlimit * rlp; char rlp_r_[PADR_(const struct svr4_rlimit *)];
};
struct svr4_sys_getrlimit_args {
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
char rlp_l_[PADL_(struct svr4_rlimit *)]; struct svr4_rlimit * rlp; char rlp_r_[PADR_(struct svr4_rlimit *)];
};
struct svr4_sys_memcntl_args {
char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
char len_l_[PADL_(svr4_size_t)]; svr4_size_t len; char len_r_[PADR_(svr4_size_t)];
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)];
char attr_l_[PADL_(int)]; int attr; char attr_r_[PADR_(int)];
char mask_l_[PADL_(int)]; int mask; char mask_r_[PADR_(int)];
};
struct svr4_sys_uname_args {
char name_l_[PADL_(struct svr4_utsname *)]; struct svr4_utsname * name; char name_r_[PADR_(struct svr4_utsname *)];
char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)];
};
struct svr4_sys_sysconfig_args {
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
};
struct svr4_sys_systeminfo_args {
char what_l_[PADL_(int)]; int what; char what_r_[PADR_(int)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char len_l_[PADL_(long)]; long len; char len_r_[PADR_(long)];
};
struct svr4_sys_fchroot_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
};
struct svr4_sys_utimes_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char tptr_l_[PADL_(struct timeval *)]; struct timeval * tptr; char tptr_r_[PADR_(struct timeval *)];
};
struct svr4_sys_vhangup_args {
register_t dummy;
};
struct svr4_sys_gettimeofday_args {
char tp_l_[PADL_(struct timeval *)]; struct timeval * tp; char tp_r_[PADR_(struct timeval *)];
};
struct svr4_sys_llseek_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char offset1_l_[PADL_(long)]; long offset1; char offset1_r_[PADR_(long)];
char offset2_l_[PADL_(long)]; long offset2; char offset2_r_[PADR_(long)];
char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
};
struct svr4_sys_acl_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char num_l_[PADL_(int)]; int num; char num_r_[PADR_(int)];
char buf_l_[PADL_(struct svr4_aclent *)]; struct svr4_aclent * buf; char buf_r_[PADR_(struct svr4_aclent *)];
};
struct svr4_sys_auditsys_args {
char code_l_[PADL_(int)]; int code; char code_r_[PADR_(int)];
char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)];
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
};
struct svr4_sys_facl_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char num_l_[PADL_(int)]; int num; char num_r_[PADR_(int)];
char buf_l_[PADL_(struct svr4_aclent *)]; struct svr4_aclent * buf; char buf_r_[PADR_(struct svr4_aclent *)];
};
struct svr4_sys_resolvepath_args {
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char bufsiz_l_[PADL_(size_t)]; size_t bufsiz; char bufsiz_r_[PADR_(size_t)];
};
struct svr4_sys_getdents64_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char dp_l_[PADL_(struct svr4_dirent64 *)]; struct svr4_dirent64 * dp; char dp_r_[PADR_(struct svr4_dirent64 *)];
char nbytes_l_[PADL_(int)]; int nbytes; char nbytes_r_[PADR_(int)];
};
struct svr4_sys_mmap64_args {
char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
char len_l_[PADL_(svr4_size_t)]; svr4_size_t len; char len_r_[PADR_(svr4_size_t)];
char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char pos_l_[PADL_(svr4_off64_t)]; svr4_off64_t pos; char pos_r_[PADR_(svr4_off64_t)];
};
struct svr4_sys_stat64_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char sb_l_[PADL_(struct svr4_stat64 *)]; struct svr4_stat64 * sb; char sb_r_[PADR_(struct svr4_stat64 *)];
};
struct svr4_sys_lstat64_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char sb_l_[PADL_(struct svr4_stat64 *)]; struct svr4_stat64 * sb; char sb_r_[PADR_(struct svr4_stat64 *)];
};
struct svr4_sys_fstat64_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char sb_l_[PADL_(struct svr4_stat64 *)]; struct svr4_stat64 * sb; char sb_r_[PADR_(struct svr4_stat64 *)];
};
struct svr4_sys_statvfs64_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char fs_l_[PADL_(struct svr4_statvfs64 *)]; struct svr4_statvfs64 * fs; char fs_r_[PADR_(struct svr4_statvfs64 *)];
};
struct svr4_sys_fstatvfs64_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char fs_l_[PADL_(struct svr4_statvfs64 *)]; struct svr4_statvfs64 * fs; char fs_r_[PADR_(struct svr4_statvfs64 *)];
};
struct svr4_sys_setrlimit64_args {
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
char rlp_l_[PADL_(const struct svr4_rlimit64 *)]; const struct svr4_rlimit64 * rlp; char rlp_r_[PADR_(const struct svr4_rlimit64 *)];
};
struct svr4_sys_getrlimit64_args {
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
char rlp_l_[PADL_(struct svr4_rlimit64 *)]; struct svr4_rlimit64 * rlp; char rlp_r_[PADR_(struct svr4_rlimit64 *)];
};
struct svr4_sys_creat64_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct svr4_sys_open64_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct svr4_sys_socket_args {
char domain_l_[PADL_(int)]; int domain; char domain_r_[PADR_(int)];
char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)];
char protocol_l_[PADL_(int)]; int protocol; char protocol_r_[PADR_(int)];
};
struct svr4_sys_recv_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct svr4_sys_send_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct svr4_sys_sendto_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
char to_l_[PADL_(struct sockaddr *)]; struct sockaddr * to; char to_r_[PADR_(struct sockaddr *)];
char tolen_l_[PADL_(int)]; int tolen; char tolen_r_[PADR_(int)];
};
int svr4_sys_open(struct thread *, struct svr4_sys_open_args *);
int svr4_sys_wait(struct thread *, struct svr4_sys_wait_args *);
int svr4_sys_creat(struct thread *, struct svr4_sys_creat_args *);
int svr4_sys_execv(struct thread *, struct svr4_sys_execv_args *);
int svr4_sys_time(struct thread *, struct svr4_sys_time_args *);
int svr4_sys_mknod(struct thread *, struct svr4_sys_mknod_args *);
int svr4_sys_break(struct thread *, struct svr4_sys_break_args *);
int svr4_sys_stat(struct thread *, struct svr4_sys_stat_args *);
int svr4_sys_alarm(struct thread *, struct svr4_sys_alarm_args *);
int svr4_sys_fstat(struct thread *, struct svr4_sys_fstat_args *);
int svr4_sys_pause(struct thread *, struct svr4_sys_pause_args *);
int svr4_sys_utime(struct thread *, struct svr4_sys_utime_args *);
int svr4_sys_access(struct thread *, struct svr4_sys_access_args *);
int svr4_sys_nice(struct thread *, struct svr4_sys_nice_args *);
int svr4_sys_kill(struct thread *, struct svr4_sys_kill_args *);
int svr4_sys_pgrpsys(struct thread *, struct svr4_sys_pgrpsys_args *);
int svr4_pipe(struct thread *, struct svr4_pipe_args *);
int svr4_sys_times(struct thread *, struct svr4_sys_times_args *);
int svr4_sys_signal(struct thread *, struct svr4_sys_signal_args *);
int svr4_sys_msgsys(struct thread *, struct svr4_sys_msgsys_args *);
int svr4_sys_sysarch(struct thread *, struct svr4_sys_sysarch_args *);
int svr4_sys_shmsys(struct thread *, struct svr4_sys_shmsys_args *);
int svr4_sys_semsys(struct thread *, struct svr4_sys_semsys_args *);
int svr4_sys_ioctl(struct thread *, struct svr4_sys_ioctl_args *);
int svr4_sys_utssys(struct thread *, struct svr4_sys_utssys_args *);
int svr4_sys_execve(struct thread *, struct svr4_sys_execve_args *);
int svr4_sys_fcntl(struct thread *, struct svr4_sys_fcntl_args *);
int svr4_sys_ulimit(struct thread *, struct svr4_sys_ulimit_args *);
int svr4_sys_getdents(struct thread *, struct svr4_sys_getdents_args *);
int svr4_sys_getmsg(struct thread *, struct svr4_sys_getmsg_args *);
int svr4_sys_putmsg(struct thread *, struct svr4_sys_putmsg_args *);
int svr4_sys_poll(struct thread *, struct svr4_sys_poll_args *);
int svr4_sys_lstat(struct thread *, struct svr4_sys_lstat_args *);
int svr4_sys_sigprocmask(struct thread *, struct svr4_sys_sigprocmask_args *);
int svr4_sys_sigsuspend(struct thread *, struct svr4_sys_sigsuspend_args *);
int svr4_sys_sigaltstack(struct thread *, struct svr4_sys_sigaltstack_args *);
int svr4_sys_sigaction(struct thread *, struct svr4_sys_sigaction_args *);
int svr4_sys_sigpending(struct thread *, struct svr4_sys_sigpending_args *);
int svr4_sys_context(struct thread *, struct svr4_sys_context_args *);
int svr4_sys_statvfs(struct thread *, struct svr4_sys_statvfs_args *);
int svr4_sys_fstatvfs(struct thread *, struct svr4_sys_fstatvfs_args *);
int svr4_sys_waitsys(struct thread *, struct svr4_sys_waitsys_args *);
int svr4_sys_hrtsys(struct thread *, struct svr4_sys_hrtsys_args *);
int svr4_sys_pathconf(struct thread *, struct svr4_sys_pathconf_args *);
int svr4_sys_mmap(struct thread *, struct svr4_sys_mmap_args *);
int svr4_sys_fpathconf(struct thread *, struct svr4_sys_fpathconf_args *);
int svr4_sys_xstat(struct thread *, struct svr4_sys_xstat_args *);
int svr4_sys_lxstat(struct thread *, struct svr4_sys_lxstat_args *);
int svr4_sys_fxstat(struct thread *, struct svr4_sys_fxstat_args *);
int svr4_sys_xmknod(struct thread *, struct svr4_sys_xmknod_args *);
int svr4_sys_setrlimit(struct thread *, struct svr4_sys_setrlimit_args *);
int svr4_sys_getrlimit(struct thread *, struct svr4_sys_getrlimit_args *);
int svr4_sys_memcntl(struct thread *, struct svr4_sys_memcntl_args *);
int svr4_sys_uname(struct thread *, struct svr4_sys_uname_args *);
int svr4_sys_sysconfig(struct thread *, struct svr4_sys_sysconfig_args *);
int svr4_sys_systeminfo(struct thread *, struct svr4_sys_systeminfo_args *);
int svr4_sys_fchroot(struct thread *, struct svr4_sys_fchroot_args *);
int svr4_sys_utimes(struct thread *, struct svr4_sys_utimes_args *);
int svr4_sys_vhangup(struct thread *, struct svr4_sys_vhangup_args *);
int svr4_sys_gettimeofday(struct thread *, struct svr4_sys_gettimeofday_args *);
int svr4_sys_llseek(struct thread *, struct svr4_sys_llseek_args *);
int svr4_sys_acl(struct thread *, struct svr4_sys_acl_args *);
int svr4_sys_auditsys(struct thread *, struct svr4_sys_auditsys_args *);
int svr4_sys_facl(struct thread *, struct svr4_sys_facl_args *);
int svr4_sys_resolvepath(struct thread *, struct svr4_sys_resolvepath_args *);
int svr4_sys_getdents64(struct thread *, struct svr4_sys_getdents64_args *);
int svr4_sys_mmap64(struct thread *, struct svr4_sys_mmap64_args *);
int svr4_sys_stat64(struct thread *, struct svr4_sys_stat64_args *);
int svr4_sys_lstat64(struct thread *, struct svr4_sys_lstat64_args *);
int svr4_sys_fstat64(struct thread *, struct svr4_sys_fstat64_args *);
int svr4_sys_statvfs64(struct thread *, struct svr4_sys_statvfs64_args *);
int svr4_sys_fstatvfs64(struct thread *, struct svr4_sys_fstatvfs64_args *);
int svr4_sys_setrlimit64(struct thread *, struct svr4_sys_setrlimit64_args *);
int svr4_sys_getrlimit64(struct thread *, struct svr4_sys_getrlimit64_args *);
int svr4_sys_creat64(struct thread *, struct svr4_sys_creat64_args *);
int svr4_sys_open64(struct thread *, struct svr4_sys_open64_args *);
int svr4_sys_socket(struct thread *, struct svr4_sys_socket_args *);
int svr4_sys_recv(struct thread *, struct svr4_sys_recv_args *);
int svr4_sys_send(struct thread *, struct svr4_sys_send_args *);
int svr4_sys_sendto(struct thread *, struct svr4_sys_sendto_args *);
#ifdef COMPAT_43
#endif /* COMPAT_43 */
#ifdef COMPAT_FREEBSD4
#endif /* COMPAT_FREEBSD4 */
#ifdef COMPAT_FREEBSD6
#endif /* COMPAT_FREEBSD6 */
#ifdef COMPAT_FREEBSD7
#endif /* COMPAT_FREEBSD7 */
#ifdef COMPAT_FREEBSD10
#endif /* COMPAT_FREEBSD10 */
#define SVR4_SYS_AUE_svr4_sys_open AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_wait AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_creat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_execv AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_time AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_mknod AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_break AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_stat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_alarm AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fstat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_pause AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_utime AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_access AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_nice AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_kill AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_pgrpsys AUE_NULL
#define SVR4_SYS_AUE_svr4_pipe AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_times AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_signal AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_msgsys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sysarch AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_shmsys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_semsys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_ioctl AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_utssys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_execve AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fcntl AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_ulimit AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_getdents AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_getmsg AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_putmsg AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_poll AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_lstat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sigprocmask AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sigsuspend AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sigaltstack AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sigaction AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sigpending AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_context AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_statvfs AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fstatvfs AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_waitsys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_hrtsys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_pathconf AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_mmap AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fpathconf AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_xstat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_lxstat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fxstat AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_xmknod AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_setrlimit AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_getrlimit AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_memcntl AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_uname AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sysconfig AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_systeminfo AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fchroot AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_utimes AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_vhangup AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_gettimeofday AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_llseek AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_acl AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_auditsys AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_facl AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_resolvepath AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_getdents64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_mmap64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_stat64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_lstat64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fstat64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_statvfs64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_fstatvfs64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_setrlimit64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_getrlimit64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_creat64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_open64 AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_socket AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_recv AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_send AUE_NULL
#define SVR4_SYS_AUE_svr4_sys_sendto AUE_NULL
#undef PAD_
#undef PADL_
#undef PADR_
#endif /* !_SVR4_SYSPROTO_H_ */

View File

@ -1,306 +0,0 @@
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* 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.
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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.
*/
/*-
* Portions of this software have been derived from software contributed
* to the FreeBSD Project by Mark Newton.
*
* Copyright (c) 1999 Mark Newton
* 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.
* 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.
*
* Derived from: $NetBSD: svr4_resource.c,v 1.3 1998/12/13 18:00:52 christos Exp $
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/file.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/resource.h>
#include <sys/resourcevar.h>
#include <sys/syscallsubr.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_resource.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_util.h>
static __inline int svr4_to_native_rl(int);
static __inline int
svr4_to_native_rl(rl)
int rl;
{
switch (rl) {
case SVR4_RLIMIT_CPU:
return RLIMIT_CPU;
case SVR4_RLIMIT_FSIZE:
return RLIMIT_FSIZE;
case SVR4_RLIMIT_DATA:
return RLIMIT_DATA;
case SVR4_RLIMIT_STACK:
return RLIMIT_STACK;
case SVR4_RLIMIT_CORE:
return RLIMIT_CORE;
case SVR4_RLIMIT_NOFILE:
return RLIMIT_NOFILE;
case SVR4_RLIMIT_VMEM:
return RLIMIT_VMEM;
default:
return -1;
}
}
/*
* Check if the resource limit fits within the BSD range and it is not
* one of the magic SVR4 limit values
*/
#define OKLIMIT(l) (((int32_t)(l)) >= 0 && ((int32_t)(l)) < 0x7fffffff && \
((svr4_rlim_t)(l)) != SVR4_RLIM_INFINITY && \
((svr4_rlim_t)(l)) != SVR4_RLIM_SAVED_CUR && \
((svr4_rlim_t)(l)) != SVR4_RLIM_SAVED_MAX)
#define OKLIMIT64(l) (((rlim_t)(l)) >= 0 && ((rlim_t)(l)) < RLIM_INFINITY && \
((svr4_rlim64_t)(l)) != SVR4_RLIM64_INFINITY && \
((svr4_rlim64_t)(l)) != SVR4_RLIM64_SAVED_CUR && \
((svr4_rlim64_t)(l)) != SVR4_RLIM64_SAVED_MAX)
int
svr4_sys_getrlimit(td, uap)
struct thread *td;
struct svr4_sys_getrlimit_args *uap;
{
int rl = svr4_to_native_rl(uap->which);
struct rlimit blim;
struct svr4_rlimit slim;
if (rl == -1)
return EINVAL;
lim_rlimit(td, rl, &blim);
/*
* Our infinity, is their maxfiles.
*/
if (rl == RLIMIT_NOFILE && blim.rlim_max == RLIM_INFINITY)
blim.rlim_max = maxfiles;
/*
* If the limit can be be represented, it is returned.
* Otherwise, if rlim_cur == rlim_max, return RLIM_SAVED_MAX
* else return RLIM_SAVED_CUR
*/
if (blim.rlim_max == RLIM_INFINITY)
slim.rlim_max = SVR4_RLIM_INFINITY;
else if (OKLIMIT(blim.rlim_max))
slim.rlim_max = (svr4_rlim_t) blim.rlim_max;
else
slim.rlim_max = SVR4_RLIM_SAVED_MAX;
if (blim.rlim_cur == RLIM_INFINITY)
slim.rlim_cur = SVR4_RLIM_INFINITY;
else if (OKLIMIT(blim.rlim_cur))
slim.rlim_cur = (svr4_rlim_t) blim.rlim_cur;
else if (blim.rlim_max == blim.rlim_cur)
slim.rlim_cur = SVR4_RLIM_SAVED_MAX;
else
slim.rlim_cur = SVR4_RLIM_SAVED_CUR;
return copyout(&slim, uap->rlp, sizeof(*uap->rlp));
}
int
svr4_sys_setrlimit(td, uap)
struct thread *td;
struct svr4_sys_setrlimit_args *uap;
{
int rl = svr4_to_native_rl(uap->which);
struct rlimit blim, curlim;
struct svr4_rlimit slim;
int error;
if (rl == -1)
return EINVAL;
if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0)
return error;
lim_rlimit(td, rl, &curlim);
/*
* if the limit is SVR4_RLIM_INFINITY, then we set it to our
* unlimited.
* We should also: If it is SVR4_RLIM_SAVED_MAX, we should set the
* new limit to the corresponding saved hard limit, and if
* it is equal to SVR4_RLIM_SAVED_CUR, we should set it to the
* corresponding saved soft limit.
*
*/
if (slim.rlim_max == SVR4_RLIM_INFINITY)
blim.rlim_max = RLIM_INFINITY;
else if (OKLIMIT(slim.rlim_max))
blim.rlim_max = (rlim_t) slim.rlim_max;
else if (slim.rlim_max == SVR4_RLIM_SAVED_MAX)
blim.rlim_max = curlim.rlim_max;
else if (slim.rlim_max == SVR4_RLIM_SAVED_CUR)
blim.rlim_max = curlim.rlim_cur;
if (slim.rlim_cur == SVR4_RLIM_INFINITY)
blim.rlim_cur = RLIM_INFINITY;
else if (OKLIMIT(slim.rlim_cur))
blim.rlim_cur = (rlim_t) slim.rlim_cur;
else if (slim.rlim_cur == SVR4_RLIM_SAVED_MAX)
blim.rlim_cur = curlim.rlim_max;
else if (slim.rlim_cur == SVR4_RLIM_SAVED_CUR)
blim.rlim_cur = curlim.rlim_cur;
return (kern_setrlimit(td, rl, &blim));
}
int
svr4_sys_getrlimit64(td, uap)
struct thread *td;
struct svr4_sys_getrlimit64_args *uap;
{
int rl = svr4_to_native_rl(uap->which);
struct rlimit blim;
struct svr4_rlimit64 slim;
if (rl == -1)
return EINVAL;
lim_rlimit(td, rl, &blim);
/*
* Our infinity, is their maxfiles.
*/
if (rl == RLIMIT_NOFILE && blim.rlim_max == RLIM_INFINITY)
blim.rlim_max = maxfiles;
/*
* If the limit can be be represented, it is returned.
* Otherwise, if rlim_cur == rlim_max, return SVR4_RLIM_SAVED_MAX
* else return SVR4_RLIM_SAVED_CUR
*/
if (blim.rlim_max == RLIM_INFINITY)
slim.rlim_max = SVR4_RLIM64_INFINITY;
else if (OKLIMIT64(blim.rlim_max))
slim.rlim_max = (svr4_rlim64_t) blim.rlim_max;
else
slim.rlim_max = SVR4_RLIM64_SAVED_MAX;
if (blim.rlim_cur == RLIM_INFINITY)
slim.rlim_cur = SVR4_RLIM64_INFINITY;
else if (OKLIMIT64(blim.rlim_cur))
slim.rlim_cur = (svr4_rlim64_t) blim.rlim_cur;
else if (blim.rlim_max == blim.rlim_cur)
slim.rlim_cur = SVR4_RLIM64_SAVED_MAX;
else
slim.rlim_cur = SVR4_RLIM64_SAVED_CUR;
return copyout(&slim, uap->rlp, sizeof(*uap->rlp));
}
int
svr4_sys_setrlimit64(td, uap)
struct thread *td;
struct svr4_sys_setrlimit64_args *uap;
{
int rl = svr4_to_native_rl(uap->which);
struct rlimit blim, curlim;
struct svr4_rlimit64 slim;
int error;
if (rl == -1)
return EINVAL;
if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0)
return error;
lim_rlimit(td, rl, &curlim);
/*
* if the limit is SVR4_RLIM64_INFINITY, then we set it to our
* unlimited.
* We should also: If it is SVR4_RLIM64_SAVED_MAX, we should set the
* new limit to the corresponding saved hard limit, and if
* it is equal to SVR4_RLIM64_SAVED_CUR, we should set it to the
* corresponding saved soft limit.
*
*/
if (slim.rlim_max == SVR4_RLIM64_INFINITY)
blim.rlim_max = RLIM_INFINITY;
else if (OKLIMIT64(slim.rlim_max))
blim.rlim_max = (rlim_t) slim.rlim_max;
else if (slim.rlim_max == SVR4_RLIM64_SAVED_MAX)
blim.rlim_max = curlim.rlim_max;
else if (slim.rlim_max == SVR4_RLIM64_SAVED_CUR)
blim.rlim_max = curlim.rlim_cur;
if (slim.rlim_cur == SVR4_RLIM64_INFINITY)
blim.rlim_cur = RLIM_INFINITY;
else if (OKLIMIT64(slim.rlim_cur))
blim.rlim_cur = (rlim_t) slim.rlim_cur;
else if (slim.rlim_cur == SVR4_RLIM64_SAVED_MAX)
blim.rlim_cur = curlim.rlim_max;
else if (slim.rlim_cur == SVR4_RLIM64_SAVED_CUR)
blim.rlim_cur = curlim.rlim_cur;
return (kern_setrlimit(td, rl, &blim));
}

View File

@ -1,102 +0,0 @@
/* Derived from:
* $NetBSD: svr4_resource.h,v 1.1 1998/11/28 21:53:02 christos Exp $ */
/*-
* Original copyright:
*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* 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.
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 FOUNDATION OR CONTRIBUTORS
* 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$
*/
/*-
* Portions of this code derived from software contributed to the
* FreeBSD Project by Mark Newton.
*
* Copyright (c) 1999 Mark Newton
* 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.
* 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.
*/
#ifndef _SVR4_RESOURCE_H_
#define _SVR4_RESOURCE_H_
#define SVR4_RLIMIT_CPU 0
#define SVR4_RLIMIT_FSIZE 1
#define SVR4_RLIMIT_DATA 2
#define SVR4_RLIMIT_STACK 3
#define SVR4_RLIMIT_CORE 4
#define SVR4_RLIMIT_NOFILE 5
#define SVR4_RLIMIT_VMEM 6
#define SVR4_RLIMIT_AS SVR4_RLIMIT_VMEM
#define SVR4_RLIM_NLIMITS 7
typedef u_int32_t svr4_rlim_t;
#define SVR4_RLIM_SAVED_CUR 0x7ffffffd
#define SVR4_RLIM_SAVED_MAX 0x7ffffffe
#define SVR4_RLIM_INFINITY 0x7fffffff
struct svr4_rlimit {
svr4_rlim_t rlim_cur;
svr4_rlim_t rlim_max;
};
typedef u_int64_t svr4_rlim64_t;
#define SVR4_RLIM64_SAVED_CUR ((svr4_rlim64_t) -1)
#define SVR4_RLIM64_SAVED_MAX ((svr4_rlim64_t) -2)
#define SVR4_RLIM64_INFINITY ((svr4_rlim64_t) -3)
struct svr4_rlimit64 {
svr4_rlim64_t rlim_cur;
svr4_rlim64_t rlim_max;
};
#endif /* !_SVR4_RESOURCE_H_ */

View File

@ -1,111 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_SIGINFO_H_
#define _SVR4_SIGINFO_H_
#define SVR4_ILL_ILLOPC 1
#define SVR4_ILL_ILLOPN 2
#define SVR4_ILL_ILLADR 3
#define SVR4_ILL_ILLTRP 4
#define SVR4_ILL_PRVOPC 5
#define SVR4_ILL_PRVREG 6
#define SVR4_ILL_COPROC 7
#define SVR4_ILL_BADSTK 8
#define SVR4_FPE_INTDIV 1
#define SVR4_FPE_INTOVF 2
#define SVR4_FPE_FLTDIV 3
#define SVR4_FPE_FLTOVF 4
#define SVR4_FPE_FLTUND 5
#define SVR4_FPE_FLTRES 6
#define SVR4_FPE_FLTINV 7
#define SVR4_FPE_FLTSUB 8
#define SVR4_SEGV_MAPERR 1
#define SVR4_SEGV_ACCERR 2
#define SVR4_BUS_ADRALN 1
#define SVR4_BUS_ADRERR 2
#define SVR4_BUS_OBJERR 3
#define SVR4_TRAP_BRKPT 1
#define SVR4_TRAP_TRACE 2
#define SVR4_POLL_IN 1
#define SVR4_POLL_OUT 2
#define SVR4_POLL_MSG 3
#define SVR4_POLL_ERR 4
#define SVR4_POLL_PRI 5
#define SVR4_CLD_EXITED 1
#define SVR4_CLD_KILLED 2
#define SVR4_CLD_DUMPED 3
#define SVR4_CLD_TRAPPED 4
#define SVR4_CLD_STOPPED 5
#define SVR4_CLD_CONTINUED 6
#define SVR4_EMT_TAGOVF 1
typedef union svr4_siginfo {
char si_pad[128]; /* Total size; for future expansion */
struct {
int _signo;
int _code;
int _errno;
union {
struct {
svr4_pid_t _pid;
svr4_clock_t _utime;
int _status;
svr4_clock_t _stime;
} _child;
struct {
caddr_t _addr;
int _trap;
} _fault;
} _reason;
} _info;
} svr4_siginfo_t;
#define svr4_si_signo _info._signo
#define svr4_si_code _info._code
#define svr4_si_errno _info._errno
#define svr4_si_pid _info._reason._child._pid
#define svr4_si_stime _info._reason._child._stime
#define svr4_si_status _info._reason._child._status
#define svr4_si_utime _info._reason._child._utime
#define svr4_si_addr _info._reason._fault._addr
#define svr4_si_trap _info._reason._fault._trap
#endif /* !_SVR4_SIGINFO_H_ */

View File

@ -1,577 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/filedesc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/signal.h>
#include <sys/signalvar.h>
#include <sys/syscallsubr.h>
#include <sys/sysproto.h>
#include <machine/cpu.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_ucontext.h>
#define svr4_sigmask(n) (1 << (((n) - 1) & 31))
#define svr4_sigword(n) (((n) - 1) >> 5)
#define svr4_sigemptyset(s) memset((s), 0, sizeof(*(s)))
#define svr4_sigismember(s, n) ((s)->bits[svr4_sigword(n)] & svr4_sigmask(n))
#define svr4_sigaddset(s, n) ((s)->bits[svr4_sigword(n)] |= svr4_sigmask(n))
void svr4_to_bsd_sigaction(const struct svr4_sigaction *, struct sigaction *);
void bsd_to_svr4_sigaction(const struct sigaction *, struct svr4_sigaction *);
void svr4_sigfillset(svr4_sigset_t *);
int bsd_to_svr4_sig[SVR4_NSIG] = {
0,
SVR4_SIGHUP,
SVR4_SIGINT,
SVR4_SIGQUIT,
SVR4_SIGILL,
SVR4_SIGTRAP,
SVR4_SIGABRT,
SVR4_SIGEMT,
SVR4_SIGFPE,
SVR4_SIGKILL,
SVR4_SIGBUS,
SVR4_SIGSEGV,
SVR4_SIGSYS,
SVR4_SIGPIPE,
SVR4_SIGALRM,
SVR4_SIGTERM,
SVR4_SIGURG,
SVR4_SIGSTOP,
SVR4_SIGTSTP,
SVR4_SIGCONT,
SVR4_SIGCHLD,
SVR4_SIGTTIN,
SVR4_SIGTTOU,
SVR4_SIGIO,
SVR4_SIGXCPU,
SVR4_SIGXFSZ,
SVR4_SIGVTALRM,
SVR4_SIGPROF,
SVR4_SIGWINCH,
0, /* SIGINFO */
SVR4_SIGUSR1,
SVR4_SIGUSR2,
};
int svr4_to_bsd_sig[SVR4_NSIG] = {
0,
SIGHUP,
SIGINT,
SIGQUIT,
SIGILL,
SIGTRAP,
SIGABRT,
SIGEMT,
SIGFPE,
SIGKILL,
SIGBUS,
SIGSEGV,
SIGSYS,
SIGPIPE,
SIGALRM,
SIGTERM,
SIGUSR1,
SIGUSR2,
SIGCHLD,
0, /* XXX NetBSD uses SIGPWR here, but we don't seem to have one */
SIGWINCH,
SIGURG,
SIGIO,
SIGSTOP,
SIGTSTP,
SIGCONT,
SIGTTIN,
SIGTTOU,
SIGVTALRM,
SIGPROF,
SIGXCPU,
SIGXFSZ,
};
void
svr4_sigfillset(s)
svr4_sigset_t *s;
{
int i;
svr4_sigemptyset(s);
for (i = 1; i < SVR4_NSIG; i++)
if (svr4_to_bsd_sig[i] != 0)
svr4_sigaddset(s, i);
}
void
svr4_to_bsd_sigset(sss, bss)
const svr4_sigset_t *sss;
sigset_t *bss;
{
int i, newsig;
SIGEMPTYSET(*bss);
for (i = 1; i < SVR4_NSIG; i++)
if (svr4_sigismember(sss, i)) {
newsig = svr4_to_bsd_sig[i];
if (newsig)
SIGADDSET(*bss, newsig);
}
}
void
bsd_to_svr4_sigset(bss, sss)
const sigset_t *bss;
svr4_sigset_t *sss;
{
int i, newsig;
svr4_sigemptyset(sss);
for (i = 1; i < SVR4_NSIG; i++) {
if (SIGISMEMBER(*bss, i)) {
newsig = bsd_to_svr4_sig[i];
if (newsig)
svr4_sigaddset(sss, newsig);
}
}
}
/*
* XXX: Only a subset of the flags is currently implemented.
*/
void
svr4_to_bsd_sigaction(ssa, bsa)
const struct svr4_sigaction *ssa;
struct sigaction *bsa;
{
bsa->sa_handler = (sig_t) ssa->ssa_handler;
svr4_to_bsd_sigset(&ssa->ssa_mask, &bsa->sa_mask);
bsa->sa_flags = 0;
if ((ssa->ssa_flags & SVR4_SA_ONSTACK) != 0)
bsa->sa_flags |= SA_ONSTACK;
if ((ssa->ssa_flags & SVR4_SA_RESETHAND) != 0)
bsa->sa_flags |= SA_RESETHAND;
if ((ssa->ssa_flags & SVR4_SA_RESTART) != 0)
bsa->sa_flags |= SA_RESTART;
if ((ssa->ssa_flags & SVR4_SA_SIGINFO) != 0)
DPRINTF(("svr4_to_bsd_sigaction: SA_SIGINFO ignored\n"));
if ((ssa->ssa_flags & SVR4_SA_NOCLDSTOP) != 0)
bsa->sa_flags |= SA_NOCLDSTOP;
if ((ssa->ssa_flags & SVR4_SA_NODEFER) != 0)
bsa->sa_flags |= SA_NODEFER;
if ((ssa->ssa_flags & SVR4_SA_NOCLDWAIT) != 0)
bsa->sa_flags |= SA_NOCLDWAIT;
if ((ssa->ssa_flags & ~SVR4_SA_ALLBITS) != 0)
DPRINTF(("svr4_to_bsd_sigaction: extra bits ignored\n"));
}
void
bsd_to_svr4_sigaction(bsa, ssa)
const struct sigaction *bsa;
struct svr4_sigaction *ssa;
{
ssa->ssa_handler = (svr4_sig_t) bsa->sa_handler;
bsd_to_svr4_sigset(&bsa->sa_mask, &ssa->ssa_mask);
ssa->ssa_flags = 0;
if ((bsa->sa_flags & SA_ONSTACK) != 0)
ssa->ssa_flags |= SVR4_SA_ONSTACK;
if ((bsa->sa_flags & SA_RESETHAND) != 0)
ssa->ssa_flags |= SVR4_SA_RESETHAND;
if ((bsa->sa_flags & SA_RESTART) != 0)
ssa->ssa_flags |= SVR4_SA_RESTART;
if ((bsa->sa_flags & SA_NODEFER) != 0)
ssa->ssa_flags |= SVR4_SA_NODEFER;
if ((bsa->sa_flags & SA_NOCLDSTOP) != 0)
ssa->ssa_flags |= SVR4_SA_NOCLDSTOP;
}
void
svr4_to_bsd_sigaltstack(sss, bss)
const struct svr4_sigaltstack *sss;
struct sigaltstack *bss;
{
bss->ss_sp = sss->ss_sp;
bss->ss_size = sss->ss_size;
bss->ss_flags = 0;
if ((sss->ss_flags & SVR4_SS_DISABLE) != 0)
bss->ss_flags |= SS_DISABLE;
if ((sss->ss_flags & SVR4_SS_ONSTACK) != 0)
bss->ss_flags |= SS_ONSTACK;
if ((sss->ss_flags & ~SVR4_SS_ALLBITS) != 0)
/*XXX*/ uprintf("svr4_to_bsd_sigaltstack: extra bits ignored\n");
}
void
bsd_to_svr4_sigaltstack(bss, sss)
const struct sigaltstack *bss;
struct svr4_sigaltstack *sss;
{
sss->ss_sp = bss->ss_sp;
sss->ss_size = bss->ss_size;
sss->ss_flags = 0;
if ((bss->ss_flags & SS_DISABLE) != 0)
sss->ss_flags |= SVR4_SS_DISABLE;
if ((bss->ss_flags & SS_ONSTACK) != 0)
sss->ss_flags |= SVR4_SS_ONSTACK;
}
int
svr4_sys_sigaction(td, uap)
struct thread *td;
struct svr4_sys_sigaction_args *uap;
{
struct svr4_sigaction isa;
struct sigaction nbsa, obsa;
struct sigaction *nbsap;
int error;
if (uap->signum < 0 || uap->signum >= SVR4_NSIG)
return (EINVAL);
DPRINTF(("@@@ svr4_sys_sigaction(%d, %d, %d)\n", td->td_proc->p_pid,
uap->signum,
SVR4_SVR42BSD_SIG(uap->signum)));
if (uap->nsa != NULL) {
if ((error = copyin(uap->nsa, &isa, sizeof(isa))) != 0)
return (error);
svr4_to_bsd_sigaction(&isa, &nbsa);
nbsap = &nbsa;
} else
nbsap = NULL;
#if defined(DEBUG_SVR4)
{
int i;
for (i = 0; i < 4; i++)
DPRINTF(("\tssa_mask[%d] = %lx\n", i,
isa.ssa_mask.bits[i]));
DPRINTF(("\tssa_handler = %p\n", isa.ssa_handler));
}
#endif
error = kern_sigaction(td, SVR4_SVR42BSD_SIG(uap->signum), nbsap, &obsa,
0);
if (error == 0 && uap->osa != NULL) {
bsd_to_svr4_sigaction(&obsa, &isa);
error = copyout(&isa, uap->osa, sizeof(isa));
}
return (error);
}
int
svr4_sys_sigaltstack(td, uap)
struct thread *td;
struct svr4_sys_sigaltstack_args *uap;
{
struct svr4_sigaltstack sss;
struct sigaltstack nbss, obss, *nbssp;
int error;
if (uap->nss != NULL) {
if ((error = copyin(uap->nss, &sss, sizeof(sss))) != 0)
return (error);
svr4_to_bsd_sigaltstack(&sss, &nbss);
nbssp = &nbss;
} else
nbssp = NULL;
error = kern_sigaltstack(td, nbssp, &obss);
if (error == 0 && uap->oss != NULL) {
bsd_to_svr4_sigaltstack(&obss, &sss);
error = copyout(&sss, uap->oss, sizeof(sss));
}
return (error);
}
/*
* Stolen from the ibcs2 one
*/
int
svr4_sys_signal(td, uap)
struct thread *td;
struct svr4_sys_signal_args *uap;
{
struct proc *p;
int signum;
int error;
p = td->td_proc;
DPRINTF(("@@@ svr4_sys_signal(%d)\n", p->p_pid));
signum = SVR4_SIGNO(uap->signum);
if (signum < 0 || signum >= SVR4_NSIG) {
if (SVR4_SIGCALL(uap->signum) == SVR4_SIGNAL_MASK ||
SVR4_SIGCALL(uap->signum) == SVR4_SIGDEFER_MASK)
td->td_retval[0] = (int)SVR4_SIG_ERR;
return (EINVAL);
}
signum = SVR4_SVR42BSD_SIG(signum);
switch (SVR4_SIGCALL(uap->signum)) {
case SVR4_SIGDEFER_MASK:
if (uap->handler == SVR4_SIG_HOLD)
goto sighold;
/* FALLTHROUGH */
case SVR4_SIGNAL_MASK:
{
struct sigaction nbsa, obsa;
nbsa.sa_handler = (sig_t) uap->handler;
SIGEMPTYSET(nbsa.sa_mask);
nbsa.sa_flags = 0;
if (signum != SIGALRM)
nbsa.sa_flags = SA_RESTART;
error = kern_sigaction(td, signum, &nbsa, &obsa, 0);
if (error != 0) {
DPRINTF(("signal: sigaction failed: %d\n",
error));
td->td_retval[0] = (int)SVR4_SIG_ERR;
return (error);
}
td->td_retval[0] = (int)obsa.sa_handler;
return (0);
}
case SVR4_SIGHOLD_MASK:
sighold:
{
sigset_t set;
SIGEMPTYSET(set);
SIGADDSET(set, signum);
return (kern_sigprocmask(td, SIG_BLOCK, &set, NULL, 0));
}
case SVR4_SIGRELSE_MASK:
{
sigset_t set;
SIGEMPTYSET(set);
SIGADDSET(set, signum);
return (kern_sigprocmask(td, SIG_UNBLOCK, &set, NULL,
0));
}
case SVR4_SIGIGNORE_MASK:
{
struct sigaction sa;
sa.sa_handler = SIG_IGN;
SIGEMPTYSET(sa.sa_mask);
sa.sa_flags = 0;
error = kern_sigaction(td, signum, &sa, NULL, 0);
if (error != 0)
DPRINTF(("sigignore: sigaction failed\n"));
return (error);
}
case SVR4_SIGPAUSE_MASK:
{
sigset_t mask;
PROC_LOCK(p);
mask = td->td_sigmask;
PROC_UNLOCK(p);
SIGDELSET(mask, signum);
return kern_sigsuspend(td, mask);
}
default:
return (ENOSYS);
}
}
int
svr4_sys_sigprocmask(td, uap)
struct thread *td;
struct svr4_sys_sigprocmask_args *uap;
{
svr4_sigset_t sss;
sigset_t oss, nss;
sigset_t *nssp;
int error;
if (uap->set != NULL) {
if ((error = copyin(uap->set, &sss, sizeof(sss))) != 0)
return error;
svr4_to_bsd_sigset(&sss, &nss);
nssp = &nss;
} else
nssp = NULL;
/* SVR/4 sigprocmask flag values are the same as the FreeBSD values. */
error = kern_sigprocmask(td, uap->how, nssp, &oss, 0);
if (error == 0 && uap->oset != NULL) {
bsd_to_svr4_sigset(&oss, &sss);
error = copyout(&sss, uap->oset, sizeof(sss));
}
return (error);
}
int
svr4_sys_sigpending(td, uap)
struct thread *td;
struct svr4_sys_sigpending_args *uap;
{
struct proc *p;
sigset_t bss;
svr4_sigset_t sss;
p = td->td_proc;
DPRINTF(("@@@ svr4_sys_sigpending(%d)\n", p->p_pid));
switch (uap->what) {
case 1: /* sigpending */
if (uap->mask == NULL)
return 0;
PROC_LOCK(p);
bss = p->p_siglist;
SIGSETOR(bss, td->td_siglist);
SIGSETAND(bss, td->td_sigmask);
PROC_UNLOCK(p);
bsd_to_svr4_sigset(&bss, &sss);
break;
case 2: /* sigfillset */
svr4_sigfillset(&sss);
#if defined(DEBUG_SVR4)
{
int i;
for (i = 0; i < 4; i++)
DPRINTF(("new sigset[%d] = %lx\n", i, (long)sss.bits[i]));
}
#endif
break;
default:
return EINVAL;
}
return copyout(&sss, uap->mask, sizeof(sss));
}
int
svr4_sys_sigsuspend(td, uap)
struct thread *td;
struct svr4_sys_sigsuspend_args *uap;
{
svr4_sigset_t sss;
sigset_t bss;
int error;
if ((error = copyin(uap->ss, &sss, sizeof(sss))) != 0)
return error;
svr4_to_bsd_sigset(&sss, &bss);
return kern_sigsuspend(td, bss);
}
int
svr4_sys_kill(td, uap)
struct thread *td;
struct svr4_sys_kill_args *uap;
{
struct kill_args ka;
if (uap->signum < 0 || uap->signum >= SVR4_NSIG)
return (EINVAL);
ka.pid = uap->pid;
ka.signum = SVR4_SVR42BSD_SIG(uap->signum);
return sys_kill(td, &ka);
}
int
svr4_sys_context(td, uap)
struct thread *td;
struct svr4_sys_context_args *uap;
{
struct svr4_ucontext uc;
int error, onstack;
switch (uap->func) {
case 0:
DPRINTF(("getcontext(%p)\n", uap->uc));
PROC_LOCK(td->td_proc);
onstack = sigonstack(cpu_getstack(td));
PROC_UNLOCK(td->td_proc);
svr4_getcontext(td, &uc, &td->td_sigmask, onstack);
return copyout(&uc, uap->uc, sizeof(uc));
case 1:
DPRINTF(("setcontext(%p)\n", uap->uc));
if ((error = copyin(uap->uc, &uc, sizeof(uc))) != 0)
return error;
DPRINTF(("uc_flags = %lx\n", uc.uc_flags));
#if defined(DEBUG_SVR4)
{
int i;
for (i = 0; i < 4; i++)
DPRINTF(("uc_sigmask[%d] = %lx\n", i,
uc.uc_sigmask.bits[i]));
}
#endif
return svr4_setcontext(td, &uc);
default:
DPRINTF(("context(%d, %p)\n", uap->func,
uap->uc));
return ENOSYS;
}
return 0;
}
int
svr4_sys_pause(td, uap)
struct thread *td;
struct svr4_sys_pause_args *uap;
{
sigset_t mask;
PROC_LOCK(td->td_proc);
mask = td->td_sigmask;
PROC_UNLOCK(td->td_proc);
return kern_sigsuspend(td, mask);
}

View File

@ -1,144 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_SIGNAL_H_
#define _SVR4_SIGNAL_H_
#include <i386/svr4/svr4_machdep.h>
#include <compat/svr4/svr4_siginfo.h>
#define SVR4_SIGHUP 1
#define SVR4_SIGINT 2
#define SVR4_SIGQUIT 3
#define SVR4_SIGILL 4
#define SVR4_SIGTRAP 5
#define SVR4_SIGIOT 6
#define SVR4_SIGABRT 6
#define SVR4_SIGEMT 7
#define SVR4_SIGFPE 8
#define SVR4_SIGKILL 9
#define SVR4_SIGBUS 10
#define SVR4_SIGSEGV 11
#define SVR4_SIGSYS 12
#define SVR4_SIGPIPE 13
#define SVR4_SIGALRM 14
#define SVR4_SIGTERM 15
#define SVR4_SIGUSR1 16
#define SVR4_SIGUSR2 17
#define SVR4_SIGCLD 18
#define SVR4_SIGCHLD 18
#define SVR4_SIGPWR 19
#define SVR4_SIGWINCH 20
#define SVR4_SIGURG 21
#define SVR4_SIGPOLL 22
#define SVR4_SIGIO 22
#define SVR4_SIGSTOP 23
#define SVR4_SIGTSTP 24
#define SVR4_SIGCONT 25
#define SVR4_SIGTTIN 26
#define SVR4_SIGTTOU 27
#define SVR4_SIGVTALRM 28
#define SVR4_SIGPROF 29
#define SVR4_SIGXCPU 30
#define SVR4_SIGXFSZ 31
#define SVR4_NSIG 32
#define SVR4_SIGNO_MASK 0x00FF
#define SVR4_SIGNAL_MASK 0x0000
#define SVR4_SIGDEFER_MASK 0x0100
#define SVR4_SIGHOLD_MASK 0x0200
#define SVR4_SIGRELSE_MASK 0x0400
#define SVR4_SIGIGNORE_MASK 0x0800
#define SVR4_SIGPAUSE_MASK 0x1000
typedef void (*svr4_sig_t)(int, svr4_siginfo_t *, void *);
#define SVR4_SIG_DFL (svr4_sig_t) 0
#define SVR4_SIG_ERR (svr4_sig_t) -1
#define SVR4_SIG_IGN (svr4_sig_t) 1
#define SVR4_SIG_HOLD (svr4_sig_t) 2
#define SVR4_SIGNO(a) ((a) & SVR4_SIGNO_MASK)
#define SVR4_SIGCALL(a) ((a) & ~SVR4_SIGNO_MASK)
#define SVR4_SIG_BLOCK 1
#define SVR4_SIG_UNBLOCK 2
#define SVR4_SIG_SETMASK 3
extern int bsd_to_svr4_sig[SVR4_NSIG];
extern int svr4_to_bsd_sig[SVR4_NSIG];
#define SVR4_BSD2SVR4_SIG(sig) \
(((sig) < SVR4_NSIG) ? bsd_to_svr4_sig[sig] : sig)
#define SVR4_SVR42BSD_SIG(sig) \
(((sig) < SVR4_NSIG) ? svr4_to_bsd_sig[sig] : sig)
typedef struct {
u_long bits[4];
} svr4_sigset_t;
struct svr4_sigaction {
int ssa_flags;
svr4_sig_t ssa_handler;
svr4_sigset_t ssa_mask;
int ssa_reserved[2];
};
struct svr4_sigaltstack {
char *ss_sp;
int ss_size;
int ss_flags;
};
/* sa_flags */
#define SVR4_SA_ONSTACK 0x00000001
#define SVR4_SA_RESETHAND 0x00000002
#define SVR4_SA_RESTART 0x00000004
#define SVR4_SA_SIGINFO 0x00000008
#define SVR4_SA_NODEFER 0x00000010
#define SVR4_SA_NOCLDWAIT 0x00010000 /* No zombies */
#define SVR4_SA_NOCLDSTOP 0x00020000 /* No jcl */
#define SVR4_SA_ALLBITS 0x0003001f
/* ss_flags */
#define SVR4_SS_ONSTACK 0x00000001
#define SVR4_SS_DISABLE 0x00000002
#define SVR4_SS_ALLBITS 0x00000003
#define SVR4_MINSIGSTKSZ 8192
struct ksiginfo;
void bsd_to_svr4_sigaltstack(const struct sigaltstack *, struct svr4_sigaltstack *);
void bsd_to_svr4_sigset(const sigset_t *, svr4_sigset_t *);
void svr4_to_bsd_sigaltstack(const struct svr4_sigaltstack *, struct sigaltstack *);
void svr4_to_bsd_sigset(const svr4_sigset_t *, sigset_t *);
void svr4_sendsig(sig_t, struct ksiginfo *, sigset_t *);
#endif /* !_SVR4_SIGNAL_H_ */

View File

@ -1,259 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1996 Christos Zoulas.
* 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.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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.
*/
/*
* In SVR4 unix domain sockets are referenced sometimes
* (in putmsg(2) for example) as a [device, inode] pair instead of a pathname.
* Since there is no iname() routine in the kernel, and we need access to
* a mapping from inode to pathname, we keep our own table. This is a simple
* linked list that contains the pathname, the [device, inode] pair, the
* file corresponding to that socket and the process. When the
* socket gets closed we remove the item from the list. The list gets loaded
* every time a stat(2) call finds a socket.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/queue.h>
#include <sys/eventhandler.h>
#include <sys/file.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysproto.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_socket.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_sockmod.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_stropts.h>
struct svr4_sockcache_entry {
struct proc *p; /* Process for the socket */
void *cookie; /* Internal cookie used for matching */
struct sockaddr_un sock;/* Pathname for the socket */
dev_t dev; /* Device where the socket lives on */
ino_t ino; /* Inode where the socket lives on */
TAILQ_ENTRY(svr4_sockcache_entry) entries;
};
static TAILQ_HEAD(, svr4_sockcache_entry) svr4_head;
static struct mtx svr4_sockcache_lock;
static eventhandler_tag svr4_sockcache_exit_tag, svr4_sockcache_exec_tag;
static void svr4_purge_sockcache(void *arg, struct proc *p);
int
svr4_find_socket(td, fp, dev, ino, saun)
struct thread *td;
struct file *fp;
dev_t dev;
ino_t ino;
struct sockaddr_un *saun;
{
struct svr4_sockcache_entry *e;
void *cookie = ((struct socket *)fp->f_data)->so_emuldata;
DPRINTF(("svr4_find_socket: [%p,%ju,%ju]: ", td, (uintmax_t)dev,
(uintmax_t)ino));
mtx_lock(&svr4_sockcache_lock);
TAILQ_FOREACH(e, &svr4_head, entries)
if (e->p == td->td_proc && e->dev == dev && e->ino == ino) {
#ifdef DIAGNOSTIC
if (e->cookie != NULL && e->cookie != cookie)
panic("svr4 socket cookie mismatch");
#endif
e->cookie = cookie;
DPRINTF(("%s\n", e->sock.sun_path));
*saun = e->sock;
mtx_unlock(&svr4_sockcache_lock);
return (0);
}
mtx_unlock(&svr4_sockcache_lock);
DPRINTF(("not found\n"));
return (ENOENT);
}
int
svr4_add_socket(td, path, st)
struct thread *td;
const char *path;
struct stat *st;
{
struct svr4_sockcache_entry *e;
size_t len;
int error;
e = malloc(sizeof(*e), M_TEMP, M_WAITOK);
e->cookie = NULL;
e->dev = st->st_dev;
e->ino = st->st_ino;
e->p = td->td_proc;
if ((error = copyinstr(path, e->sock.sun_path,
sizeof(e->sock.sun_path), &len)) != 0) {
DPRINTF(("svr4_add_socket: copyinstr failed %d\n", error));
free(e, M_TEMP);
return error;
}
e->sock.sun_family = AF_LOCAL;
e->sock.sun_len = len;
mtx_lock(&svr4_sockcache_lock);
TAILQ_INSERT_HEAD(&svr4_head, e, entries);
mtx_unlock(&svr4_sockcache_lock);
DPRINTF(("svr4_add_socket: %s [%p,%ju,%ju]\n", e->sock.sun_path,
td->td_proc, (uintmax_t)e->dev, (uintmax_t)e->ino));
return 0;
}
void
svr4_delete_socket(p, fp)
struct proc *p;
struct file *fp;
{
struct svr4_sockcache_entry *e;
void *cookie = ((struct socket *)fp->f_data)->so_emuldata;
mtx_lock(&svr4_sockcache_lock);
TAILQ_FOREACH(e, &svr4_head, entries)
if (e->p == p && e->cookie == cookie) {
TAILQ_REMOVE(&svr4_head, e, entries);
mtx_unlock(&svr4_sockcache_lock);
DPRINTF(("svr4_delete_socket: %s [%p,%ju,%ju]\n",
e->sock.sun_path, p, (uintmax_t)e->dev,
(uintmax_t)e->ino));
free(e, M_TEMP);
return;
}
mtx_unlock(&svr4_sockcache_lock);
}
struct svr4_strm *
svr4_stream_get(fp)
struct file *fp;
{
struct socket *so;
if (fp == NULL || fp->f_type != DTYPE_SOCKET)
return NULL;
so = fp->f_data;
return so->so_emuldata;
}
void
svr4_purge_sockcache(arg, p)
void *arg;
struct proc *p;
{
struct svr4_sockcache_entry *e, *ne;
mtx_lock(&svr4_sockcache_lock);
TAILQ_FOREACH_SAFE(e, &svr4_head, entries, ne) {
if (e->p == p) {
TAILQ_REMOVE(&svr4_head, e, entries);
DPRINTF(("svr4_purge_sockcache: %s [%p,%ju,%ju]\n",
e->sock.sun_path, p, (uintmax_t)e->dev,
(uintmax_t)e->ino));
free(e, M_TEMP);
}
}
mtx_unlock(&svr4_sockcache_lock);
}
void
svr4_sockcache_init(void)
{
TAILQ_INIT(&svr4_head);
mtx_init(&svr4_sockcache_lock, "svr4 socket cache", NULL, MTX_DEF);
svr4_sockcache_exit_tag = EVENTHANDLER_REGISTER(process_exit,
svr4_purge_sockcache, NULL, EVENTHANDLER_PRI_ANY);
svr4_sockcache_exec_tag = EVENTHANDLER_REGISTER(process_exec,
svr4_purge_sockcache, NULL, EVENTHANDLER_PRI_ANY);
}
void
svr4_sockcache_destroy(void)
{
KASSERT(TAILQ_EMPTY(&svr4_head),
("%s: sockcache entries still around", __func__));
EVENTHANDLER_DEREGISTER(process_exec, svr4_sockcache_exec_tag);
EVENTHANDLER_DEREGISTER(process_exit, svr4_sockcache_exit_tag);
mtx_destroy(&svr4_sockcache_lock);
}
int
svr4_sys_socket(td, uap)
struct thread *td;
struct svr4_sys_socket_args *uap;
{
switch (uap->type) {
case SVR4_SOCK_DGRAM:
uap->type = SOCK_DGRAM;
break;
case SVR4_SOCK_STREAM:
uap->type = SOCK_STREAM;
break;
case SVR4_SOCK_RAW:
uap->type = SOCK_RAW;
break;
case SVR4_SOCK_RDM:
uap->type = SOCK_RDM;
break;
case SVR4_SOCK_SEQPACKET:
uap->type = SOCK_SEQPACKET;
break;
default:
return EINVAL;
}
return sys_socket(td, (struct socket_args *)uap);
}

View File

@ -1,58 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1996 Christos Zoulas.
* 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.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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 _SVR4_SOCKET_H_
#define _SVR4_SOCKET_H_
#include <netinet/in.h>
struct sockaddr_un;
struct proc;
struct thread;
struct file;
struct svr4_sockaddr_in {
u_char sin_family;
u_short sin_port;
struct in_addr sin_addr;
u_char sin_zero[8];
};
int svr4_add_socket(struct thread *, const char *, struct stat *);
void svr4_delete_socket(struct proc *, struct file *);
int svr4_find_socket(struct thread *, struct file *, dev_t, ino_t,
struct sockaddr_un *);
void svr4_sockcache_init(void);
void svr4_sockcache_destroy(void);
#endif /* _SVR4_SOCKET_H_ */

View File

@ -1,171 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1995 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/sockio.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/vnet.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_ioctl.h>
#include <compat/svr4/svr4_sockio.h>
static int bsd_to_svr4_flags(int);
#define bsd_to_svr4_flag(a) \
if (bf & __CONCAT(I,a)) sf |= __CONCAT(SVR4_I,a)
static int
bsd_to_svr4_flags(bf)
int bf;
{
int sf = 0;
bsd_to_svr4_flag(FF_UP);
bsd_to_svr4_flag(FF_BROADCAST);
bsd_to_svr4_flag(FF_DEBUG);
bsd_to_svr4_flag(FF_LOOPBACK);
bsd_to_svr4_flag(FF_POINTOPOINT);
#if defined(IFF_NOTRAILERS)
bsd_to_svr4_flag(FF_NOTRAILERS);
#endif
if (bf & IFF_DRV_RUNNING)
sf |= SVR4_IFF_RUNNING;
bsd_to_svr4_flag(FF_NOARP);
bsd_to_svr4_flag(FF_PROMISC);
bsd_to_svr4_flag(FF_ALLMULTI);
bsd_to_svr4_flag(FF_MULTICAST);
return sf;
}
#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf)
int
svr4_sock_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
struct thread *td;
register_t *retval;
int fd;
u_long cmd;
caddr_t data;
{
int error;
*retval = 0;
switch (cmd) {
case SVR4_SIOCGIFNUM:
{
struct ifnet *ifp;
struct ifaddr *ifa;
int ifnum = 0;
/*
* This does not return the number of physical
* interfaces (if_index), but the number of interfaces
* + addresses like ifconf() does, because this number
* is used by code that will call SVR4_SIOCGIFCONF to
* find the space needed for SVR4_SIOCGIFCONF. So we
* count the number of ifreq entries that the next
* SVR4_SIOCGIFCONF will return. Maybe a more correct
* fix is to make SVR4_SIOCGIFCONF return only one
* entry per physical interface?
*/
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link)
if (TAILQ_EMPTY(&ifp->if_addrhead))
ifnum++;
else
TAILQ_FOREACH(ifa, &ifp->if_addrhead,
ifa_link)
ifnum++;
IFNET_RUNLOCK();
DPRINTF(("SIOCGIFNUM %d\n", ifnum));
return copyout(&ifnum, data, sizeof(ifnum));
}
case SVR4_SIOCGIFFLAGS:
{
struct ifreq br;
struct svr4_ifreq sr;
if ((error = copyin(data, &sr, sizeof(sr))) != 0)
return error;
(void) strlcpy(br.ifr_name, sr.svr4_ifr_name,
sizeof(br.ifr_name));
if ((error = fo_ioctl(fp, SIOCGIFFLAGS,
(caddr_t) &br, td->td_ucred,
td)) != 0) {
DPRINTF(("SIOCGIFFLAGS (%s) %s: error %d\n",
br.ifr_name, sr.svr4_ifr_name, error));
return error;
}
sr.svr4_ifr_flags = bsd_to_svr4_flags(br.ifr_flags);
DPRINTF(("SIOCGIFFLAGS %s = %x\n",
sr.svr4_ifr_name, sr.svr4_ifr_flags));
return copyout(&sr, data, sizeof(sr));
}
case SVR4_SIOCGIFCONF:
{
struct svr4_ifconf sc;
if ((error = copyin(data, &sc, sizeof(sc))) != 0)
return error;
DPRINTF(("ifreq %d svr4_ifreq %d ifc_len %d\n",
sizeof(struct ifreq), sizeof(struct svr4_ifreq),
sc.svr4_ifc_len));
if ((error = fo_ioctl(fp, OSIOCGIFCONF,
(caddr_t) &sc, td->td_ucred,
td)) != 0)
return error;
DPRINTF(("SIOCGIFCONF\n"));
return 0;
}
default:
DPRINTF(("Unknown svr4 sockio %lx\n", cmd));
return 0; /* ENOSYS really */
}
}

View File

@ -1,93 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1995 Christos Zoulas
* 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.
* 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 _SVR4_SOCKIO_H_
#define _SVR4_SOCKIO_H_
#define SVR4_IFF_UP 0x0001
#define SVR4_IFF_BROADCAST 0x0002
#define SVR4_IFF_DEBUG 0x0004
#define SVR4_IFF_LOOPBACK 0x0008
#define SVR4_IFF_POINTOPOINT 0x0010
#define SVR4_IFF_NOTRAILERS 0x0020
#define SVR4_IFF_RUNNING 0x0040
#define SVR4_IFF_NOARP 0x0080
#define SVR4_IFF_PROMISC 0x0100
#define SVR4_IFF_ALLMULTI 0x0200
#define SVR4_IFF_INTELLIGENT 0x0400
#define SVR4_IFF_MULTICAST 0x0800
#define SVR4_IFF_MULTI_BCAST 0x1000
#define SVR4_IFF_UNNUMBERED 0x2000
#define SVR4_IFF_PRIVATE 0x8000
struct svr4_ifreq {
#define SVR4_IFNAMSIZ 16
char svr4_ifr_name[SVR4_IFNAMSIZ];
union {
struct osockaddr ifru_addr;
struct osockaddr ifru_dstaddr;
struct osockaddr ifru_broadaddr;
short ifru_flags;
int ifru_metric;
char ifru_data;
char ifru_enaddr[6];
int if_muxid[2];
} ifr_ifru;
#define svr4_ifr_addr ifr_ifru.ifru_addr
#define svr4_ifr_dstaddr ifr_ifru.ifru_dstaddr
#define svr4_ifr_broadaddr ifr_ifru.ifru_broadaddr
#define svr4_ifr_flags ifr_ifru.ifru_flags
#define svr4_ifr_metric ifr_ifru.ifru_metric
#define svr4_ifr_data ifr_ifru.ifru_data
#define svr4_ifr_enaddr ifr_ifru.ifru_enaddr
#define svr4_ifr_muxid ifr_ifru.ifru_muxid
};
struct svr4_ifconf {
int svr4_ifc_len;
union {
caddr_t ifcu_buf;
struct svr4_ifreq *ifcu_req;
} ifc_ifcu;
#define svr4_ifc_buf ifc_ifcu.ifcu_buf
#define svr4_ifc_req ifc_ifcu.ifcu_req
};
#define SVR4_SIOC ('i' << 8)
#define SVR4_SIOCGIFFLAGS SVR4_IOWR('i', 17, struct svr4_ifreq)
#define SVR4_SIOCGIFCONF SVR4_IOWR('i', 20, struct svr4_ifconf)
#define SVR4_SIOCGIFNUM SVR4_IOR('i', 87, int)
#endif /* !_SVR4_SOCKIO_H_ */

View File

@ -1,83 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_SOCKMOD_H_
#define _SVR4_SOCKMOD_H_
#define SVR4_SIMOD ('I' << 8)
#define SVR4_SI_OGETUDATA (SVR4_SIMOD|101)
#define SVR4_SI_SHUTDOWN (SVR4_SIMOD|102)
#define SVR4_SI_LISTEN (SVR4_SIMOD|103)
#define SVR4_SI_SETMYNAME (SVR4_SIMOD|104)
#define SVR4_SI_SETPEERNAME (SVR4_SIMOD|105)
#define SVR4_SI_GETINTRANSIT (SVR4_SIMOD|106)
#define SVR4_SI_TCL_LINK (SVR4_SIMOD|107)
#define SVR4_SI_TCL_UNLINK (SVR4_SIMOD|108)
#define SVR4_SI_SOCKPARAMS (SVR4_SIMOD|109)
#define SVR4_SI_GETUDATA (SVR4_SIMOD|110)
#define SVR4_SOCK_DGRAM 1
#define SVR4_SOCK_STREAM 2
#define SVR4_SOCK_STREAM_ORD 3
#define SVR4_SOCK_RAW 4
#define SVR4_SOCK_RDM 5
#define SVR4_SOCK_SEQPACKET 6
struct svr4_si_sockparms {
int family;
int type;
int protocol;
};
struct svr4_si_oudata {
int tidusize;
int addrsize;
int optsize;
int etsdusize;
int servtype;
int so_state;
int so_options;
int tsdusize;
};
struct svr4_si_udata {
int tidusize;
int addrsize;
int optsize;
int etsdusize;
int servtype;
int so_state;
int so_options;
int tsdusize;
struct svr4_si_sockparms sockparms;
};
#endif /* !_SVR4_SOCKMOD_H_ */

View File

@ -1,705 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/filedesc.h>
#include <sys/fcntl.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/namei.h>
#include <sys/unistd.h>
#include <sys/time.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/sysproto.h>
#include <sys/un.h>
#include <vm/vm.h>
#include <netinet/in.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_stat.h>
#include <compat/svr4/svr4_ustat.h>
#include <compat/svr4/svr4_utsname.h>
#include <compat/svr4/svr4_systeminfo.h>
#include <compat/svr4/svr4_socket.h>
#include <compat/svr4/svr4_time.h>
#if defined(NOTYET)
#include "svr4_fuser.h"
#endif
#ifdef sparc
/*
* Solaris-2.4 on the sparc has the old stat call using the new
* stat data structure...
*/
# define SVR4_NO_OSTAT
#endif
struct svr4_ustat_args {
svr4_dev_t dev;
struct svr4_ustat * name;
};
static void bsd_to_svr4_xstat(struct stat *, struct svr4_xstat *);
static void bsd_to_svr4_stat64(struct stat *, struct svr4_stat64 *);
int svr4_ustat(struct thread *, struct svr4_ustat_args *);
static int svr4_to_bsd_pathconf(int);
/*
* SVR4 uses named pipes as named sockets, so we tell programs
* that sockets are named pipes with mode 0
*/
#define BSD_TO_SVR4_MODE(mode) (S_ISSOCK(mode) ? S_IFIFO : (mode))
#ifndef SVR4_NO_OSTAT
static void bsd_to_svr4_stat(struct stat *, struct svr4_stat *);
static void
bsd_to_svr4_stat(st, st4)
struct stat *st;
struct svr4_stat *st4;
{
memset(st4, 0, sizeof(*st4));
st4->st_dev = bsd_to_svr4_odev_t(st->st_dev);
st4->st_ino = st->st_ino;
st4->st_mode = BSD_TO_SVR4_MODE(st->st_mode);
st4->st_nlink = st->st_nlink;
st4->st_uid = st->st_uid;
st4->st_gid = st->st_gid;
st4->st_rdev = bsd_to_svr4_odev_t(st->st_rdev);
st4->st_size = st->st_size;
st4->st_atim = st->st_atim.tv_sec;
st4->st_mtim = st->st_mtim.tv_sec;
st4->st_ctim = st->st_ctim.tv_sec;
}
#endif
static void
bsd_to_svr4_xstat(st, st4)
struct stat *st;
struct svr4_xstat *st4;
{
memset(st4, 0, sizeof(*st4));
st4->st_dev = bsd_to_svr4_dev_t(st->st_dev);
st4->st_ino = st->st_ino;
st4->st_mode = BSD_TO_SVR4_MODE(st->st_mode);
st4->st_nlink = st->st_nlink;
st4->st_uid = st->st_uid;
st4->st_gid = st->st_gid;
st4->st_rdev = bsd_to_svr4_dev_t(st->st_rdev);
st4->st_size = st->st_size;
st4->st_atim = st->st_atim;
st4->st_mtim = st->st_mtim;
st4->st_ctim = st->st_ctim;
st4->st_blksize = st->st_blksize;
st4->st_blocks = st->st_blocks;
strcpy(st4->st_fstype, "unknown");
}
static void
bsd_to_svr4_stat64(st, st4)
struct stat *st;
struct svr4_stat64 *st4;
{
memset(st4, 0, sizeof(*st4));
st4->st_dev = bsd_to_svr4_dev_t(st->st_dev);
st4->st_ino = st->st_ino;
st4->st_mode = BSD_TO_SVR4_MODE(st->st_mode);
st4->st_nlink = st->st_nlink;
st4->st_uid = st->st_uid;
st4->st_gid = st->st_gid;
st4->st_rdev = bsd_to_svr4_dev_t(st->st_rdev);
st4->st_size = st->st_size;
st4->st_atim = st->st_atim;
st4->st_mtim = st->st_mtim;
st4->st_ctim = st->st_ctim;
st4->st_blksize = st->st_blksize;
st4->st_blocks = st->st_blocks;
strcpy(st4->st_fstype, "unknown");
}
int
svr4_sys_stat(td, uap)
struct thread *td;
struct svr4_sys_stat_args *uap;
{
struct svr4_stat svr4_st;
struct stat st;
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, NULL);
free(path, M_TEMP);
if (error)
return (error);
bsd_to_svr4_stat(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
(void) svr4_add_socket(td, uap->path, &st);
return (copyout(&svr4_st, uap->ub, sizeof svr4_st));
}
int
svr4_sys_lstat(td, uap)
struct thread *td;
struct svr4_sys_lstat_args *uap;
{
struct svr4_stat svr4_st;
struct stat st;
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path,
UIO_SYSSPACE, &st, NULL);
free(path, M_TEMP);
if (error)
return (error);
bsd_to_svr4_stat(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
(void) svr4_add_socket(td, uap->path, &st);
return (copyout(&svr4_st, uap->ub, sizeof svr4_st));
}
int
svr4_sys_fstat(td, uap)
struct thread *td;
struct svr4_sys_fstat_args *uap;
{
struct svr4_stat svr4_st;
struct stat st;
int error;
error = kern_fstat(td, uap->fd, &st);
if (error)
return (error);
bsd_to_svr4_stat(&st, &svr4_st);
return (copyout(&svr4_st, uap->sb, sizeof svr4_st));
}
int
svr4_sys_xstat(td, uap)
struct thread *td;
struct svr4_sys_xstat_args *uap;
{
struct svr4_xstat svr4_st;
struct stat st;
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, NULL);
free(path, M_TEMP);
if (error)
return (error);
bsd_to_svr4_xstat(&st, &svr4_st);
#if defined(SOCKET_NOTYET)
if (S_ISSOCK(st.st_mode))
(void) svr4_add_socket(td, uap->path, &st);
#endif
return (copyout(&svr4_st, uap->ub, sizeof svr4_st));
}
int
svr4_sys_lxstat(td, uap)
struct thread *td;
struct svr4_sys_lxstat_args *uap;
{
struct svr4_xstat svr4_st;
struct stat st;
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path,
UIO_SYSSPACE, &st, NULL);
free(path, M_TEMP);
if (error)
return (error);
bsd_to_svr4_xstat(&st, &svr4_st);
#if defined(SOCKET_NOTYET)
if (S_ISSOCK(st.st_mode))
(void) svr4_add_socket(td, uap->path, &st);
#endif
return (copyout(&svr4_st, uap->ub, sizeof svr4_st));
}
int
svr4_sys_fxstat(td, uap)
struct thread *td;
struct svr4_sys_fxstat_args *uap;
{
struct svr4_xstat svr4_st;
struct stat st;
int error;
error = kern_fstat(td, uap->fd, &st);
if (error)
return (error);
bsd_to_svr4_xstat(&st, &svr4_st);
return (copyout(&svr4_st, uap->sb, sizeof svr4_st));
}
int
svr4_sys_stat64(td, uap)
struct thread *td;
struct svr4_sys_stat64_args *uap;
{
struct svr4_stat64 svr4_st;
struct stat st;
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, NULL);
free(path, M_TEMP);
if (error)
return (error);
bsd_to_svr4_stat64(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
(void) svr4_add_socket(td, uap->path, &st);
return (copyout(&svr4_st, uap->sb, sizeof svr4_st));
}
int
svr4_sys_lstat64(td, uap)
struct thread *td;
struct svr4_sys_lstat64_args *uap;
{
struct svr4_stat64 svr4_st;
struct stat st;
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path,
UIO_SYSSPACE, &st, NULL);
free(path, M_TEMP);
if (error)
return (error);
bsd_to_svr4_stat64(&st, &svr4_st);
if (S_ISSOCK(st.st_mode))
(void) svr4_add_socket(td, uap->path, &st);
return (copyout(&svr4_st, uap->sb, sizeof svr4_st));
}
int
svr4_sys_fstat64(td, uap)
struct thread *td;
struct svr4_sys_fstat64_args *uap;
{
struct svr4_stat64 svr4_st;
struct stat st;
int error;
error = kern_fstat(td, uap->fd, &st);
if (error)
return (error);
bsd_to_svr4_stat64(&st, &svr4_st);
return (copyout(&svr4_st, uap->sb, sizeof svr4_st));
}
int
svr4_ustat(td, uap)
struct thread *td;
struct svr4_ustat_args *uap;
{
struct svr4_ustat us;
int error;
memset(&us, 0, sizeof us);
/*
* XXX: should set f_tfree and f_tinode at least
* How do we translate dev -> fstat? (and then to svr4_ustat)
*/
if ((error = copyout(&us, uap->name, sizeof us)) != 0)
return (error);
return 0;
}
/*extern char ostype[], osrelease[], version[], machine[];*/
int
svr4_sys_uname(td, uap)
struct thread *td;
struct svr4_sys_uname_args *uap;
{
struct svr4_utsname sut;
memset(&sut, 0, sizeof(sut));
strlcpy(sut.sysname, ostype, sizeof(sut.sysname));
getcredhostname(td->td_ucred, sut.nodename, sizeof(sut.nodename));
strlcpy(sut.release, osrelease, sizeof(sut.release));
strlcpy(sut.version, version, sizeof(sut.version));
strlcpy(sut.machine, machine, sizeof(sut.machine));
return copyout((caddr_t) &sut, (caddr_t) uap->name,
sizeof(struct svr4_utsname));
}
int
svr4_sys_systeminfo(td, uap)
struct thread *td;
struct svr4_sys_systeminfo_args *uap;
{
char *str = NULL;
int error = 0;
register_t *retval = td->td_retval;
u_long hostid;
size_t len = 0;
char buf[MAXHOSTNAMELEN];
u_int rlen = uap->len;
switch (uap->what) {
case SVR4_SI_SYSNAME:
str = ostype;
break;
case SVR4_SI_HOSTNAME:
getcredhostname(td->td_ucred, buf, sizeof(buf));
str = buf;
break;
case SVR4_SI_RELEASE:
str = osrelease;
break;
case SVR4_SI_VERSION:
str = version;
break;
case SVR4_SI_MACHINE:
str = machine;
break;
case SVR4_SI_ARCHITECTURE:
str = machine;
break;
case SVR4_SI_ISALIST:
#if defined(__sparc__)
str = "sparcv9 sparcv9-fsmuld sparcv8 sparcv8-fsmuld sparcv7 sparc";
#elif defined(__i386__)
str = "i386";
#elif defined(__amd64__)
str = "amd64";
#else
str = "unknown";
#endif
break;
case SVR4_SI_HW_SERIAL:
getcredhostid(td->td_ucred, &hostid);
snprintf(buf, sizeof(buf), "%lu", hostid);
str = buf;
break;
case SVR4_SI_HW_PROVIDER:
str = ostype;
break;
case SVR4_SI_SRPC_DOMAIN:
getcreddomainname(td->td_ucred, buf, sizeof(buf));
str = buf;
break;
case SVR4_SI_PLATFORM:
#if defined(__i386__)
str = "i86pc";
#else
str = "unknown";
#endif
break;
case SVR4_SI_KERB_REALM:
str = "unsupported";
break;
#if defined(WHY_DOES_AN_EMULATOR_WANT_TO_SET_HOSTNAMES)
case SVR4_SI_SET_HOSTNAME:
name = KERN_HOSTNAME;
return kern_sysctl(&name, 1, 0, 0, uap->buf, rlen, td);
case SVR4_SI_SET_SRPC_DOMAIN:
name = KERN_NISDOMAINNAME;
return kern_sysctl(&name, 1, 0, 0, uap->buf, rlen, td);
#else
case SVR4_SI_SET_HOSTNAME:
case SVR4_SI_SET_SRPC_DOMAIN:
/* FALLTHROUGH */
#endif
case SVR4_SI_SET_KERB_REALM:
return 0;
default:
DPRINTF(("Bad systeminfo command %d\n", uap->what));
return ENOSYS;
}
if (str) {
len = strlen(str) + 1;
if (len > rlen)
len = rlen;
if (uap->buf) {
error = copyout(str, uap->buf, len);
if (error)
return error;
/* make sure we are NULL terminated */
buf[0] = '\0';
error = copyout(buf, &(uap->buf[len - 1]), 1);
}
else
error = 0;
}
/* XXX NetBSD has hostname setting stuff here. Why would an emulator
want to do that? */
*retval = len;
return error;
}
int
svr4_sys_utssys(td, uap)
struct thread *td;
struct svr4_sys_utssys_args *uap;
{
switch (uap->sel) {
case 0: /* uname(2) */
{
struct svr4_sys_uname_args ua;
ua.name = uap->a1;
return svr4_sys_uname(td, &ua);
}
case 2: /* ustat(2) */
{
struct svr4_ustat_args ua;
ua.dev = (svr4_dev_t) uap->a2;
ua.name = uap->a1;
return svr4_ustat(td, &ua);
}
case 3: /* fusers(2) */
return ENOSYS;
default:
return ENOSYS;
}
return ENOSYS;
}
int
svr4_sys_utime(td, uap)
struct thread *td;
struct svr4_sys_utime_args *uap;
{
struct svr4_utimbuf ub;
struct timeval tbuf[2], *tp;
char *path;
int error;
if (uap->ubuf != NULL) {
error = copyin(uap->ubuf, &ub, sizeof(ub));
if (error)
return (error);
tbuf[0].tv_sec = ub.actime;
tbuf[0].tv_usec = 0;
tbuf[1].tv_sec = ub.modtime;
tbuf[1].tv_usec = 0;
tp = tbuf;
} else
tp = NULL;
CHECKALTEXIST(td, uap->path, &path);
error = kern_utimesat(td, AT_FDCWD, path, UIO_SYSSPACE,
tp, UIO_SYSSPACE);
free(path, M_TEMP);
return (error);
}
int
svr4_sys_utimes(td, uap)
struct thread *td;
struct svr4_sys_utimes_args *uap;
{
char *path;
int error;
CHECKALTEXIST(td, uap->path, &path);
error = kern_utimesat(td, AT_FDCWD, path, UIO_SYSSPACE,
uap->tptr, UIO_USERSPACE);
free(path, M_TEMP);
return (error);
}
static int
svr4_to_bsd_pathconf(name)
int name;
{
switch (name) {
case SVR4_PC_LINK_MAX:
return _PC_LINK_MAX;
case SVR4_PC_MAX_CANON:
return _PC_MAX_CANON;
case SVR4_PC_MAX_INPUT:
return _PC_MAX_INPUT;
case SVR4_PC_NAME_MAX:
return _PC_NAME_MAX;
case SVR4_PC_PATH_MAX:
return _PC_PATH_MAX;
case SVR4_PC_PIPE_BUF:
return _PC_PIPE_BUF;
case SVR4_PC_NO_TRUNC:
return _PC_NO_TRUNC;
case SVR4_PC_VDISABLE:
return _PC_VDISABLE;
case SVR4_PC_CHOWN_RESTRICTED:
return _PC_CHOWN_RESTRICTED;
case SVR4_PC_SYNC_IO:
#if defined(_PC_SYNC_IO)
return _PC_SYNC_IO;
#else
return 0;
#endif
case SVR4_PC_ASYNC_IO:
case SVR4_PC_PRIO_IO:
/* Not supported */
return 0;
default:
/* Invalid */
return -1;
}
}
int
svr4_sys_pathconf(td, uap)
struct thread *td;
struct svr4_sys_pathconf_args *uap;
{
char *path;
int error, name;
name = svr4_to_bsd_pathconf(uap->name);
switch (name) {
case -1:
td->td_retval[0] = -1;
return (EINVAL);
case 0:
td->td_retval[0] = 0;
return (0);
default:
CHECKALTEXIST(td, uap->path, &path);
error = kern_pathconf(td, path, UIO_SYSSPACE, name, FOLLOW);
free(path, M_TEMP);
return (error);
}
}
int
svr4_sys_fpathconf(td, uap)
struct thread *td;
struct svr4_sys_fpathconf_args *uap;
{
register_t *retval = td->td_retval;
uap->name = svr4_to_bsd_pathconf(uap->name);
switch (uap->name) {
case -1:
*retval = -1;
return EINVAL;
case 0:
*retval = 0;
return 0;
default:
return sys_fpathconf(td, (struct fpathconf_args *)uap);
}
}

View File

@ -1,105 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_STAT_H_
#define _SVR4_STAT_H_
#include <compat/svr4/svr4_types.h>
#include <sys/stat.h>
struct svr4_stat {
svr4_o_dev_t st_dev;
svr4_o_ino_t st_ino;
svr4_o_mode_t st_mode;
svr4_o_nlink_t st_nlink;
svr4_o_uid_t st_uid;
svr4_o_gid_t st_gid;
svr4_o_dev_t st_rdev;
svr4_off_t st_size;
svr4_time_t st_atim;
svr4_time_t st_mtim;
svr4_time_t st_ctim;
};
struct svr4_xstat {
svr4_dev_t st_dev;
long st_pad1[3];
svr4_ino_t st_ino;
svr4_mode_t st_mode;
svr4_nlink_t st_nlink;
svr4_uid_t st_uid;
svr4_gid_t st_gid;
svr4_dev_t st_rdev;
long st_pad2[2];
svr4_off_t st_size;
long st_pad3;
svr4_timestruc_t st_atim;
svr4_timestruc_t st_mtim;
svr4_timestruc_t st_ctim;
long st_blksize;
svr4_blkcnt_t st_blocks;
char st_fstype[16];
long st_pad4[8];
};
struct svr4_stat64 {
svr4_dev_t st_dev;
long st_pad1[3];
svr4_ino64_t st_ino;
svr4_mode_t st_mode;
svr4_nlink_t st_nlink;
svr4_uid_t st_uid;
svr4_gid_t st_gid;
svr4_dev_t st_rdev;
long st_pad2[2];
svr4_off64_t st_size;
svr4_timestruc_t st_atim;
svr4_timestruc_t st_mtim;
svr4_timestruc_t st_ctim;
long st_blksize;
svr4_blkcnt64_t st_blocks;
char st_fstype[16];
long st_pad4[8];
};
#define SVR4_PC_LINK_MAX 1
#define SVR4_PC_MAX_CANON 2
#define SVR4_PC_MAX_INPUT 3
#define SVR4_PC_NAME_MAX 4
#define SVR4_PC_PATH_MAX 5
#define SVR4_PC_PIPE_BUF 6
#define SVR4_PC_NO_TRUNC 7
#define SVR4_PC_VDISABLE 8
#define SVR4_PC_CHOWN_RESTRICTED 9
#define SVR4_PC_ASYNC_IO 10
#define SVR4_PC_PRIO_IO 11
#define SVR4_PC_SYNC_IO 12
#endif /* !_SVR4_STAT_H_ */

View File

@ -1,72 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_STATVFS_H_
#define _SVR4_STATVFS_H_
typedef struct svr4_statvfs {
u_long f_bsize;
u_long f_frsize;
svr4_fsblkcnt_t f_blocks;
svr4_fsblkcnt_t f_bfree;
svr4_fsblkcnt_t f_bavail;
svr4_fsblkcnt_t f_files;
svr4_fsblkcnt_t f_ffree;
svr4_fsblkcnt_t f_favail;
u_long f_fsid;
char f_basetype[16];
u_long f_flag;
u_long f_namemax;
char f_fstr[32];
u_long f_filler[16];
} svr4_statvfs_t;
typedef struct svr4_statvfs64 {
u_long f_bsize;
u_long f_frsize;
svr4_fsblkcnt64_t f_blocks;
svr4_fsblkcnt64_t f_bfree;
svr4_fsblkcnt64_t f_bavail;
svr4_fsblkcnt64_t f_files;
svr4_fsblkcnt64_t f_ffree;
svr4_fsblkcnt64_t f_favail;
u_long f_fsid;
char f_basetype[16];
u_long f_flag;
u_long f_namemax;
char f_fstr[32];
u_long f_filler[16];
} svr4_statvfs64_t;
#define SVR4_ST_RDONLY 0x01
#define SVR4_ST_NOSUID 0x02
#define SVR4_ST_NOTRUNC 0x04
#endif /* !_SVR4_STATVFS_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,179 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_STROPTS_H_
#define _SVR4_STROPTS_H_
struct svr4_strbuf {
int maxlen;
int len;
char *buf;
};
#define SVR4_STR ('S' << 8)
#define SVR4_I_NREAD (SVR4_STR| 1)
#define SVR4_I_PUSH (SVR4_STR| 2)
#define SVR4_I_POP (SVR4_STR| 3)
#define SVR4_I_LOOK (SVR4_STR| 4)
#define SVR4_I_FLUSH (SVR4_STR| 5)
#define SVR4_I_SRDOPT (SVR4_STR| 6)
#define SVR4_I_GRDOPT (SVR4_STR| 7)
#define SVR4_I_STR (SVR4_STR| 8)
#define SVR4_I_SETSIG (SVR4_STR| 9)
#define SVR4_I_GETSIG (SVR4_STR|10)
#define SVR4_I_FIND (SVR4_STR|11)
#define SVR4_I_LINK (SVR4_STR|12)
#define SVR4_I_UNLINK (SVR4_STR|13)
#define SVR4_I_ERECVFD (SVR4_STR|14)
#define SVR4_I_PEEK (SVR4_STR|15)
#define SVR4_I_FDINSERT (SVR4_STR|16)
#define SVR4_I_SENDFD (SVR4_STR|17)
#define SVR4_I_RECVFD (SVR4_STR|18)
#define SVR4_I_SWROPT (SVR4_STR|19)
#define SVR4_I_GWROPT (SVR4_STR|20)
#define SVR4_I_LIST (SVR4_STR|21)
#define SVR4_I_PLINK (SVR4_STR|22)
#define SVR4_I_PUNLINK (SVR4_STR|23)
#define SVR4_I_SETEV (SVR4_STR|24)
#define SVR4_I_GETEV (SVR4_STR|25)
#define SVR4_I_STREV (SVR4_STR|26)
#define SVR4_I_UNSTREV (SVR4_STR|27)
#define SVR4_I_FLUSHBAND (SVR4_STR|28)
#define SVR4_I_CKBAND (SVR4_STR|29)
#define SVR4_I_GETBAND (SVR4_STR|30)
#define SVR4_I_ATMARK (SVR4_STR|31)
#define SVR4_I_SETCLTIME (SVR4_STR|32)
#define SVR4_I_GETCLTIME (SVR4_STR|33)
#define SVR4_I_CANPUT (SVR4_STR|34)
/*
* The following two ioctls are OS specific and
* undocumented.
*/
#define SVR4__I_BIND_RSVD (SVR4_STR|242)
#define SVR4__I_RELE_RSVD (SVR4_STR|243)
/*
* Service type definitions
*/
#define SVR4_T_COTS 1 /* Connection-orieted */
#define SVR4_T_COTS_ORD 2 /* Local connection-oriented */
#define SVR4_T_CLTS 3 /* Connectionless */
/* Struct passed for SVR4_I_STR */
struct svr4_strioctl {
u_long cmd;
int timeout;
int len;
char *buf;
};
/*
* Bits for I_{G,S}ETSIG
*/
#define SVR4_S_INPUT 0x0001 /* any message on read queue no HIPRI */
#define SVR4_S_HIPRI 0x0002 /* high prio message on read queue */
#define SVR4_S_OUTPUT 0x0004 /* write queue has free space */
#define SVR4_S_MSG 0x0008 /* signal message in read queue head */
#define SVR4_S_ERROR 0x0010 /* error message in read queue head */
#define SVR4_S_HANGUP 0x0020 /* hangup message in read queue head */
#define SVR4_S_RDNORM 0x0040 /* normal message on read queue */
#define SVR4_S_WRNORM S_OUTPUT /* write queue has free space */
#define SVR4_S_RDBAND 0x0080 /* out of band message on read queue */
#define SVR4_S_WRBAND 0x0100 /* write queue has free space for oob */
#define SVR4_S_BANDURG 0x0200 /* generate SIGURG instead of SIGPOLL */
#define SVR4_S_ALLMASK 0x03ff /* all events mask */
/*
* Our internal state for the stream
* For now we keep almost nothing... In the future we can keep more
* streams state.
*
* Locking key:
* r - Read only field only set during creation
* G - Giant
*/
struct svr4_strm {
int s_family; /* (r) socket family */
int s_cmd; /* (G) last getmsg reply or putmsg request */
int s_afd; /* (G) last accepted fd; [for fd_insert] */
int s_eventmask; /* (G) state info from I_SETSIG et al */
};
/*
* The following structures are determined empirically.
*/
struct svr4_strmcmd {
long cmd; /* command ? */
long len; /* Address len */
long offs; /* Address offset */
long pad[61];
};
struct svr4_infocmd {
long cmd;
long tsdu;
long etsdu;
long cdata;
long ddata;
long addr;
long opt;
long tidu;
long serv;
long current;
long provider;
};
struct svr4_strfdinsert {
struct svr4_strbuf ctl;
struct svr4_strbuf data;
long flags;
int fd;
int offset;
};
struct svr4_netaddr_in {
u_short family;
u_short port;
u_long addr;
};
struct svr4_netaddr_un {
u_short family;
char path[1];
};
#define SVR4_ADDROF(sc) (void *) (((char *) (sc)) + (sc)->offs)
#define SVR4_C_ADDROF(sc) (const void *) (((const char *) (sc)) + (sc)->offs)
struct svr4_strm *svr4_stream_get(struct file *fp);
#endif /* !_SVR4_STROPTS */

View File

@ -1,146 +0,0 @@
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
*/
#define SVR4_SYS_exit 1
#define SVR4_SYS_fork 2
#define SVR4_SYS_read 3
#define SVR4_SYS_write 4
#define SVR4_SYS_svr4_sys_open 5
#define SVR4_SYS_close 6
#define SVR4_SYS_svr4_sys_wait 7
#define SVR4_SYS_svr4_sys_creat 8
#define SVR4_SYS_link 9
#define SVR4_SYS_unlink 10
#define SVR4_SYS_svr4_sys_execv 11
#define SVR4_SYS_chdir 12
#define SVR4_SYS_svr4_sys_time 13
#define SVR4_SYS_svr4_sys_mknod 14
#define SVR4_SYS_chmod 15
#define SVR4_SYS_chown 16
#define SVR4_SYS_svr4_sys_break 17
#define SVR4_SYS_svr4_sys_stat 18
#define SVR4_SYS_lseek 19
#define SVR4_SYS_getpid 20
#define SVR4_SYS_setuid 23
#define SVR4_SYS_getuid 24
#define SVR4_SYS_svr4_sys_alarm 27
#define SVR4_SYS_svr4_sys_fstat 28
#define SVR4_SYS_svr4_sys_pause 29
#define SVR4_SYS_svr4_sys_utime 30
#define SVR4_SYS_svr4_sys_access 33
#define SVR4_SYS_svr4_sys_nice 34
#define SVR4_SYS_sync 36
#define SVR4_SYS_svr4_sys_kill 37
#define SVR4_SYS_svr4_sys_pgrpsys 39
#define SVR4_SYS_dup 41
#define SVR4_SYS_svr4_pipe 42
#define SVR4_SYS_svr4_sys_times 43
#define SVR4_SYS_setgid 46
#define SVR4_SYS_getgid 47
#define SVR4_SYS_svr4_sys_signal 48
#define SVR4_SYS_svr4_sys_msgsys 49
#define SVR4_SYS_svr4_sys_sysarch 50
#define SVR4_SYS_svr4_sys_shmsys 52
#define SVR4_SYS_svr4_sys_semsys 53
#define SVR4_SYS_svr4_sys_ioctl 54
#define SVR4_SYS_svr4_sys_utssys 57
#define SVR4_SYS_fsync 58
#define SVR4_SYS_svr4_sys_execve 59
#define SVR4_SYS_umask 60
#define SVR4_SYS_chroot 61
#define SVR4_SYS_svr4_sys_fcntl 62
#define SVR4_SYS_svr4_sys_ulimit 63
#define SVR4_SYS_rmdir 79
#define SVR4_SYS_mkdir 80
#define SVR4_SYS_svr4_sys_getdents 81
#define SVR4_SYS_svr4_sys_getmsg 85
#define SVR4_SYS_svr4_sys_putmsg 86
#define SVR4_SYS_svr4_sys_poll 87
#define SVR4_SYS_svr4_sys_lstat 88
#define SVR4_SYS_symlink 89
#define SVR4_SYS_readlink 90
#define SVR4_SYS_getgroups 91
#define SVR4_SYS_setgroups 92
#define SVR4_SYS_fchmod 93
#define SVR4_SYS_fchown 94
#define SVR4_SYS_svr4_sys_sigprocmask 95
#define SVR4_SYS_svr4_sys_sigsuspend 96
#define SVR4_SYS_svr4_sys_sigaltstack 97
#define SVR4_SYS_svr4_sys_sigaction 98
#define SVR4_SYS_svr4_sys_sigpending 99
#define SVR4_SYS_svr4_sys_context 100
#define SVR4_SYS_svr4_sys_statvfs 103
#define SVR4_SYS_svr4_sys_fstatvfs 104
#define SVR4_SYS_svr4_sys_waitsys 107
#define SVR4_SYS_svr4_sys_hrtsys 109
#define SVR4_SYS_svr4_sys_pathconf 113
#define SVR4_SYS_svr4_sys_mmap 115
#define SVR4_SYS_mprotect 116
#define SVR4_SYS_munmap 117
#define SVR4_SYS_svr4_sys_fpathconf 118
#define SVR4_SYS_vfork 119
#define SVR4_SYS_fchdir 120
#define SVR4_SYS_readv 121
#define SVR4_SYS_writev 122
#define SVR4_SYS_svr4_sys_xstat 123
#define SVR4_SYS_svr4_sys_lxstat 124
#define SVR4_SYS_svr4_sys_fxstat 125
#define SVR4_SYS_svr4_sys_xmknod 126
#define SVR4_SYS_svr4_sys_setrlimit 128
#define SVR4_SYS_svr4_sys_getrlimit 129
#define SVR4_SYS_lchown 130
#define SVR4_SYS_svr4_sys_memcntl 131
#define SVR4_SYS_rename 134
#define SVR4_SYS_svr4_sys_uname 135
#define SVR4_SYS_setegid 136
#define SVR4_SYS_svr4_sys_sysconfig 137
#define SVR4_SYS_adjtime 138
#define SVR4_SYS_svr4_sys_systeminfo 139
#define SVR4_SYS_seteuid 141
#define SVR4_SYS_svr4_sys_fchroot 153
#define SVR4_SYS_svr4_sys_utimes 154
#define SVR4_SYS_svr4_sys_vhangup 155
#define SVR4_SYS_svr4_sys_gettimeofday 156
#define SVR4_SYS_getitimer 157
#define SVR4_SYS_setitimer 158
#define SVR4_SYS_svr4_sys_llseek 175
#define SVR4_SYS_svr4_sys_acl 185
#define SVR4_SYS_svr4_sys_auditsys 186
#define SVR4_SYS_nanosleep 199
#define SVR4_SYS_svr4_sys_facl 200
#define SVR4_SYS_setreuid 202
#define SVR4_SYS_setregid 203
#define SVR4_SYS_svr4_sys_resolvepath 209
#define SVR4_SYS_svr4_sys_getdents64 213
#define SVR4_SYS_svr4_sys_mmap64 214
#define SVR4_SYS_svr4_sys_stat64 215
#define SVR4_SYS_svr4_sys_lstat64 216
#define SVR4_SYS_svr4_sys_fstat64 217
#define SVR4_SYS_svr4_sys_statvfs64 218
#define SVR4_SYS_svr4_sys_fstatvfs64 219
#define SVR4_SYS_svr4_sys_setrlimit64 220
#define SVR4_SYS_svr4_sys_getrlimit64 221
#define SVR4_SYS_svr4_sys_creat64 224
#define SVR4_SYS_svr4_sys_open64 225
#define SVR4_SYS_svr4_sys_socket 230
#define SVR4_SYS_socketpair 231
#define SVR4_SYS_bind 232
#define SVR4_SYS_listen 233
#define SVR4_SYS_accept 234
#define SVR4_SYS_connect 235
#define SVR4_SYS_shutdown 236
#define SVR4_SYS_svr4_sys_recv 237
#define SVR4_SYS_recvfrom 238
#define SVR4_SYS_recvmsg 239
#define SVR4_SYS_svr4_sys_send 240
#define SVR4_SYS_sendmsg 241
#define SVR4_SYS_svr4_sys_sendto 242
#define SVR4_SYS_getpeername 243
#define SVR4_SYS_getsockname 244
#define SVR4_SYS_getsockopt 245
#define SVR4_SYS_setsockopt 246
#define SVR4_SYS_MAXSYSCALL 250

View File

@ -1,259 +0,0 @@
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
*/
const char *svr4_syscallnames[] = {
"#0", /* 0 = unused */
"exit", /* 1 = exit */
"fork", /* 2 = fork */
"read", /* 3 = read */
"write", /* 4 = write */
"svr4_sys_open", /* 5 = svr4_sys_open */
"close", /* 6 = close */
"svr4_sys_wait", /* 7 = svr4_sys_wait */
"svr4_sys_creat", /* 8 = svr4_sys_creat */
"link", /* 9 = link */
"unlink", /* 10 = unlink */
"svr4_sys_execv", /* 11 = svr4_sys_execv */
"chdir", /* 12 = chdir */
"svr4_sys_time", /* 13 = svr4_sys_time */
"svr4_sys_mknod", /* 14 = svr4_sys_mknod */
"chmod", /* 15 = chmod */
"chown", /* 16 = chown */
"svr4_sys_break", /* 17 = svr4_sys_break */
"svr4_sys_stat", /* 18 = svr4_sys_stat */
"lseek", /* 19 = lseek */
"getpid", /* 20 = getpid */
"#21", /* 21 = old_mount */
"#22", /* 22 = sysv_umount */
"setuid", /* 23 = setuid */
"getuid", /* 24 = getuid */
"#25", /* 25 = stime */
"#26", /* 26 = ptrace */
"svr4_sys_alarm", /* 27 = svr4_sys_alarm */
"svr4_sys_fstat", /* 28 = svr4_sys_fstat */
"svr4_sys_pause", /* 29 = svr4_sys_pause */
"svr4_sys_utime", /* 30 = svr4_sys_utime */
"#31", /* 31 = stty */
"#32", /* 32 = gtty */
"svr4_sys_access", /* 33 = svr4_sys_access */
"svr4_sys_nice", /* 34 = svr4_sys_nice */
"#35", /* 35 = statfs */
"sync", /* 36 = sync */
"svr4_sys_kill", /* 37 = svr4_sys_kill */
"#38", /* 38 = fstatfs */
"svr4_sys_pgrpsys", /* 39 = svr4_sys_pgrpsys */
"#40", /* 40 = xenix */
"dup", /* 41 = dup */
"svr4_pipe", /* 42 = svr4_pipe */
"svr4_sys_times", /* 43 = svr4_sys_times */
"#44", /* 44 = profil */
"#45", /* 45 = plock */
"setgid", /* 46 = setgid */
"getgid", /* 47 = getgid */
"svr4_sys_signal", /* 48 = svr4_sys_signal */
"svr4_sys_msgsys", /* 49 = svr4_sys_msgsys */
"svr4_sys_sysarch", /* 50 = svr4_sys_sysarch */
"#51", /* 51 = acct */
"svr4_sys_shmsys", /* 52 = svr4_sys_shmsys */
"svr4_sys_semsys", /* 53 = svr4_sys_semsys */
"svr4_sys_ioctl", /* 54 = svr4_sys_ioctl */
"#55", /* 55 = uadmin */
"#56", /* 56 = exch */
"svr4_sys_utssys", /* 57 = svr4_sys_utssys */
"fsync", /* 58 = fsync */
"svr4_sys_execve", /* 59 = svr4_sys_execve */
"umask", /* 60 = umask */
"chroot", /* 61 = chroot */
"svr4_sys_fcntl", /* 62 = svr4_sys_fcntl */
"svr4_sys_ulimit", /* 63 = svr4_sys_ulimit */
"#64", /* 64 = reserved */
"#65", /* 65 = reserved */
"#66", /* 66 = reserved */
"#67", /* 67 = reserved */
"#68", /* 68 = reserved */
"#69", /* 69 = reserved */
"#70", /* 70 = advfs */
"#71", /* 71 = unadvfs */
"#72", /* 72 = rmount */
"#73", /* 73 = rumount */
"#74", /* 74 = rfstart */
"#75", /* 75 = sigret */
"#76", /* 76 = rdebug */
"#77", /* 77 = rfstop */
"#78", /* 78 = rfsys */
"rmdir", /* 79 = rmdir */
"mkdir", /* 80 = mkdir */
"svr4_sys_getdents", /* 81 = svr4_sys_getdents */
"#82", /* 82 = libattach */
"#83", /* 83 = libdetach */
"#84", /* 84 = sysfs */
"svr4_sys_getmsg", /* 85 = svr4_sys_getmsg */
"svr4_sys_putmsg", /* 86 = svr4_sys_putmsg */
"svr4_sys_poll", /* 87 = svr4_sys_poll */
"svr4_sys_lstat", /* 88 = svr4_sys_lstat */
"symlink", /* 89 = symlink */
"readlink", /* 90 = readlink */
"getgroups", /* 91 = getgroups */
"setgroups", /* 92 = setgroups */
"fchmod", /* 93 = fchmod */
"fchown", /* 94 = fchown */
"svr4_sys_sigprocmask", /* 95 = svr4_sys_sigprocmask */
"svr4_sys_sigsuspend", /* 96 = svr4_sys_sigsuspend */
"svr4_sys_sigaltstack", /* 97 = svr4_sys_sigaltstack */
"svr4_sys_sigaction", /* 98 = svr4_sys_sigaction */
"svr4_sys_sigpending", /* 99 = svr4_sys_sigpending */
"svr4_sys_context", /* 100 = svr4_sys_context */
"#101", /* 101 = evsys */
"#102", /* 102 = evtrapret */
"svr4_sys_statvfs", /* 103 = svr4_sys_statvfs */
"svr4_sys_fstatvfs", /* 104 = svr4_sys_fstatvfs */
"#105", /* 105 = whoknows */
"#106", /* 106 = nfssvc */
"svr4_sys_waitsys", /* 107 = svr4_sys_waitsys */
"#108", /* 108 = sigsendsys */
"svr4_sys_hrtsys", /* 109 = svr4_sys_hrtsys */
"#110", /* 110 = acancel */
"#111", /* 111 = async */
"#112", /* 112 = priocntlsys */
"svr4_sys_pathconf", /* 113 = svr4_sys_pathconf */
"#114", /* 114 = mincore */
"svr4_sys_mmap", /* 115 = svr4_sys_mmap */
"mprotect", /* 116 = mprotect */
"munmap", /* 117 = munmap */
"svr4_sys_fpathconf", /* 118 = svr4_sys_fpathconf */
"vfork", /* 119 = vfork */
"fchdir", /* 120 = fchdir */
"readv", /* 121 = readv */
"writev", /* 122 = writev */
"svr4_sys_xstat", /* 123 = svr4_sys_xstat */
"svr4_sys_lxstat", /* 124 = svr4_sys_lxstat */
"svr4_sys_fxstat", /* 125 = svr4_sys_fxstat */
"svr4_sys_xmknod", /* 126 = svr4_sys_xmknod */
"#127", /* 127 = clocal */
"svr4_sys_setrlimit", /* 128 = svr4_sys_setrlimit */
"svr4_sys_getrlimit", /* 129 = svr4_sys_getrlimit */
"lchown", /* 130 = lchown */
"svr4_sys_memcntl", /* 131 = svr4_sys_memcntl */
"#132", /* 132 = getpmsg */
"#133", /* 133 = putpmsg */
"rename", /* 134 = rename */
"svr4_sys_uname", /* 135 = svr4_sys_uname */
"setegid", /* 136 = setegid */
"svr4_sys_sysconfig", /* 137 = svr4_sys_sysconfig */
"adjtime", /* 138 = adjtime */
"svr4_sys_systeminfo", /* 139 = svr4_sys_systeminfo */
"#140", /* 140 = notused */
"seteuid", /* 141 = seteuid */
"#142", /* 142 = vtrace */
"#143", /* 143 = { */
"#144", /* 144 = sigtimedwait */
"#145", /* 145 = lwp_info */
"#146", /* 146 = yield */
"#147", /* 147 = lwp_sema_wait */
"#148", /* 148 = lwp_sema_post */
"#149", /* 149 = lwp_sema_trywait */
"#150", /* 150 = notused */
"#151", /* 151 = notused */
"#152", /* 152 = modctl */
"svr4_sys_fchroot", /* 153 = svr4_sys_fchroot */
"svr4_sys_utimes", /* 154 = svr4_sys_utimes */
"svr4_sys_vhangup", /* 155 = svr4_sys_vhangup */
"svr4_sys_gettimeofday", /* 156 = svr4_sys_gettimeofday */
"getitimer", /* 157 = getitimer */
"setitimer", /* 158 = setitimer */
"#159", /* 159 = lwp_create */
"#160", /* 160 = lwp_exit */
"#161", /* 161 = lwp_suspend */
"#162", /* 162 = lwp_continue */
"#163", /* 163 = lwp_kill */
"#164", /* 164 = lwp_self */
"#165", /* 165 = lwp_getprivate */
"#166", /* 166 = lwp_setprivate */
"#167", /* 167 = lwp_wait */
"#168", /* 168 = lwp_mutex_unlock */
"#169", /* 169 = lwp_mutex_lock */
"#170", /* 170 = lwp_cond_wait */
"#171", /* 171 = lwp_cond_signal */
"#172", /* 172 = lwp_cond_broadcast */
"#173", /* 173 = { */
"#174", /* 174 = { */
"svr4_sys_llseek", /* 175 = svr4_sys_llseek */
"#176", /* 176 = inst_sync */
"#177", /* 177 = whoknows */
"#178", /* 178 = kaio */
"#179", /* 179 = whoknows */
"#180", /* 180 = whoknows */
"#181", /* 181 = whoknows */
"#182", /* 182 = whoknows */
"#183", /* 183 = whoknows */
"#184", /* 184 = tsolsys */
"svr4_sys_acl", /* 185 = svr4_sys_acl */
"svr4_sys_auditsys", /* 186 = svr4_sys_auditsys */
"#187", /* 187 = processor_bind */
"#188", /* 188 = processor_info */
"#189", /* 189 = p_online */
"#190", /* 190 = sigqueue */
"#191", /* 191 = clock_gettime */
"#192", /* 192 = clock_settime */
"#193", /* 193 = clock_getres */
"#194", /* 194 = timer_create */
"#195", /* 195 = timer_delete */
"#196", /* 196 = timer_settime */
"#197", /* 197 = timer_gettime */
"#198", /* 198 = timer_overrun */
"nanosleep", /* 199 = nanosleep */
"svr4_sys_facl", /* 200 = svr4_sys_facl */
"#201", /* 201 = door */
"setreuid", /* 202 = setreuid */
"setregid", /* 203 = setregid */
"#204", /* 204 = install_utrap */
"#205", /* 205 = signotify */
"#206", /* 206 = schedctl */
"#207", /* 207 = pset */
"#208", /* 208 = whoknows */
"svr4_sys_resolvepath", /* 209 = svr4_sys_resolvepath */
"#210", /* 210 = signotifywait */
"#211", /* 211 = lwp_sigredirect */
"#212", /* 212 = lwp_alarm */
"svr4_sys_getdents64", /* 213 = svr4_sys_getdents64 */
"svr4_sys_mmap64", /* 214 = svr4_sys_mmap64 */
"svr4_sys_stat64", /* 215 = svr4_sys_stat64 */
"svr4_sys_lstat64", /* 216 = svr4_sys_lstat64 */
"svr4_sys_fstat64", /* 217 = svr4_sys_fstat64 */
"svr4_sys_statvfs64", /* 218 = svr4_sys_statvfs64 */
"svr4_sys_fstatvfs64", /* 219 = svr4_sys_fstatvfs64 */
"svr4_sys_setrlimit64", /* 220 = svr4_sys_setrlimit64 */
"svr4_sys_getrlimit64", /* 221 = svr4_sys_getrlimit64 */
"#222", /* 222 = pread64 */
"#223", /* 223 = pwrite64 */
"svr4_sys_creat64", /* 224 = svr4_sys_creat64 */
"svr4_sys_open64", /* 225 = svr4_sys_open64 */
"#226", /* 226 = rpcsys */
"#227", /* 227 = whoknows */
"#228", /* 228 = whoknows */
"#229", /* 229 = whoknows */
"svr4_sys_socket", /* 230 = svr4_sys_socket */
"socketpair", /* 231 = socketpair */
"bind", /* 232 = bind */
"listen", /* 233 = listen */
"accept", /* 234 = accept */
"connect", /* 235 = connect */
"shutdown", /* 236 = shutdown */
"svr4_sys_recv", /* 237 = svr4_sys_recv */
"recvfrom", /* 238 = recvfrom */
"recvmsg", /* 239 = recvmsg */
"svr4_sys_send", /* 240 = svr4_sys_send */
"sendmsg", /* 241 = sendmsg */
"svr4_sys_sendto", /* 242 = svr4_sys_sendto */
"getpeername", /* 243 = getpeername */
"getsockname", /* 244 = getsockname */
"getsockopt", /* 245 = getsockopt */
"setsockopt", /* 246 = setsockopt */
"#247", /* 247 = sockconfig */
"#248", /* 248 = { */
"#249", /* 249 = { */
};

View File

@ -1,78 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1995 Christos Zoulas
* 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.
* 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 _SVR4_SYSCONFIG_H_
#define _SVR4_SYSCONFIG_H_
#define SVR4_CONFIG_UNUSED_1 0x01
#define SVR4_CONFIG_NGROUPS 0x02
#define SVR4_CONFIG_CHILD_MAX 0x03
#define SVR4_CONFIG_OPEN_FILES 0x04
#define SVR4_CONFIG_POSIX_VER 0x05
#define SVR4_CONFIG_PAGESIZE 0x06
#define SVR4_CONFIG_CLK_TCK 0x07
#define SVR4_CONFIG_XOPEN_VER 0x08
#define SVR4_CONFIG_UNUSED_9 0x09
#define SVR4_CONFIG_PROF_TCK 0x0a
#define SVR4_CONFIG_NPROC_CONF 0x0b
#define SVR4_CONFIG_NPROC_ONLN 0x0c
#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d
#define SVR4_CONFIG_AIO_MAX 0x0e
#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f
#define SVR4_CONFIG_DELAYTIMER_MAX 0x10
#define SVR4_CONFIG_MQ_OPEN_MAX 0x11
#define SVR4_CONFIG_MQ_PRIO_MAX 0x12
#define SVR4_CONFIG_RTSIG_MAX 0x13
#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14
#define SVR4_CONFIG_SEM_VALUE_MAX 0x15
#define SVR4_CONFIG_SIGQUEUE_MAX 0x16
#define SVR4_CONFIG_SIGRT_MIN 0x17
#define SVR4_CONFIG_SIGRT_MAX 0x18
#define SVR4_CONFIG_TIMER_MAX 0x19
#define SVR4_CONFIG_PHYS_PAGES 0x1a
#define SVR4_CONFIG_AVPHYS_PAGES 0x1b
#define SVR4_CONFIG_COHERENCY 0x1c
#define SVR4_CONFIG_SPLIT_CACHE 0x1d
#define SVR4_CONFIG_ICACHESZ 0x1e
#define SVR4_CONFIG_DCACHESZ 0x1f
#define SVR4_CONFIG_ICACHELINESZ 0x20
#define SVR4_CONFIG_DCACHELINESZ 0x21
#define SVR4_CONFIG_ICACHEBLKSZ 0x22
#define SVR4_CONFIG_DCACHEBLKSZ 0x23
#define SVR4_CONFIG_DCACHETBLKSZ 0x24
#define SVR4_CONFIG_ICACHE_ASSOC 0x25
#define SVR4_CONFIG_DCACHE_ASSOC 0x26
#define SVR4_CONFIG_UNUSED_2 0x27
#define SVR4_CONFIG_UNUSED_3 0x28
#define SVR4_CONFIG_UNUSED_4 0x29
#define SVR4_CONFIG_MAXPID 0x2a
#define SVR4_CONFIG_STACK_PROT 0x2b
#endif /* !_SVR4_SYSCONFIG_H_ */

View File

@ -1,271 +0,0 @@
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
*/
#include <sys/types.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <netinet/in.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
#define AS(name) (sizeof(struct name) / sizeof(register_t))
/* The casts are bogus but will do for now. */
struct sysent svr4_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = unused */
{ AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */
{ 0, (sy_call_t *)sys_fork, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = fork */
{ AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */
{ AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */
{ AS(svr4_sys_open_args), (sy_call_t *)svr4_sys_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = svr4_sys_open */
{ AS(close_args), (sy_call_t *)sys_close, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = close */
{ AS(svr4_sys_wait_args), (sy_call_t *)svr4_sys_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = svr4_sys_wait */
{ AS(svr4_sys_creat_args), (sy_call_t *)svr4_sys_creat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = svr4_sys_creat */
{ AS(link_args), (sy_call_t *)sys_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */
{ AS(unlink_args), (sy_call_t *)sys_unlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = unlink */
{ AS(svr4_sys_execv_args), (sy_call_t *)svr4_sys_execv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = svr4_sys_execv */
{ AS(chdir_args), (sy_call_t *)sys_chdir, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = chdir */
{ AS(svr4_sys_time_args), (sy_call_t *)svr4_sys_time, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = svr4_sys_time */
{ AS(svr4_sys_mknod_args), (sy_call_t *)svr4_sys_mknod, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = svr4_sys_mknod */
{ AS(chmod_args), (sy_call_t *)sys_chmod, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */
{ AS(chown_args), (sy_call_t *)sys_chown, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */
{ AS(svr4_sys_break_args), (sy_call_t *)svr4_sys_break, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = svr4_sys_break */
{ AS(svr4_sys_stat_args), (sy_call_t *)svr4_sys_stat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = svr4_sys_stat */
{ AS(lseek_args), (sy_call_t *)sys_lseek, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = lseek */
{ 0, (sy_call_t *)sys_getpid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 21 = old_mount */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 22 = sysv_umount */
{ AS(setuid_args), (sy_call_t *)sys_setuid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = setuid */
{ 0, (sy_call_t *)sys_getuid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = getuid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 25 = stime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 26 = ptrace */
{ AS(svr4_sys_alarm_args), (sy_call_t *)svr4_sys_alarm, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = svr4_sys_alarm */
{ AS(svr4_sys_fstat_args), (sy_call_t *)svr4_sys_fstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = svr4_sys_fstat */
{ 0, (sy_call_t *)svr4_sys_pause, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = svr4_sys_pause */
{ AS(svr4_sys_utime_args), (sy_call_t *)svr4_sys_utime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = svr4_sys_utime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 31 = stty */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 32 = gtty */
{ AS(svr4_sys_access_args), (sy_call_t *)svr4_sys_access, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 33 = svr4_sys_access */
{ AS(svr4_sys_nice_args), (sy_call_t *)svr4_sys_nice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = svr4_sys_nice */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 35 = statfs */
{ 0, (sy_call_t *)sys_sync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = sync */
{ AS(svr4_sys_kill_args), (sy_call_t *)svr4_sys_kill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = svr4_sys_kill */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 38 = fstatfs */
{ AS(svr4_sys_pgrpsys_args), (sy_call_t *)svr4_sys_pgrpsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = svr4_sys_pgrpsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 40 = xenix */
{ AS(dup_args), (sy_call_t *)sys_dup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */
{ 0, (sy_call_t *)svr4_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = svr4_pipe */
{ AS(svr4_sys_times_args), (sy_call_t *)svr4_sys_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = svr4_sys_times */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 44 = profil */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 45 = plock */
{ AS(setgid_args), (sy_call_t *)sys_setgid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = setgid */
{ 0, (sy_call_t *)sys_getgid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = getgid */
{ AS(svr4_sys_signal_args), (sy_call_t *)svr4_sys_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = svr4_sys_signal */
{ AS(svr4_sys_msgsys_args), (sy_call_t *)svr4_sys_msgsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 49 = svr4_sys_msgsys */
{ AS(svr4_sys_sysarch_args), (sy_call_t *)svr4_sys_sysarch, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = svr4_sys_sysarch */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 51 = acct */
{ AS(svr4_sys_shmsys_args), (sy_call_t *)svr4_sys_shmsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 52 = svr4_sys_shmsys */
{ AS(svr4_sys_semsys_args), (sy_call_t *)svr4_sys_semsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 53 = svr4_sys_semsys */
{ AS(svr4_sys_ioctl_args), (sy_call_t *)svr4_sys_ioctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 54 = svr4_sys_ioctl */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 55 = uadmin */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 56 = exch */
{ AS(svr4_sys_utssys_args), (sy_call_t *)svr4_sys_utssys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = svr4_sys_utssys */
{ AS(fsync_args), (sy_call_t *)sys_fsync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 58 = fsync */
{ AS(svr4_sys_execve_args), (sy_call_t *)svr4_sys_execve, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 59 = svr4_sys_execve */
{ AS(umask_args), (sy_call_t *)sys_umask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 60 = umask */
{ AS(chroot_args), (sy_call_t *)sys_chroot, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 61 = chroot */
{ AS(svr4_sys_fcntl_args), (sy_call_t *)svr4_sys_fcntl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 62 = svr4_sys_fcntl */
{ AS(svr4_sys_ulimit_args), (sy_call_t *)svr4_sys_ulimit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 63 = svr4_sys_ulimit */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 64 = reserved */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 65 = reserved */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 66 = reserved */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 67 = reserved */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = reserved */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 69 = reserved */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 70 = advfs */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 71 = unadvfs */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 72 = rmount */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 73 = rumount */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 74 = rfstart */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 75 = sigret */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 76 = rdebug */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 77 = rfstop */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 78 = rfsys */
{ AS(rmdir_args), (sy_call_t *)sys_rmdir, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 79 = rmdir */
{ AS(mkdir_args), (sy_call_t *)sys_mkdir, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 80 = mkdir */
{ AS(svr4_sys_getdents_args), (sy_call_t *)svr4_sys_getdents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 81 = svr4_sys_getdents */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 82 = libattach */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 83 = libdetach */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 84 = sysfs */
{ AS(svr4_sys_getmsg_args), (sy_call_t *)svr4_sys_getmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = svr4_sys_getmsg */
{ AS(svr4_sys_putmsg_args), (sy_call_t *)svr4_sys_putmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = svr4_sys_putmsg */
{ AS(svr4_sys_poll_args), (sy_call_t *)svr4_sys_poll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 87 = svr4_sys_poll */
{ AS(svr4_sys_lstat_args), (sy_call_t *)svr4_sys_lstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 88 = svr4_sys_lstat */
{ AS(symlink_args), (sy_call_t *)sys_symlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = symlink */
{ AS(readlink_args), (sy_call_t *)sys_readlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 90 = readlink */
{ AS(getgroups_args), (sy_call_t *)sys_getgroups, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 91 = getgroups */
{ AS(setgroups_args), (sy_call_t *)sys_setgroups, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 92 = setgroups */
{ AS(fchmod_args), (sy_call_t *)sys_fchmod, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 93 = fchmod */
{ AS(fchown_args), (sy_call_t *)sys_fchown, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 94 = fchown */
{ AS(svr4_sys_sigprocmask_args), (sy_call_t *)svr4_sys_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 95 = svr4_sys_sigprocmask */
{ AS(svr4_sys_sigsuspend_args), (sy_call_t *)svr4_sys_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 96 = svr4_sys_sigsuspend */
{ AS(svr4_sys_sigaltstack_args), (sy_call_t *)svr4_sys_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 97 = svr4_sys_sigaltstack */
{ AS(svr4_sys_sigaction_args), (sy_call_t *)svr4_sys_sigaction, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 98 = svr4_sys_sigaction */
{ AS(svr4_sys_sigpending_args), (sy_call_t *)svr4_sys_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 99 = svr4_sys_sigpending */
{ AS(svr4_sys_context_args), (sy_call_t *)svr4_sys_context, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 100 = svr4_sys_context */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 101 = evsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 102 = evtrapret */
{ AS(svr4_sys_statvfs_args), (sy_call_t *)svr4_sys_statvfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 103 = svr4_sys_statvfs */
{ AS(svr4_sys_fstatvfs_args), (sy_call_t *)svr4_sys_fstatvfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 104 = svr4_sys_fstatvfs */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 105 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 106 = nfssvc */
{ AS(svr4_sys_waitsys_args), (sy_call_t *)svr4_sys_waitsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 107 = svr4_sys_waitsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 108 = sigsendsys */
{ AS(svr4_sys_hrtsys_args), (sy_call_t *)svr4_sys_hrtsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 109 = svr4_sys_hrtsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 110 = acancel */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 111 = async */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 112 = priocntlsys */
{ AS(svr4_sys_pathconf_args), (sy_call_t *)svr4_sys_pathconf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 113 = svr4_sys_pathconf */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 114 = mincore */
{ AS(svr4_sys_mmap_args), (sy_call_t *)svr4_sys_mmap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 115 = svr4_sys_mmap */
{ AS(mprotect_args), (sy_call_t *)sys_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 116 = mprotect */
{ AS(munmap_args), (sy_call_t *)sys_munmap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 117 = munmap */
{ AS(svr4_sys_fpathconf_args), (sy_call_t *)svr4_sys_fpathconf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 118 = svr4_sys_fpathconf */
{ 0, (sy_call_t *)sys_vfork, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 119 = vfork */
{ AS(fchdir_args), (sy_call_t *)sys_fchdir, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 120 = fchdir */
{ AS(readv_args), (sy_call_t *)sys_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 121 = readv */
{ AS(writev_args), (sy_call_t *)sys_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 122 = writev */
{ AS(svr4_sys_xstat_args), (sy_call_t *)svr4_sys_xstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 123 = svr4_sys_xstat */
{ AS(svr4_sys_lxstat_args), (sy_call_t *)svr4_sys_lxstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 124 = svr4_sys_lxstat */
{ AS(svr4_sys_fxstat_args), (sy_call_t *)svr4_sys_fxstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 125 = svr4_sys_fxstat */
{ AS(svr4_sys_xmknod_args), (sy_call_t *)svr4_sys_xmknod, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = svr4_sys_xmknod */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 127 = clocal */
{ AS(svr4_sys_setrlimit_args), (sy_call_t *)svr4_sys_setrlimit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = svr4_sys_setrlimit */
{ AS(svr4_sys_getrlimit_args), (sy_call_t *)svr4_sys_getrlimit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = svr4_sys_getrlimit */
{ AS(lchown_args), (sy_call_t *)sys_lchown, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = lchown */
{ AS(svr4_sys_memcntl_args), (sy_call_t *)svr4_sys_memcntl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = svr4_sys_memcntl */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 132 = getpmsg */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 133 = putpmsg */
{ AS(rename_args), (sy_call_t *)sys_rename, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 134 = rename */
{ AS(svr4_sys_uname_args), (sy_call_t *)svr4_sys_uname, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 135 = svr4_sys_uname */
{ AS(setegid_args), (sy_call_t *)sys_setegid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 136 = setegid */
{ AS(svr4_sys_sysconfig_args), (sy_call_t *)svr4_sys_sysconfig, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 137 = svr4_sys_sysconfig */
{ AS(adjtime_args), (sy_call_t *)sys_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 138 = adjtime */
{ AS(svr4_sys_systeminfo_args), (sy_call_t *)svr4_sys_systeminfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 139 = svr4_sys_systeminfo */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 140 = notused */
{ AS(seteuid_args), (sy_call_t *)sys_seteuid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 141 = seteuid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 142 = vtrace */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 143 = { */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 144 = sigtimedwait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 145 = lwp_info */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 146 = yield */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 147 = lwp_sema_wait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 148 = lwp_sema_post */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 149 = lwp_sema_trywait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 150 = notused */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 151 = notused */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 152 = modctl */
{ AS(svr4_sys_fchroot_args), (sy_call_t *)svr4_sys_fchroot, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = svr4_sys_fchroot */
{ AS(svr4_sys_utimes_args), (sy_call_t *)svr4_sys_utimes, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = svr4_sys_utimes */
{ 0, (sy_call_t *)svr4_sys_vhangup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = svr4_sys_vhangup */
{ AS(svr4_sys_gettimeofday_args), (sy_call_t *)svr4_sys_gettimeofday, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = svr4_sys_gettimeofday */
{ AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = getitimer */
{ AS(setitimer_args), (sy_call_t *)sys_setitimer, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = setitimer */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 159 = lwp_create */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 160 = lwp_exit */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 161 = lwp_suspend */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 162 = lwp_continue */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 163 = lwp_kill */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 164 = lwp_self */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 165 = lwp_getprivate */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 166 = lwp_setprivate */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 167 = lwp_wait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 168 = lwp_mutex_unlock */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 169 = lwp_mutex_lock */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 170 = lwp_cond_wait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 171 = lwp_cond_signal */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 172 = lwp_cond_broadcast */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 173 = { */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 174 = { */
{ AS(svr4_sys_llseek_args), (sy_call_t *)svr4_sys_llseek, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = svr4_sys_llseek */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 176 = inst_sync */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 177 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 178 = kaio */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 179 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 180 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 181 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 182 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 183 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 184 = tsolsys */
{ AS(svr4_sys_acl_args), (sy_call_t *)svr4_sys_acl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = svr4_sys_acl */
{ AS(svr4_sys_auditsys_args), (sy_call_t *)svr4_sys_auditsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = svr4_sys_auditsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 187 = processor_bind */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 188 = processor_info */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 189 = p_online */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 190 = sigqueue */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 191 = clock_gettime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 192 = clock_settime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 193 = clock_getres */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 194 = timer_create */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 195 = timer_delete */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 196 = timer_settime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 197 = timer_gettime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 198 = timer_overrun */
{ AS(nanosleep_args), (sy_call_t *)sys_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 199 = nanosleep */
{ AS(svr4_sys_facl_args), (sy_call_t *)svr4_sys_facl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = svr4_sys_facl */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 201 = door */
{ AS(setreuid_args), (sy_call_t *)sys_setreuid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 202 = setreuid */
{ AS(setregid_args), (sy_call_t *)sys_setregid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 203 = setregid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 204 = install_utrap */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 205 = signotify */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 206 = schedctl */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 207 = pset */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = whoknows */
{ AS(svr4_sys_resolvepath_args), (sy_call_t *)svr4_sys_resolvepath, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 209 = svr4_sys_resolvepath */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = signotifywait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = lwp_sigredirect */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 212 = lwp_alarm */
{ AS(svr4_sys_getdents64_args), (sy_call_t *)svr4_sys_getdents64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 213 = svr4_sys_getdents64 */
{ AS(svr4_sys_mmap64_args), (sy_call_t *)svr4_sys_mmap64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 214 = svr4_sys_mmap64 */
{ AS(svr4_sys_stat64_args), (sy_call_t *)svr4_sys_stat64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 215 = svr4_sys_stat64 */
{ AS(svr4_sys_lstat64_args), (sy_call_t *)svr4_sys_lstat64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = svr4_sys_lstat64 */
{ AS(svr4_sys_fstat64_args), (sy_call_t *)svr4_sys_fstat64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 217 = svr4_sys_fstat64 */
{ AS(svr4_sys_statvfs64_args), (sy_call_t *)svr4_sys_statvfs64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 218 = svr4_sys_statvfs64 */
{ AS(svr4_sys_fstatvfs64_args), (sy_call_t *)svr4_sys_fstatvfs64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 219 = svr4_sys_fstatvfs64 */
{ AS(svr4_sys_setrlimit64_args), (sy_call_t *)svr4_sys_setrlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 220 = svr4_sys_setrlimit64 */
{ AS(svr4_sys_getrlimit64_args), (sy_call_t *)svr4_sys_getrlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 221 = svr4_sys_getrlimit64 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 222 = pread64 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 223 = pwrite64 */
{ AS(svr4_sys_creat64_args), (sy_call_t *)svr4_sys_creat64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 224 = svr4_sys_creat64 */
{ AS(svr4_sys_open64_args), (sy_call_t *)svr4_sys_open64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 225 = svr4_sys_open64 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 226 = rpcsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 227 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 228 = whoknows */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 229 = whoknows */
{ AS(svr4_sys_socket_args), (sy_call_t *)svr4_sys_socket, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 230 = svr4_sys_socket */
{ AS(socketpair_args), (sy_call_t *)sys_socketpair, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 231 = socketpair */
{ AS(bind_args), (sy_call_t *)sys_bind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = bind */
{ AS(listen_args), (sy_call_t *)sys_listen, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = listen */
{ AS(accept_args), (sy_call_t *)sys_accept, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = accept */
{ AS(connect_args), (sy_call_t *)sys_connect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = connect */
{ AS(shutdown_args), (sy_call_t *)sys_shutdown, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = shutdown */
{ AS(svr4_sys_recv_args), (sy_call_t *)svr4_sys_recv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = svr4_sys_recv */
{ AS(recvfrom_args), (sy_call_t *)sys_recvfrom, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = recvfrom */
{ AS(recvmsg_args), (sy_call_t *)sys_recvmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = recvmsg */
{ AS(svr4_sys_send_args), (sy_call_t *)svr4_sys_send, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = svr4_sys_send */
{ AS(sendmsg_args), (sy_call_t *)sys_sendmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = sendmsg */
{ AS(svr4_sys_sendto_args), (sy_call_t *)svr4_sys_sendto, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = svr4_sys_sendto */
{ AS(getpeername_args), (sy_call_t *)sys_getpeername, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = getpeername */
{ AS(getsockname_args), (sy_call_t *)sys_getsockname, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 244 = getsockname */
{ AS(getsockopt_args), (sy_call_t *)sys_getsockopt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 245 = getsockopt */
{ AS(setsockopt_args), (sy_call_t *)sys_setsockopt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 246 = setsockopt */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = sockconfig */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = { */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = { */
};

View File

@ -1,50 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_SYSTEMINFO_H_
#define _SVR4_SYSTEMINFO_H_
#define SVR4_SI_SYSNAME 1
#define SVR4_SI_HOSTNAME 2
#define SVR4_SI_RELEASE 3
#define SVR4_SI_VERSION 4
#define SVR4_SI_MACHINE 5
#define SVR4_SI_ARCHITECTURE 6
#define SVR4_SI_HW_SERIAL 7
#define SVR4_SI_HW_PROVIDER 8
#define SVR4_SI_SRPC_DOMAIN 9
#define SVR4_SI_SET_HOSTNAME 258
#define SVR4_SI_SET_SRPC_DOMAIN 265
#define SVR4_SI_SET_KERB_REALM 266
#define SVR4_SI_KERB_REALM 267
#define SVR4_SI_PLATFORM 513
#define SVR4_SI_ISALIST 514
#endif /* !_SVR4_SYSTEMINFO_H_ */

View File

@ -1,313 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* 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.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/* XXX we use functions that might not exist. */
#include "opt_compat.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sysent.h>
#include <sys/imgact.h>
#include <sys/imgact_elf.h>
#include <sys/fcntl.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/socket.h>
#include <sys/syscallsubr.h>
#include <sys/vnode.h>
#include <vm/vm.h>
#include <sys/exec.h>
#include <sys/kernel.h>
#include <machine/cpu.h>
#include <netinet/in.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_syscall.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_socket.h>
#include <compat/svr4/svr4_sockio.h>
#include <compat/svr4/svr4_errno.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_siginfo.h>
#include <compat/svr4/svr4_util.h>
int bsd_to_svr4_errno[ELAST+1] = {
0,
SVR4_EPERM,
SVR4_ENOENT,
SVR4_ESRCH,
SVR4_EINTR,
SVR4_EIO,
SVR4_ENXIO,
SVR4_E2BIG,
SVR4_ENOEXEC,
SVR4_EBADF,
SVR4_ECHILD,
SVR4_EDEADLK,
SVR4_ENOMEM,
SVR4_EACCES,
SVR4_EFAULT,
SVR4_ENOTBLK,
SVR4_EBUSY,
SVR4_EEXIST,
SVR4_EXDEV,
SVR4_ENODEV,
SVR4_ENOTDIR,
SVR4_EISDIR,
SVR4_EINVAL,
SVR4_ENFILE,
SVR4_EMFILE,
SVR4_ENOTTY,
SVR4_ETXTBSY,
SVR4_EFBIG,
SVR4_ENOSPC,
SVR4_ESPIPE,
SVR4_EROFS,
SVR4_EMLINK,
SVR4_EPIPE,
SVR4_EDOM,
SVR4_ERANGE,
SVR4_EAGAIN,
SVR4_EINPROGRESS,
SVR4_EALREADY,
SVR4_ENOTSOCK,
SVR4_EDESTADDRREQ,
SVR4_EMSGSIZE,
SVR4_EPROTOTYPE,
SVR4_ENOPROTOOPT,
SVR4_EPROTONOSUPPORT,
SVR4_ESOCKTNOSUPPORT,
SVR4_EOPNOTSUPP,
SVR4_EPFNOSUPPORT,
SVR4_EAFNOSUPPORT,
SVR4_EADDRINUSE,
SVR4_EADDRNOTAVAIL,
SVR4_ENETDOWN,
SVR4_ENETUNREACH,
SVR4_ENETRESET,
SVR4_ECONNABORTED,
SVR4_ECONNRESET,
SVR4_ENOBUFS,
SVR4_EISCONN,
SVR4_ENOTCONN,
SVR4_ESHUTDOWN,
SVR4_ETOOMANYREFS,
SVR4_ETIMEDOUT,
SVR4_ECONNREFUSED,
SVR4_ELOOP,
SVR4_ENAMETOOLONG,
SVR4_EHOSTDOWN,
SVR4_EHOSTUNREACH,
SVR4_ENOTEMPTY,
SVR4_EPROCLIM,
SVR4_EUSERS,
SVR4_EDQUOT,
SVR4_ESTALE,
SVR4_EREMOTE,
SVR4_EBADRPC,
SVR4_ERPCMISMATCH,
SVR4_EPROGUNAVAIL,
SVR4_EPROGMISMATCH,
SVR4_EPROCUNAVAIL,
SVR4_ENOLCK,
SVR4_ENOSYS,
SVR4_EFTYPE,
SVR4_EAUTH,
SVR4_ENEEDAUTH,
SVR4_EIDRM,
SVR4_ENOMSG,
};
static int svr4_fixup(register_t **stack_base, struct image_params *imgp);
extern struct sysent svr4_sysent[];
#undef szsigcode
#undef sigcode
extern int svr4_szsigcode;
extern char svr4_sigcode[];
struct sysentvec svr4_sysvec = {
.sv_size = SVR4_SYS_MAXSYSCALL,
.sv_table = svr4_sysent,
.sv_mask = 0xff,
.sv_errsize = ELAST, /* ELAST */
.sv_errtbl = bsd_to_svr4_errno,
.sv_transtrap = NULL,
.sv_fixup = svr4_fixup,
.sv_sendsig = svr4_sendsig,
.sv_sigcode = svr4_sigcode,
.sv_szsigcode = &svr4_szsigcode,
.sv_name = "SVR4",
.sv_coredump = elf32_coredump,
.sv_imgact_try = NULL,
.sv_minsigstksz = SVR4_MINSIGSTKSZ,
.sv_pagesize = PAGE_SIZE,
.sv_minuser = VM_MIN_ADDRESS,
.sv_maxuser = VM_MAXUSER_ADDRESS,
.sv_usrstack = USRSTACK,
.sv_psstrings = PS_STRINGS,
.sv_stackprot = VM_PROT_ALL,
.sv_copyout_strings = exec_copyout_strings,
.sv_setregs = exec_setregs,
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
.sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
.sv_trap = NULL,
};
const char svr4_emul_path[] = "/compat/svr4";
Elf32_Brandinfo svr4_brand = {
.brand = ELFOSABI_SYSV,
.machine = EM_386, /* XXX only implemented for x86 so far. */
.compat_3_brand = "SVR4",
.emul_path = svr4_emul_path,
.interp_path = "/lib/libc.so.1",
.sysvec = &svr4_sysvec,
.interp_newpath = NULL,
.brand_note = NULL,
.flags = 0
};
static int
svr4_fixup(register_t **stack_base, struct image_params *imgp)
{
Elf32_Auxargs *args;
register_t *pos;
KASSERT(curthread->td_proc == imgp->proc,
("unsafe svr4_fixup(), should be curproc"));
args = (Elf32_Auxargs *)imgp->auxargs;
pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
AUXARGS_ENTRY(pos, AT_PHENT, args->phent);
AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);
AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
AUXARGS_ENTRY(pos, AT_BASE, args->base);
AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid);
AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, AT_NULL, 0);
free(imgp->auxargs, M_TEMP);
imgp->auxargs = NULL;
(*stack_base)--;
**stack_base = (register_t)imgp->args->argc;
return 0;
}
/*
* Search an alternate path before passing pathname arguments on
* to system calls. Useful for keeping a separate 'emulation tree'.
*
* If cflag is set, we check if an attempt can be made to create
* the named file, i.e. we check if the directory it should
* be in exists.
*/
int
svr4_emul_find(struct thread *td, char *path, enum uio_seg pathseg,
char **pbuf, int create)
{
return (kern_alternate_path(td, svr4_emul_path, path, pathseg, pbuf,
create, AT_FDCWD));
}
static int
svr4_elf_modevent(module_t mod, int type, void *data)
{
int error;
error = 0;
switch(type) {
case MOD_LOAD:
if (elf32_insert_brand_entry(&svr4_brand) < 0) {
printf("cannot insert svr4 elf brand handler\n");
error = EINVAL;
break;
}
if (bootverbose)
printf("svr4 ELF exec handler installed\n");
svr4_sockcache_init();
break;
case MOD_UNLOAD:
/* Only allow the emulator to be removed if it isn't in use. */
if (elf32_brand_inuse(&svr4_brand) != 0) {
error = EBUSY;
} else if (elf32_remove_brand_entry(&svr4_brand) < 0) {
error = EINVAL;
}
if (error) {
printf("Could not deinstall ELF interpreter entry (error %d)\n",
error);
break;
}
if (bootverbose)
printf("svr4 ELF exec handler removed\n");
svr4_sockcache_destroy();
break;
default:
return (EOPNOTSUPP);
break;
}
return error;
}
static moduledata_t svr4_elf_mod = {
"svr4elf",
svr4_elf_modevent,
0
};
DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
MODULE_VERSION(svr4elf, 1);

View File

@ -1,612 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/tty.h>
#include <sys/sysproto.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_ioctl.h>
#include <compat/svr4/svr4_termios.h>
#ifndef __CONCAT3
# if __STDC__
# define __CONCAT3(a,b,c) a ## b ## c
# else
# define __CONCAT3(a,b,c) a/**/b/**/c
# endif
#endif
static u_long bsd_to_svr4_speed(u_long, u_long);
static u_long svr4_to_bsd_speed(u_long, u_long);
static void svr4_to_bsd_termios(const struct svr4_termios *,
struct termios *, int);
static void bsd_to_svr4_termios(const struct termios *,
struct svr4_termios *);
static void svr4_termio_to_termios(const struct svr4_termio *,
struct svr4_termios *);
static void svr4_termios_to_termio(const struct svr4_termios *,
struct svr4_termio *);
#ifdef DEBUG_SVR4
static void print_svr4_termios(const struct svr4_termios *);
static void print_bsd_termios(const struct termios *);
#endif /* DEBUG_SVR4 */
#define undefined_char(a,b) /**/
#define undefined_flag1(f,a,b) /**/
#define undefined_flag2(f,a,b,c1,t1,c2,t2) /**/
#define undefined_flag4(f,a,b,c1,t1,c2,t2,c3,t3,c4,t4) /**/
#define svr4_to_bsd_char(a,b) \
if (new || __CONCAT3(SVR4_,a,b) < SVR4_NCC) { \
if (st->c_cc[__CONCAT3(SVR4_,a,b)] == SVR4_POSIX_VDISABLE) \
bt->c_cc[__CONCAT(a,b)] = _POSIX_VDISABLE; \
else \
bt->c_cc[__CONCAT(a,b)] = st->c_cc[__CONCAT3(SVR4_,a,b)]; \
}
#define svr4_to_bsd_flag1(f,a,b) \
if (new || __CONCAT3(SVR4_,a,b) < 0200000) { \
if (st->f & __CONCAT3(SVR4_,a,b)) \
bt->f |= __CONCAT(a,b); \
else \
bt->f &= ~__CONCAT(a,b); \
}
#define svr4_to_bsd_flag2(f,a,b,c1,t1,c2,t2) \
if (new || __CONCAT3(SVR4_,a,b) < 0200000) { \
bt->f &= ~__CONCAT(a,b); \
switch (st->f & __CONCAT3(SVR4_,a,b)) { \
case __CONCAT3(SVR4_,c1,t1): bt->f |= __CONCAT(c1,t1); break; \
case __CONCAT3(SVR4_,c2,t2): bt->f |= __CONCAT(c2,t2); break; \
} \
}
#define svr4_to_bsd_flag4(f,a,b,c1,t1,c2,t2,c3,t3,c4,t4) \
if (new || __CONCAT3(SVR4_,a,b) < 0200000) { \
bt->f &= ~__CONCAT(a,b); \
switch (st->f & __CONCAT3(SVR4_,a,b)) { \
case __CONCAT3(SVR4_,c1,t1): bt->f |= __CONCAT(c1,t1); break; \
case __CONCAT3(SVR4_,c2,t2): bt->f |= __CONCAT(c2,t2); break; \
case __CONCAT3(SVR4_,c3,t3): bt->f |= __CONCAT(c3,t3); break; \
case __CONCAT3(SVR4_,c4,t4): bt->f |= __CONCAT(c4,t4); break; \
} \
}
#define bsd_to_svr4_char(a,b) \
if (bt->c_cc[__CONCAT(a,b)] == _POSIX_VDISABLE) \
st->c_cc[__CONCAT3(SVR4_,a,b)] = SVR4_POSIX_VDISABLE; \
else \
st->c_cc[__CONCAT3(SVR4_,a,b)] = bt->c_cc[__CONCAT(a,b)]
#define bsd_to_svr4_flag1(f,a,b) \
if (bt->f & __CONCAT(a,b)) \
st->f |= __CONCAT3(SVR4_,a,b); \
else \
st->f &= ~__CONCAT3(SVR4_,a,b)
#define bsd_to_svr4_flag2(f,a,b,c1,t1,c2,t2) \
st->f &= ~__CONCAT(a,b); \
switch (bt->f & __CONCAT(a,b)) { \
case __CONCAT(c1,t1): st->f |= __CONCAT3(SVR4_,c1,t1); break; \
case __CONCAT(c2,t2): st->f |= __CONCAT3(SVR4_,c2,t2); break; \
}
#define bsd_to_svr4_flag4(f,a,b,c1,t1,c2,t2,c3,t3,c4,t4) \
st->f &= ~__CONCAT(a,b); \
switch (bt->f & __CONCAT(a,b)) { \
case __CONCAT(c1,t1): st->f |= __CONCAT3(SVR4_,c1,t1); break; \
case __CONCAT(c2,t2): st->f |= __CONCAT3(SVR4_,c2,t2); break; \
case __CONCAT(c3,t3): st->f |= __CONCAT3(SVR4_,c3,t3); break; \
case __CONCAT(c4,t4): st->f |= __CONCAT3(SVR4_,c4,t4); break; \
}
#ifdef DEBUG_SVR4
static void
print_svr4_termios(st)
const struct svr4_termios *st;
{
int i;
DPRINTF(("SVR4\niflag=%lo oflag=%lo cflag=%lo lflag=%lo\n",
st->c_iflag, st->c_oflag, st->c_cflag, st->c_lflag));
DPRINTF(("cc: "));
for (i = 0; i < SVR4_NCCS; i++)
DPRINTF(("%o ", st->c_cc[i]));
DPRINTF(("\n"));
}
static void
print_bsd_termios(bt)
const struct termios *bt;
{
int i;
uprintf("BSD\niflag=%o oflag=%o cflag=%o lflag=%o\n",
bt->c_iflag, bt->c_oflag, bt->c_cflag, bt->c_lflag);
uprintf("cc: ");
for (i = 0; i < NCCS; i++)
uprintf("%o ", bt->c_cc[i]);
uprintf("\n");
}
#endif /* DEBUG_SVR4 */
static u_long
bsd_to_svr4_speed(sp, mask)
u_long sp;
u_long mask;
{
switch (sp) {
#undef getval
#define getval(a,b) case __CONCAT(a,b): sp = __CONCAT3(SVR4_,a,b)
getval(B,0);
getval(B,50);
getval(B,75);
getval(B,110);
getval(B,134);
getval(B,150);
getval(B,200);
getval(B,300);
getval(B,600);
getval(B,1200);
getval(B,1800);
getval(B,2400);
getval(B,4800);
getval(B,9600);
getval(B,19200);
getval(B,38400);
getval(B,57600);
getval(B,115200);
default: sp = SVR4_B9600; /* XXX */
}
while ((mask & 1) == 0) {
mask >>= 1;
sp <<= 1;
}
return sp;
}
static u_long
svr4_to_bsd_speed(sp, mask)
u_long sp;
u_long mask;
{
while ((mask & 1) == 0) {
mask >>= 1;
sp >>= 1;
}
switch (sp & mask) {
#undef getval
#define getval(a,b) case __CONCAT3(SVR4_,a,b): return __CONCAT(a,b)
getval(B,0);
getval(B,50);
getval(B,75);
getval(B,110);
getval(B,134);
getval(B,150);
getval(B,200);
getval(B,300);
getval(B,600);
getval(B,1200);
getval(B,1800);
getval(B,2400);
getval(B,4800);
getval(B,9600);
getval(B,19200);
getval(B,38400);
getval(B,57600);
getval(B,115200);
default: return B9600; /* XXX */
}
}
static void
svr4_to_bsd_termios(st, bt, new)
const struct svr4_termios *st;
struct termios *bt;
int new;
{
/* control characters */
/*
* We process VMIN and VTIME first,
* because they are shared with VEOF and VEOL
*/
svr4_to_bsd_char(V,MIN);
svr4_to_bsd_char(V,TIME);
svr4_to_bsd_char(V,INTR);
svr4_to_bsd_char(V,QUIT);
svr4_to_bsd_char(V,ERASE);
svr4_to_bsd_char(V,KILL);
svr4_to_bsd_char(V,EOF);
svr4_to_bsd_char(V,EOL);
svr4_to_bsd_char(V,EOL2);
undefined_char(V,SWTCH);
svr4_to_bsd_char(V,START);
svr4_to_bsd_char(V,STOP);
svr4_to_bsd_char(V,SUSP);
svr4_to_bsd_char(V,DSUSP);
svr4_to_bsd_char(V,REPRINT);
svr4_to_bsd_char(V,DISCARD);
svr4_to_bsd_char(V,WERASE);
svr4_to_bsd_char(V,LNEXT);
/* Input modes */
svr4_to_bsd_flag1(c_iflag,I,GNBRK);
svr4_to_bsd_flag1(c_iflag,B,RKINT);
svr4_to_bsd_flag1(c_iflag,I,GNPAR);
svr4_to_bsd_flag1(c_iflag,P,ARMRK);
svr4_to_bsd_flag1(c_iflag,I,NPCK);
svr4_to_bsd_flag1(c_iflag,I,STRIP);
svr4_to_bsd_flag1(c_iflag,I,NLCR);
svr4_to_bsd_flag1(c_iflag,I,GNCR);
svr4_to_bsd_flag1(c_iflag,I,CRNL);
undefined_flag1(c_iflag,I,UCLC);
svr4_to_bsd_flag1(c_iflag,I,XON);
svr4_to_bsd_flag1(c_iflag,I,XANY);
svr4_to_bsd_flag1(c_iflag,I,XOFF);
svr4_to_bsd_flag1(c_iflag,I,MAXBEL);
undefined_flag1(c_iflag,D,OSMODE);
/* Output modes */
svr4_to_bsd_flag1(c_oflag,O,POST);
undefined_flag1(c_oflag,O,LCUC);
svr4_to_bsd_flag1(c_oflag,O,NLCR);
undefined_flag1(c_oflag,O,CRNL);
undefined_flag1(c_oflag,O,NOCR);
undefined_flag1(c_oflag,O,NLRET);
undefined_flag1(c_oflag,O,FILL);
undefined_flag1(c_oflag,O,FDEL);
undefined_flag2(c_oflag,N,LDLY,N,L0,N,L1);
undefined_flag4(c_oflag,C,RDLY,C,R0,C,R1,C,R2,C,R3);
undefined_flag4(c_oflag,T,ABDLY,T,AB0,T,AB1,T,AB2,T,AB3);
undefined_flag2(c_oflag,B,SDLY,B,S0,B,S1);
undefined_flag2(c_oflag,V,TDLY,V,T0,V,T1);
undefined_flag2(c_oflag,F,FDLY,F,F0,F,F1);
undefined_flag1(c_oflag,P,AGEOUT);
undefined_flag1(c_oflag,W,RAP);
/* Control modes */
bt->c_ospeed = svr4_to_bsd_speed(st->c_cflag, SVR4_CBAUD);
svr4_to_bsd_flag4(c_cflag,C,SIZE,C,S5,C,S6,C,S7,C,S8)
svr4_to_bsd_flag1(c_cflag,C,STOPB);
svr4_to_bsd_flag1(c_cflag,C,READ);
svr4_to_bsd_flag1(c_cflag,P,ARENB);
svr4_to_bsd_flag1(c_cflag,P,ARODD);
svr4_to_bsd_flag1(c_cflag,H,UPCL);
svr4_to_bsd_flag1(c_cflag,C,LOCAL);
undefined_flag1(c_cflag,R,CV1EN);
undefined_flag1(c_cflag,X,MT1EN);
undefined_flag1(c_cflag,L,OBLK);
undefined_flag1(c_cflag,X,CLUDE);
bt->c_ispeed = svr4_to_bsd_speed(st->c_cflag, SVR4_CIBAUD);
undefined_flag1(c_cflag,P,AREXT);
/* line discipline modes */
svr4_to_bsd_flag1(c_lflag,I,SIG);
svr4_to_bsd_flag1(c_lflag,I,CANON);
undefined_flag1(c_lflag,X,CASE);
svr4_to_bsd_flag1(c_lflag,E,CHO);
svr4_to_bsd_flag1(c_lflag,E,CHOE);
svr4_to_bsd_flag1(c_lflag,E,CHOK);
svr4_to_bsd_flag1(c_lflag,E,CHONL);
svr4_to_bsd_flag1(c_lflag,N,OFLSH);
svr4_to_bsd_flag1(c_lflag,T,OSTOP);
svr4_to_bsd_flag1(c_lflag,E,CHOCTL);
svr4_to_bsd_flag1(c_lflag,E,CHOPRT);
svr4_to_bsd_flag1(c_lflag,E,CHOKE);
undefined_flag1(c_lflag,D,EFECHO);
svr4_to_bsd_flag1(c_lflag,F,LUSHO);
svr4_to_bsd_flag1(c_lflag,P,ENDIN);
svr4_to_bsd_flag1(c_lflag,I,EXTEN);
}
static void
bsd_to_svr4_termios(bt, st)
const struct termios *bt;
struct svr4_termios *st;
{
/* control characters */
/*
* We process VMIN and VTIME first,
* because they are shared with VEOF and VEOL
*/
bsd_to_svr4_char(V,MIN);
bsd_to_svr4_char(V,TIME);
bsd_to_svr4_char(V,INTR);
bsd_to_svr4_char(V,QUIT);
bsd_to_svr4_char(V,ERASE);
bsd_to_svr4_char(V,KILL);
bsd_to_svr4_char(V,EOF);
bsd_to_svr4_char(V,EOL);
bsd_to_svr4_char(V,EOL2);
undefined_char(V,SWTCH);
bsd_to_svr4_char(V,START);
bsd_to_svr4_char(V,STOP);
bsd_to_svr4_char(V,SUSP);
bsd_to_svr4_char(V,DSUSP);
bsd_to_svr4_char(V,REPRINT);
bsd_to_svr4_char(V,DISCARD);
bsd_to_svr4_char(V,WERASE);
bsd_to_svr4_char(V,LNEXT);
/* Input modes */
bsd_to_svr4_flag1(c_iflag,I,GNBRK);
bsd_to_svr4_flag1(c_iflag,B,RKINT);
bsd_to_svr4_flag1(c_iflag,I,GNPAR);
bsd_to_svr4_flag1(c_iflag,P,ARMRK);
bsd_to_svr4_flag1(c_iflag,I,NPCK);
bsd_to_svr4_flag1(c_iflag,I,STRIP);
bsd_to_svr4_flag1(c_iflag,I,NLCR);
bsd_to_svr4_flag1(c_iflag,I,GNCR);
bsd_to_svr4_flag1(c_iflag,I,CRNL);
undefined_flag1(c_iflag,I,UCLC);
bsd_to_svr4_flag1(c_iflag,I,XON);
bsd_to_svr4_flag1(c_iflag,I,XANY);
bsd_to_svr4_flag1(c_iflag,I,XOFF);
bsd_to_svr4_flag1(c_iflag,I,MAXBEL);
undefined_flag1(c_iflag,D,OSMODE);
/* Output modes */
bsd_to_svr4_flag1(c_oflag,O,POST);
undefined_flag1(c_oflag,O,LCUC);
bsd_to_svr4_flag1(c_oflag,O,NLCR);
undefined_flag1(c_oflag,O,CRNL);
undefined_flag1(c_oflag,O,NOCR);
undefined_flag1(c_oflag,O,NLRET);
undefined_flag1(c_oflag,O,FILL);
undefined_flag1(c_oflag,O,FDEL);
undefined_flag2(c_oflag,N,LDLY,N,L0,N,L1);
undefined_flag4(c_oflag,C,RDLY,C,R0,C,R1,C,R2,C,R3);
undefined_flag4(c_oflag,T,ABDLY,T,AB0,T,AB1,T,AB2,T,AB3);
undefined_flag2(c_oflag,B,SDLY,B,S0,B,S1);
undefined_flag2(c_oflag,V,TDLY,V,T0,V,T1);
undefined_flag2(c_oflag,F,FDLY,F,F0,F,F1);
undefined_flag1(c_oflag,P,AGEOUT);
undefined_flag1(c_oflag,W,RAP);
/* Control modes */
st->c_cflag &= ~SVR4_CBAUD;
st->c_cflag |= bsd_to_svr4_speed(bt->c_ospeed, SVR4_CBAUD);
bsd_to_svr4_flag4(c_cflag,C,SIZE,C,S5,C,S6,C,S7,C,S8)
bsd_to_svr4_flag1(c_cflag,C,STOPB);
bsd_to_svr4_flag1(c_cflag,C,READ);
bsd_to_svr4_flag1(c_cflag,P,ARENB);
bsd_to_svr4_flag1(c_cflag,P,ARODD);
bsd_to_svr4_flag1(c_cflag,H,UPCL);
bsd_to_svr4_flag1(c_cflag,C,LOCAL);
undefined_flag1(c_cflag,R,CV1EN);
undefined_flag1(c_cflag,X,MT1EN);
undefined_flag1(c_cflag,L,OBLK);
undefined_flag1(c_cflag,X,CLUDE);
st->c_cflag &= ~SVR4_CIBAUD;
st->c_cflag |= bsd_to_svr4_speed(bt->c_ispeed, SVR4_CIBAUD);
undefined_flag1(c_oflag,P,AREXT);
/* line discipline modes */
bsd_to_svr4_flag1(c_lflag,I,SIG);
bsd_to_svr4_flag1(c_lflag,I,CANON);
undefined_flag1(c_lflag,X,CASE);
bsd_to_svr4_flag1(c_lflag,E,CHO);
bsd_to_svr4_flag1(c_lflag,E,CHOE);
bsd_to_svr4_flag1(c_lflag,E,CHOK);
bsd_to_svr4_flag1(c_lflag,E,CHONL);
bsd_to_svr4_flag1(c_lflag,N,OFLSH);
bsd_to_svr4_flag1(c_lflag,T,OSTOP);
bsd_to_svr4_flag1(c_lflag,E,CHOCTL);
bsd_to_svr4_flag1(c_lflag,E,CHOPRT);
bsd_to_svr4_flag1(c_lflag,E,CHOKE);
undefined_flag1(c_lflag,D,EFECHO);
bsd_to_svr4_flag1(c_lflag,F,LUSHO);
bsd_to_svr4_flag1(c_lflag,P,ENDIN);
bsd_to_svr4_flag1(c_lflag,I,EXTEN);
}
static void
svr4_termio_to_termios(t, ts)
const struct svr4_termio *t;
struct svr4_termios *ts;
{
int i;
ts->c_iflag = (svr4_tcflag_t) t->c_iflag;
ts->c_oflag = (svr4_tcflag_t) t->c_oflag;
ts->c_cflag = (svr4_tcflag_t) t->c_cflag;
ts->c_lflag = (svr4_tcflag_t) t->c_lflag;
for (i = 0; i < SVR4_NCC; i++)
ts->c_cc[i] = (svr4_cc_t) t->c_cc[i];
}
static void
svr4_termios_to_termio(ts, t)
const struct svr4_termios *ts;
struct svr4_termio *t;
{
int i;
t->c_iflag = (u_short) ts->c_iflag;
t->c_oflag = (u_short) ts->c_oflag;
t->c_cflag = (u_short) ts->c_cflag;
t->c_lflag = (u_short) ts->c_lflag;
t->c_line = 0; /* XXX */
for (i = 0; i < SVR4_NCC; i++)
t->c_cc[i] = (u_char) ts->c_cc[i];
}
int
svr4_term_ioctl(fp, td, retval, fd, cmd, data)
struct file *fp;
struct thread *td;
register_t *retval;
int fd;
u_long cmd;
caddr_t data;
{
struct termios bt;
struct svr4_termios st;
struct svr4_termio t;
int error, new;
*retval = 0;
DPRINTF(("TERM ioctl %lx\n", cmd));
switch (cmd) {
case SVR4_TCGETA:
case SVR4_TCGETS:
DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S'));
if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt,
td->td_ucred, td)) != 0)
return error;
memset(&st, 0, sizeof(st));
bsd_to_svr4_termios(&bt, &st);
#ifdef DEBUG_SVR4
print_bsd_termios(&bt);
print_svr4_termios(&st);
#endif /* DEBUG_SVR4 */
if (cmd == SVR4_TCGETA) {
svr4_termios_to_termio(&st, &t);
return copyout(&t, data, sizeof(t));
}
else {
return copyout(&st, data, sizeof(st));
}
case SVR4_TCSETA:
case SVR4_TCSETS:
case SVR4_TCSETAW:
case SVR4_TCSETSW:
case SVR4_TCSETAF:
case SVR4_TCSETSF:
DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n"));
/* get full BSD termios so we don't lose information */
if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt,
td->td_ucred, td)) != 0)
return error;
switch (cmd) {
case SVR4_TCSETS:
case SVR4_TCSETSW:
case SVR4_TCSETSF:
if ((error = copyin(data, &st, sizeof(st))) != 0)
return error;
new = 1;
break;
case SVR4_TCSETA:
case SVR4_TCSETAW:
case SVR4_TCSETAF:
if ((error = copyin(data, &t, sizeof(t))) != 0)
return error;
svr4_termio_to_termios(&t, &st);
new = 0;
break;
default:
return EINVAL;
}
svr4_to_bsd_termios(&st, &bt, new);
switch (cmd) {
case SVR4_TCSETA:
case SVR4_TCSETS:
DPRINTF(("ioctl(TCSET[A|S]);\n"));
cmd = TIOCSETA;
break;
case SVR4_TCSETAW:
case SVR4_TCSETSW:
DPRINTF(("ioctl(TCSET[A|S]W);\n"));
cmd = TIOCSETAW;
break;
case SVR4_TCSETAF:
case SVR4_TCSETSF:
DPRINTF(("ioctl(TCSET[A|S]F);\n"));
cmd = TIOCSETAF;
break;
}
#ifdef DEBUG_SVR4
print_bsd_termios(&bt);
print_svr4_termios(&st);
#endif /* DEBUG_SVR4 */
return fo_ioctl(fp, cmd, (caddr_t) &bt, td->td_ucred, td);
case SVR4_TIOCGWINSZ:
DPRINTF(("TIOCGWINSZ\n"));
{
struct svr4_winsize ws;
error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws,
td->td_ucred, td);
if (error)
return error;
return copyout(&ws, data, sizeof(ws));
}
case SVR4_TIOCSWINSZ:
DPRINTF(("TIOCSWINSZ\n"));
{
struct svr4_winsize ws;
if ((error = copyin(data, &ws, sizeof(ws))) != 0)
return error;
return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws,
td->td_ucred, td);
}
default:
DPRINTF(("teleport to STREAMS ioctls...\n"));
return svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, data);
}
}

View File

@ -1,224 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_TERMIOS_H_
#define _SVR4_TERMIOS_H_
#define SVR4_POSIX_VDISABLE 0
#define SVR4_NCC 8
#define SVR4_NCCS 19
typedef u_long svr4_tcflag_t;
typedef u_char svr4_cc_t;
typedef u_long svr4_speed_t;
struct svr4_termios {
svr4_tcflag_t c_iflag;
svr4_tcflag_t c_oflag;
svr4_tcflag_t c_cflag;
svr4_tcflag_t c_lflag;
svr4_cc_t c_cc[SVR4_NCCS];
};
struct svr4_termio {
u_short c_iflag;
u_short c_oflag;
u_short c_cflag;
u_short c_lflag;
char c_line;
u_char c_cc[SVR4_NCC];
};
/* control characters */
#define SVR4_VINTR 0
#define SVR4_VQUIT 1
#define SVR4_VERASE 2
#define SVR4_VKILL 3
#define SVR4_VEOF 4
#define SVR4_VEOL 5
#define SVR4_VEOL2 6
#define SVR4_VMIN 4
#define SVR4_VTIME 5
#define SVR4_VSWTCH 7
#define SVR4_VSTART 8
#define SVR4_VSTOP 9
#define SVR4_VSUSP 10
#define SVR4_VDSUSP 11
#define SVR4_VREPRINT 12
#define SVR4_VDISCARD 13
#define SVR4_VWERASE 14
#define SVR4_VLNEXT 15
/* Input modes */
#define SVR4_IGNBRK 00000001
#define SVR4_BRKINT 00000002
#define SVR4_IGNPAR 00000004
#define SVR4_PARMRK 00000010
#define SVR4_INPCK 00000020
#define SVR4_ISTRIP 00000040
#define SVR4_INLCR 00000100
#define SVR4_IGNCR 00000200
#define SVR4_ICRNL 00000400
#define SVR4_IUCLC 00001000
#define SVR4_IXON 00002000
#define SVR4_IXANY 00004000
#define SVR4_IXOFF 00010000
#define SVR4_IMAXBEL 00020000
#define SVR4_DOSMODE 00100000
/* Output modes */
#define SVR4_OPOST 00000001
#define SVR4_OLCUC 00000002
#define SVR4_ONLCR 00000004
#define SVR4_OCRNL 00000010
#define SVR4_ONOCR 00000020
#define SVR4_ONLRET 00000040
#define SVR4_OFILL 00000100
#define SVR4_OFDEL 00000200
#define SVR4_NLDLY 00000400
#define SVR4_NL0 00000000
#define SVR4_NL1 00000400
#define SVR4_CRDLY 00003000
#define SVR4_CR0 00000000
#define SVR4_CR1 00001000
#define SVR4_CR2 00002000
#define SVR4_CR3 00003000
#define SVR4_TABDLY 00014000
#define SVR4_TAB0 00000000
#define SVR4_TAB1 00004000
#define SVR4_TAB2 00010000
#define SVR4_TAB3 00014000
#define SVR4_XTABS 00014000
#define SVR4_BSDLY 00020000
#define SVR4_BS0 00000000
#define SVR4_BS1 00020000
#define SVR4_VTDLY 00040000
#define SVR4_VT0 00000000
#define SVR4_VT1 00040000
#define SVR4_FFDLY 00100000
#define SVR4_FF0 00000000
#define SVR4_FF1 00100000
#define SVR4_PAGEOUT 00200000
#define SVR4_WRAP 00400000
/* Control modes */
#define SVR4_CBAUD 00000017
#define SVR4_CSIZE 00000060
#define SVR4_CS5 00000000
#define SVR4_CS6 00000200
#define SVR4_CS7 00000040
#define SVR4_CS8 00000006
#define SVR4_CSTOPB 00000100
#define SVR4_CREAD 00000200
#define SVR4_PARENB 00000400
#define SVR4_PARODD 00001000
#define SVR4_HUPCL 00002000
#define SVR4_CLOCAL 00004000
#define SVR4_RCV1EN 00010000
#define SVR4_XMT1EN 00020000
#define SVR4_LOBLK 00040000
#define SVR4_XCLUDE 00100000
#define SVR4_CIBAUD 03600000
#define SVR4_PAREXT 04000000
/* line discipline modes */
#define SVR4_ISIG 00000001
#define SVR4_ICANON 00000002
#define SVR4_XCASE 00000004
#define SVR4_ECHO 00000010
#define SVR4_ECHOE 00000020
#define SVR4_ECHOK 00000040
#define SVR4_ECHONL 00000100
#define SVR4_NOFLSH 00000200
#define SVR4_TOSTOP 00000400
#define SVR4_ECHOCTL 00001000
#define SVR4_ECHOPRT 00002000
#define SVR4_ECHOKE 00004000
#define SVR4_DEFECHO 00010000
#define SVR4_FLUSHO 00020000
#define SVR4_PENDIN 00040000
#define SVR4_IEXTEN 00100000
#define SVR4_TIOC ('T' << 8)
#define SVR4_TCGETA (SVR4_TIOC| 1)
#define SVR4_TCSETA (SVR4_TIOC| 2)
#define SVR4_TCSETAW (SVR4_TIOC| 3)
#define SVR4_TCSETAF (SVR4_TIOC| 4)
#define SVR4_TCSBRK (SVR4_TIOC| 5)
#define SVR4_TCXONC (SVR4_TIOC| 6)
#define SVR4_TCFLSH (SVR4_TIOC| 7)
#define SVR4_TIOCKBON (SVR4_TIOC| 8)
#define SVR4_TIOCKBOF (SVR4_TIOC| 9)
#define SVR4_KBENABLED (SVR4_TIOC|10)
#define SVR4_TCGETS (SVR4_TIOC|13)
#define SVR4_TCSETS (SVR4_TIOC|14)
#define SVR4_TCSETSW (SVR4_TIOC|15)
#define SVR4_TCSETSF (SVR4_TIOC|16)
#define SVR4_TCDSET (SVR4_TIOC|32)
#define SVR4_RTS_TOG (SVR4_TIOC|33)
#define SVR4_TCGETSC (SVR4_TIOC|34)
#define SVR4_TCSETSC (SVR4_TIOC|35)
#define SVR4_TCMOUSE (SVR4_TIOC|36)
#define SVR4_TIOCGWINSZ (SVR4_TIOC|104)
#define SVR4_TIOCSWINSZ (SVR4_TIOC|103)
struct svr4_winsize {
u_short ws_row;
u_short ws_col;
u_short ws_xpixel;
u_short ws_ypixel;
};
#define SVR4_B0 0
#define SVR4_B50 1
#define SVR4_B75 2
#define SVR4_B110 3
#define SVR4_B134 4
#define SVR4_B150 5
#define SVR4_B200 6
#define SVR4_B300 7
#define SVR4_B600 8
#define SVR4_B1200 9
#define SVR4_B1800 10
#define SVR4_B2400 11
#define SVR4_B4800 12
#define SVR4_B9600 13
#define SVR4_B19200 14
#define SVR4_B38400 15
#define SVR4_B57600 16
#define SVR4_B76800 17
#define SVR4_B115200 18
#define SVR4_B153600 19
#define SVR4_B230400 20
#define SVR4_B307200 21
#define SVR4_B460800 22
#endif /* !_SVR4_TERMIOS_H_ */

View File

@ -1,41 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_TIME_H_
#define _SVR4_TIME_H_
#include <sys/time.h>
struct svr4_utimbuf {
time_t actime;
time_t modtime;
};
#endif /* !_SVR4_TIME_H_ */

View File

@ -1,87 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_TIMOD_H_
#define _SVR4_TIMOD_H_
#define SVR4_TIMOD ('T' << 8)
#define SVR4_TI_GETINFO (SVR4_TIMOD|140)
#define SVR4_TI_OPTMGMT (SVR4_TIMOD|141)
#define SVR4_TI_BIND (SVR4_TIMOD|142)
#define SVR4_TI_UNBIND (SVR4_TIMOD|143)
#define SVR4_TI_GETMYNAME (SVR4_TIMOD|144)
#define SVR4_TI_GETPEERNAME (SVR4_TIMOD|145)
#define SVR4_TI_SETMYNAME (SVR4_TIMOD|146)
#define SVR4_TI_SETPEERNAME (SVR4_TIMOD|147)
#define SVR4_TI_SYNC (SVR4_TIMOD|148)
#define SVR4_TI_GETADDRS (SVR4_TIMOD|149)
#define SVR4_TI_CONNECT_REQUEST 0x00
#define SVR4_TI_CONNECT_RESPONSE 0x01
#define SVR4_TI_DISCONNECT_REQUEST 0x02
#define SVR4_TI_DATA_REQUEST 0x03
#define SVR4_TI_EXPDATA_REQUEST 0x04
#define SVR4_TI_INFO_REQUEST 0x05
#define SVR4_TI_OLD_BIND_REQUEST 0x06
#define SVR4_TI_UNBIND_REQUEST 0x07
#define SVR4_TI_SENDTO_REQUEST 0x08
#define SVR4_TI_OLD_OPTMGMT_REQUEST 0x09
#define SVR4_TI_ORDREL_REQUEST 0x0a
#define SVR4_TI_ACCEPT_REPLY 0x0b
#define SVR4_TI_CONNECT_REPLY 0x0c
#define SVR4_TI_DISCONNECT_IND 0x0d
#define SVR4_TI_DATA_IND 0x0e
#define SVR4_TI_EXPDATA_IND 0x0f
#define SVR4_TI_INFO_REPLY 0x10
#define SVR4_TI_BIND_REPLY 0x11
#define SVR4_TI_ERROR_REPLY 0x12
#define SVR4_TI_OK_REPLY 0x13
#define SVR4_TI_RECVFROM_IND 0x14
#define SVR4_TI_RECVFROM_ERROR_IND 0x15
#define SVR4_TI_OPTMGMT_REPLY 0x16
#define SVR4_TI_ORDREL_IND 0x17
#define SVR4_TI_ADDRESS_REQUEST 0x18
#define SVR4_TI_ADDRESS_REPLY 0x19
#define SVR4_TI_BIND_REQUEST 0x20
#define SVR4_TI_OPTMGMT_REQUEST 0x21
#define SVR4_TI__ACCEPT_WAIT 0x10000001
#define SVR4_TI__ACCEPT_OK 0x10000002
struct svr4_netbuf {
u_int maxlen;
u_int len;
char *buf;
};
#endif /* !_SVR4_TIMOD_H_ */

View File

@ -1,81 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_TYPES_H_
#define _SVR4_TYPES_H_
typedef u_quad_t svr4_ino64_t;
typedef quad_t svr4_off64_t;
typedef quad_t svr4_blkcnt64_t;
typedef u_quad_t svr4_fsblkcnt64_t;
typedef long svr4_off_t;
typedef u_long svr4_dev_t;
typedef u_long svr4_ino_t;
typedef u_long svr4_mode_t;
typedef u_long svr4_nlink_t;
typedef long svr4_uid_t;
typedef long svr4_gid_t;
typedef long svr4_daddr_t;
typedef long svr4_pid_t;
typedef long svr4_time_t;
typedef long svr4_blkcnt_t;
typedef u_long svr4_fsblkcnt_t;
typedef char *svr4_caddr_t;
typedef u_int svr4_size_t;
typedef short svr4_o_dev_t;
typedef short svr4_o_pid_t;
typedef u_short svr4_o_ino_t;
typedef u_short svr4_o_mode_t;
typedef short svr4_o_nlink_t;
typedef u_short svr4_o_uid_t;
typedef u_short svr4_o_gid_t;
typedef long svr4_clock_t;
typedef int svr4_key_t;
typedef struct timespec svr4_timestruc_t;
#define svr4_omajor(x) ((int32_t)((((x) & 0x7f00) >> 8)))
#define svr4_ominor(x) ((int32_t)((((x) & 0x00ff) >> 0)))
#define svr4_omakedev(x,y) ((svr4_o_dev_t)((((x) << 8) & 0x7f00) | \
(((y) << 0) & 0x00ff)))
#define svr4_to_bsd_odev_t(d) makedev(svr4_omajor(d), svr4_ominor(d))
#define bsd_to_svr4_odev_t(d) svr4_omakedev(major(d), minor(d))
#define svr4_major(x) ((int32_t)((((x) & 0xfffc0000) >> 18)))
#define svr4_minor(x) ((int32_t)((((x) & 0x0003ffff) >> 0)))
#define svr4_makedev(x,y) ((svr4_dev_t)((((x) << 18) & 0xfffc0000) | \
(((y) << 0) & 0x0003ffff)))
#define svr4_to_bsd_dev_t(d) makedev(svr4_major(d), svr4_minor(d))
#define bsd_to_svr4_dev_t(d) svr4_makedev(major(d), minor(d))
#endif /* !_SVR4_TYPES_H_ */

View File

@ -1,74 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_UCONTEXT_H_
#define _SVR4_UCONTEXT_H_
/*
* Machine context
*/
#define SVR4_UC_SIGMASK 0x01
#define SVR4_UC_STACK 0x02
#define SVR4_UC_CPU 0x04
#define SVR4_UC_FPU 0x08
#define SVR4_UC_WEITEK 0x10
#define SVR4_UC_MCONTEXT (SVR4_UC_CPU|SVR4_UC_FPU|SVR4_UC_WEITEK)
#define SVR4_UC_ALL (SVR4_UC_SIGMASK|SVR4_UC_STACK|SVR4_UC_MCONTEXT)
typedef struct svr4_ucontext {
u_long uc_flags;
/* struct svr4_ucontext *uc_link;*/
void *uc_link;
svr4_sigset_t uc_sigmask;
struct svr4_sigaltstack uc_stack;
svr4_mcontext_t uc_mcontext;
long uc_pad[5];
} svr4_ucontext_t;
#define SVR4_UC_GETREGSET 0
#define SVR4_UC_SETREGSET 1
/*
* Signal frame
*/
struct svr4_sigframe {
int sf_signum;
union svr4_siginfo *sf_sip;
struct svr4_ucontext *sf_ucp;
sig_t sf_handler;
struct svr4_ucontext sf_uc;
union svr4_siginfo sf_si;
};
#endif /* !_SVR4_UCONTEXT_H_ */

View File

@ -1,41 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_ULIMIT_H_
#define _SVR4_ULIMIT_H_
#define SVR4_GFILLIM 1
#define SVR4_SFILLIM 2
#define SVR4_GMEMLIM 3
#define SVR4_GDESLIM 4
#define SVR4_GTXTOFF 64
#endif /* !_SVR4_ULIMIT_H_ */

View File

@ -1,43 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_USTAT_H_
#define _SVR4_USTAT_H_
#include <compat/svr4/svr4_types.h>
struct svr4_ustat {
svr4_daddr_t f_tfree;
svr4_ino_t f_tinode;
char f_fname[6];
char f_fpack[6];
};
#endif /* !_SVR4_USTAT_H_ */

View File

@ -1,63 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_UTIL_H_
#define _SVR4_UTIL_H_
/*#include <compat/common/compat_util.h>*/
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/cdefs.h>
#include <sys/uio.h>
#ifdef DEBUG_SVR4
#define DPRINTF(a) uprintf a;
#else
#define DPRINTF(a)
#endif
int svr4_emul_find(struct thread *, char *, enum uio_seg, char **, int);
#define CHECKALT(td, upath, pathp, i) \
do { \
int _error; \
\
_error = svr4_emul_find(td, upath, UIO_USERSPACE, pathp, i); \
if (*(pathp) == NULL) \
return (_error); \
} while (0)
#define CHECKALTEXIST(td, upath, pathp) CHECKALT(td, upath, pathp, 0)
#define CHECKALTCREAT(td, upath, pathp) CHECKALT(td, upath, pathp, 1)
#endif /* !_SVR4_UTIL_H_ */

View File

@ -1,44 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_UTSNAME_H_
#define _SVR4_UTSNAME_H_
#include <compat/svr4/svr4_types.h>
struct svr4_utsname {
char sysname[257];
char nodename[257];
char release[257];
char version[257];
char machine[257];
};
#endif /* !_SVR4_UTSNAME_H_ */

View File

@ -1,56 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _SVR4_WAIT_H_
#define _SVR4_WAIT_H_
#define SVR4_P_PID 0
#define SVR4_P_PPID 1
#define SVR4_P_PGID 2
#define SVR4_P_SID 3
#define SVR4_P_CID 4
#define SVR4_P_UID 5
#define SVR4_P_GID 6
#define SVR4_P_ALL 7
#define SVR4_WEXITED 0x01
#define SVR4_WTRAPPED 0x02
#define SVR4_WSTOPPED 0x04
#define SVR4_WCONTINUED 0x08
#define SVR4_WUNDEF1 0x10
#define SVR4_WUNDEF2 0x20
#define SVR4_WNOHANG 0x40
#define SVR4_WNOWAIT 0x80
#define SVR4_WOPTMASK (SVR4_WEXITED|SVR4_WTRAPPED|SVR4_WSTOPPED|\
SVR4_WCONTINUED|SVR4_WNOHANG|SVR4_WNOWAIT)
#endif /* !_SVR4_WAIT_H_ */

View File

@ -1,11 +0,0 @@
# $FreeBSD$
sysnames="svr4_syscallnames.c"
sysproto="svr4_proto.h"
sysproto_h=_SVR4_SYSPROTO_H_
syshdr="svr4_syscall.h"
syssw="svr4_sysent.c"
sysmk="/dev/null"
syscallprefix="SVR4_SYS_"
switchname="svr4_sysent"
namesname="svr4_syscallnames"
systrace="/dev/null"

View File

@ -1,396 +0,0 @@
$FreeBSD$
; from: @(#)syscalls.master 8.1 (Berkeley) 7/19/93
;
; System call name/number master file (or rather, slave, from SVR4).
; Processed to create svr4_sysent.c, svr4_syscalls.c and svr4_syscall.h.
; Columns: number type nargs name alt{name,tag,rtyp}/comments
; number system call number, must be in order
; audit the audit event associated with the system call
; A value of AUE_NULL means no auditing, but it also means that
; there is no audit event for the call at this time. For the
; case where the event exists, but we don't want auditing, the
; event should be #defined to AUE_NULL in audit_kevents.h.
; type one of STD, OBSOL, UNIMPL, COMPAT
; name psuedo-prototype of syscall routine
; If one of the following alts is different, then all appear:
; altname name of system call if different
; alttag name of args struct tag if different from [o]`name'"_args"
; altrtyp return type if not int (bogus - syscalls always return int)
; for UNIMPL/OBSOL, name continues with comments
; types:
; STD always included
; COMPAT included on COMPAT #ifdef
; OBSOL obsolete, not included in system, only specifies name
; UNIMPL not implemented, placeholder only
; #ifdef's, etc. may be included, and are copied to the output files.
#include <sys/types.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <netinet/in.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_proto.h>
0 AUE_NULL UNIMPL unused
1 AUE_NULL NOPROTO { void sys_exit(int rval); } exit \
sys_exit_args void
2 AUE_NULL NOPROTO { int fork(void); }
3 AUE_NULL NOPROTO { int read(int fd, char *buf, u_int nbyte); }
4 AUE_NULL NOPROTO { int write(int fd, char *buf, u_int nbyte); }
5 AUE_NULL STD { int svr4_sys_open(char *path, int flags, \
int mode); }
6 AUE_NULL NOPROTO { int close(int fd); }
7 AUE_NULL STD { int svr4_sys_wait(int *status); }
8 AUE_NULL STD { int svr4_sys_creat(char *path, int mode); }
9 AUE_NULL NOPROTO { int link(char *path, char *link); }
10 AUE_NULL NOPROTO { int unlink(char *path); }
11 AUE_NULL STD { int svr4_sys_execv(char *path, char **argp); }
12 AUE_NULL NOPROTO { int chdir(char *path); }
13 AUE_NULL STD { int svr4_sys_time(time_t *t); }
14 AUE_NULL STD { int svr4_sys_mknod(char* path, int mode, int dev); }
15 AUE_NULL NOPROTO { int chmod(char *path, int mode); }
16 AUE_NULL NOPROTO { int chown(char *path, uid_t uid, gid_t gid); }
17 AUE_NULL STD { int svr4_sys_break(caddr_t nsize); }
18 AUE_NULL STD { int svr4_sys_stat(char* path, \
struct svr4_stat* ub); }
19 AUE_NULL NOPROTO { int lseek(int filedes, off_t *offset, \
int whence); }
20 AUE_NULL NOPROTO { pid_t getpid(void); }
21 AUE_NULL UNIMPL old_mount
22 AUE_NULL UNIMPL sysv_umount
23 AUE_NULL NOPROTO { int setuid(uid_t uid); }
24 AUE_NULL NOPROTO { uid_t getuid(void); }
25 AUE_NULL UNIMPL stime
26 AUE_NULL UNIMPL ptrace
27 AUE_NULL STD { int svr4_sys_alarm(unsigned sec); }
28 AUE_NULL STD { int svr4_sys_fstat(int fd, \
struct svr4_stat *sb); }
29 AUE_NULL STD { int svr4_sys_pause(void); }
30 AUE_NULL STD { int svr4_sys_utime(char *path, \
struct svr4_utimbuf *ubuf); }
31 AUE_NULL UNIMPL stty
32 AUE_NULL UNIMPL gtty
33 AUE_NULL STD { int svr4_sys_access(char *path, \
int amode); }
34 AUE_NULL STD { int svr4_sys_nice(int prio); }
35 AUE_NULL UNIMPL statfs
36 AUE_NULL NOPROTO { int sync(void); }
37 AUE_NULL STD { int svr4_sys_kill(int pid, int signum); }
38 AUE_NULL UNIMPL fstatfs
39 AUE_NULL STD { int svr4_sys_pgrpsys(int cmd, int pid, \
int pgid); }
40 AUE_NULL UNIMPL xenix
41 AUE_NULL NOPROTO { int dup(u_int fd); }
42 AUE_NULL STD { int svr4_pipe(void); }
43 AUE_NULL STD { int svr4_sys_times(struct tms *tp); }
44 AUE_NULL UNIMPL profil
45 AUE_NULL UNIMPL plock
46 AUE_NULL NOPROTO { int setgid(gid_t gid); }
47 AUE_NULL NOPROTO { gid_t getgid(void); }
48 AUE_NULL STD { int svr4_sys_signal(int signum, \
svr4_sig_t handler); }
49 AUE_NULL STD { int svr4_sys_msgsys(int what, int a2, \
int a3, int a4, int a5); }
50 AUE_NULL STD { int svr4_sys_sysarch(int op, void *a1); }
51 AUE_NULL UNIMPL acct
52 AUE_NULL STD { int svr4_sys_shmsys(int what, int a2, \
int a3, int a4, int a5); }
53 AUE_NULL STD { int svr4_sys_semsys(int what, int a2, \
int a3, int a4, int a5); }
54 AUE_NULL STD { int svr4_sys_ioctl(int fd, u_long com, \
caddr_t data); }
55 AUE_NULL UNIMPL uadmin
56 AUE_NULL UNIMPL exch
57 AUE_NULL STD { int svr4_sys_utssys(void *a1, void *a2, \
int sel, void *a3); }
58 AUE_NULL NOPROTO { int fsync(int fd); }
59 AUE_NULL STD { int svr4_sys_execve(char *path, \
char **argp, char **envp); }
60 AUE_NULL NOPROTO { int umask(int newmask); }
61 AUE_NULL NOPROTO { int chroot(char *path); }
62 AUE_NULL STD { int svr4_sys_fcntl(int fd, int cmd, \
char *arg); }
63 AUE_NULL STD { int svr4_sys_ulimit(int cmd, \
long newlimit); }
64 AUE_NULL UNIMPL reserved
65 AUE_NULL UNIMPL reserved
66 AUE_NULL UNIMPL reserved
67 AUE_NULL UNIMPL reserved
68 AUE_NULL UNIMPL reserved
69 AUE_NULL UNIMPL reserved
70 AUE_NULL UNIMPL advfs
71 AUE_NULL UNIMPL unadvfs
72 AUE_NULL UNIMPL rmount
73 AUE_NULL UNIMPL rumount
74 AUE_NULL UNIMPL rfstart
75 AUE_NULL UNIMPL sigret
76 AUE_NULL UNIMPL rdebug
77 AUE_NULL UNIMPL rfstop
78 AUE_NULL UNIMPL rfsys
79 AUE_NULL NOPROTO { int rmdir(char *path); }
80 AUE_NULL NOPROTO { int mkdir(char *path, int mode); }
81 AUE_NULL STD { int svr4_sys_getdents(int fd, char *buf, \
int nbytes); }
82 AUE_NULL UNIMPL libattach
83 AUE_NULL UNIMPL libdetach
84 AUE_NULL UNIMPL sysfs
85 AUE_NULL STD { int svr4_sys_getmsg(int fd, \
struct svr4_strbuf *ctl, \
struct svr4_strbuf *dat, int *flags); }
86 AUE_NULL STD { int svr4_sys_putmsg(int fd, \
struct svr4_strbuf *ctl, \
struct svr4_strbuf *dat, int flags); }
87 AUE_NULL STD { int svr4_sys_poll(struct pollfd *fds, \
unsigned int nfds, int timeout); }
88 AUE_NULL STD { int svr4_sys_lstat(char *path, \
struct svr4_stat *ub); }
89 AUE_NULL NOPROTO { int symlink(char *path, char *link); }
90 AUE_NULL NOPROTO { int readlink(char *path, char *buf, \
int count); }
91 AUE_NULL NOPROTO { int getgroups(u_int gidsetsize, \
gid_t *gidset); }
92 AUE_NULL NOPROTO { int setgroups(u_int gidsetsize, \
gid_t *gidset); }
93 AUE_NULL NOPROTO { int fchmod(int fd, int mode); }
94 AUE_NULL NOPROTO { int fchown(int fd, int uid, int gid); }
95 AUE_NULL STD { int svr4_sys_sigprocmask(int how, \
svr4_sigset_t *set, \
svr4_sigset_t *oset); }
96 AUE_NULL STD { int svr4_sys_sigsuspend( \
svr4_sigset_t *ss); }
97 AUE_NULL STD { int svr4_sys_sigaltstack( \
struct svr4_sigaltstack *nss, \
struct svr4_sigaltstack *oss); }
98 AUE_NULL STD { int svr4_sys_sigaction(int signum, \
struct svr4_sigaction *nsa, \
struct svr4_sigaction *osa); }
99 AUE_NULL STD { int svr4_sys_sigpending(int what, \
svr4_sigset_t *mask); }
100 AUE_NULL STD { int svr4_sys_context(int func, \
struct svr4_ucontext *uc); }
101 AUE_NULL UNIMPL evsys
102 AUE_NULL UNIMPL evtrapret
103 AUE_NULL STD { int svr4_sys_statvfs(char *path, \
struct svr4_statvfs *fs); }
104 AUE_NULL STD { int svr4_sys_fstatvfs(int fd, \
struct svr4_statvfs *fs); }
105 AUE_NULL UNIMPL whoknows
106 AUE_NULL UNIMPL nfssvc
107 AUE_NULL STD { int svr4_sys_waitsys(int grp, int id, \
union svr4_siginfo *info, int options); }
108 AUE_NULL UNIMPL sigsendsys
109 AUE_NULL STD { int svr4_sys_hrtsys(int cmd, int fun, \
int sub, void *rv1, void *rv2); }
110 AUE_NULL UNIMPL acancel
111 AUE_NULL UNIMPL async
112 AUE_NULL UNIMPL priocntlsys
113 AUE_NULL STD { int svr4_sys_pathconf(char *path, \
int name); }
114 AUE_NULL UNIMPL mincore
115 AUE_NULL STD { caddr_t svr4_sys_mmap(caddr_t addr, \
svr4_size_t len, int prot, int flags, \
int fd, svr4_off_t pos); }
116 AUE_NULL NOPROTO { int mprotect(void *addr, int len, \
int prot); }
117 AUE_NULL NOPROTO { int munmap(void *addr, int len); }
118 AUE_NULL STD { int svr4_sys_fpathconf(int fd, int name); }
119 AUE_NULL NOPROTO { int vfork(void); }
120 AUE_NULL NOPROTO { int fchdir(int fd); }
121 AUE_NULL NOPROTO { int readv(int fd, struct iovec *iovp, \
u_int iovcnt); }
122 AUE_NULL NOPROTO { int writev(int fd, struct iovec *iovp, \
u_int iovcnt); }
123 AUE_NULL STD { int svr4_sys_xstat(int two, char *path, \
struct svr4_xstat *ub); }
124 AUE_NULL STD { int svr4_sys_lxstat(int two, char *path, \
struct svr4_xstat *ub); }
125 AUE_NULL STD { int svr4_sys_fxstat(int two, int fd, \
struct svr4_xstat *sb); }
126 AUE_NULL STD { int svr4_sys_xmknod(int two, char *path, \
svr4_mode_t mode, svr4_dev_t dev); }
127 AUE_NULL UNIMPL clocal
128 AUE_NULL STD { int svr4_sys_setrlimit(int which, \
const struct svr4_rlimit *rlp); }
129 AUE_NULL STD { int svr4_sys_getrlimit(int which, \
struct svr4_rlimit *rlp); }
130 AUE_NULL NOPROTO { int lchown(char *path, uid_t uid, \
gid_t gid); }
131 AUE_NULL STD { int svr4_sys_memcntl(void * addr, \
svr4_size_t len, int cmd, void * arg, \
int attr, int mask); }
132 AUE_NULL UNIMPL getpmsg
133 AUE_NULL UNIMPL putpmsg
134 AUE_NULL NOPROTO { int rename(char *from, char *to); }
135 AUE_NULL STD { int svr4_sys_uname( \
struct svr4_utsname* name, int dummy); }
136 AUE_NULL NOPROTO { int setegid(gid_t egid); }
137 AUE_NULL STD { int svr4_sys_sysconfig(int name); }
138 AUE_NULL NOPROTO { int adjtime(struct timeval *delta, \
struct timeval *olddelta); }
139 AUE_NULL STD { long svr4_sys_systeminfo(int what, \
char *buf, long len); }
140 AUE_NULL UNIMPL notused
141 AUE_NULL NOPROTO { int seteuid(uid_t euid); }
142 AUE_NULL UNIMPL vtrace
; fork1
143 AUE_NULL UNIMPL { int fork(void); }
144 AUE_NULL UNIMPL sigtimedwait
145 AUE_NULL UNIMPL lwp_info
146 AUE_NULL UNIMPL yield
147 AUE_NULL UNIMPL lwp_sema_wait
148 AUE_NULL UNIMPL lwp_sema_post
149 AUE_NULL UNIMPL lwp_sema_trywait
150 AUE_NULL UNIMPL notused
151 AUE_NULL UNIMPL notused
152 AUE_NULL UNIMPL modctl
153 AUE_NULL STD { int svr4_sys_fchroot(int fd); }
154 AUE_NULL STD { int svr4_sys_utimes(char *path, \
struct timeval *tptr); }
155 AUE_NULL STD { int svr4_sys_vhangup(void); }
156 AUE_NULL STD { int svr4_sys_gettimeofday( \
struct timeval *tp); }
157 AUE_NULL NOPROTO { int getitimer(u_int which, \
struct itimerval *itv); }
158 AUE_NULL NOPROTO { int setitimer(u_int which, \
struct itimerval *itv, \
struct itimerval *oitv); }
159 AUE_NULL UNIMPL lwp_create
160 AUE_NULL UNIMPL lwp_exit
161 AUE_NULL UNIMPL lwp_suspend
162 AUE_NULL UNIMPL lwp_continue
163 AUE_NULL UNIMPL lwp_kill
164 AUE_NULL UNIMPL lwp_self
165 AUE_NULL UNIMPL lwp_getprivate
166 AUE_NULL UNIMPL lwp_setprivate
167 AUE_NULL UNIMPL lwp_wait
168 AUE_NULL UNIMPL lwp_mutex_unlock
169 AUE_NULL UNIMPL lwp_mutex_lock
170 AUE_NULL UNIMPL lwp_cond_wait
171 AUE_NULL UNIMPL lwp_cond_signal
172 AUE_NULL UNIMPL lwp_cond_broadcast
173 AUE_NULL UNIMPL { ssize_t svr4_sys_pread(int fd, void *buf, \
size_t nbyte, svr4_off_t off); }
174 AUE_NULL UNIMPL { ssize_t svr4_sys_pwrite(int fd, \
const void *buf, size_t nbyte, \
svr4_off_t off); }
175 AUE_NULL STD { svr4_off64_t svr4_sys_llseek(int fd, \
long offset1, long offset2, int whence); }
176 AUE_NULL UNIMPL inst_sync
177 AUE_NULL UNIMPL whoknows
178 AUE_NULL UNIMPL kaio
179 AUE_NULL UNIMPL whoknows
180 AUE_NULL UNIMPL whoknows
181 AUE_NULL UNIMPL whoknows
182 AUE_NULL UNIMPL whoknows
183 AUE_NULL UNIMPL whoknows
184 AUE_NULL UNIMPL tsolsys
185 AUE_NULL STD { int svr4_sys_acl(char *path, int cmd, \
int num, struct svr4_aclent *buf); }
186 AUE_NULL STD { int svr4_sys_auditsys(int code, int a1, \
int a2, int a3, int a4, int a5); }
187 AUE_NULL UNIMPL processor_bind
188 AUE_NULL UNIMPL processor_info
189 AUE_NULL UNIMPL p_online
190 AUE_NULL UNIMPL sigqueue
191 AUE_NULL UNIMPL clock_gettime
192 AUE_NULL UNIMPL clock_settime
193 AUE_NULL UNIMPL clock_getres
194 AUE_NULL UNIMPL timer_create
195 AUE_NULL UNIMPL timer_delete
196 AUE_NULL UNIMPL timer_settime
197 AUE_NULL UNIMPL timer_gettime
198 AUE_NULL UNIMPL timer_overrun
199 AUE_NULL NOPROTO { int nanosleep( \
const struct timespec *rqtp, \
struct timespec *rmtp); }
200 AUE_NULL STD { int svr4_sys_facl(int fd, int cmd, \
int num, struct svr4_aclent *buf); }
201 AUE_NULL UNIMPL door
202 AUE_NULL NOPROTO { int setreuid(int ruid, int euid); }
203 AUE_NULL NOPROTO { int setregid(int rgid, int egid); }
204 AUE_NULL UNIMPL install_utrap
205 AUE_NULL UNIMPL signotify
206 AUE_NULL UNIMPL schedctl
207 AUE_NULL UNIMPL pset
208 AUE_NULL UNIMPL whoknows
209 AUE_NULL STD { int svr4_sys_resolvepath(const char *path, \
char *buf, size_t bufsiz); }
210 AUE_NULL UNIMPL signotifywait
211 AUE_NULL UNIMPL lwp_sigredirect
212 AUE_NULL UNIMPL lwp_alarm
213 AUE_NULL STD { int svr4_sys_getdents64(int fd, \
struct svr4_dirent64 *dp, int nbytes); }
;213 AUE_NULL UNIMPL getdents64
214 AUE_NULL STD { caddr_t svr4_sys_mmap64(void *addr, \
svr4_size_t len, int prot, int flags, \
int fd, svr4_off64_t pos); }
215 AUE_NULL STD { int svr4_sys_stat64(char *path, \
struct svr4_stat64 *sb); }
216 AUE_NULL STD { int svr4_sys_lstat64(char *path, \
struct svr4_stat64 *sb); }
217 AUE_NULL STD { int svr4_sys_fstat64(int fd, \
struct svr4_stat64 *sb); }
218 AUE_NULL STD { int svr4_sys_statvfs64(char *path, \
struct svr4_statvfs64 *fs); }
219 AUE_NULL STD { int svr4_sys_fstatvfs64(int fd, \
struct svr4_statvfs64 *fs); }
220 AUE_NULL STD { int svr4_sys_setrlimit64(int which, \
const struct svr4_rlimit64 *rlp); }
221 AUE_NULL STD { int svr4_sys_getrlimit64(int which, \
struct svr4_rlimit64 *rlp); }
222 AUE_NULL UNIMPL pread64
223 AUE_NULL UNIMPL pwrite64
224 AUE_NULL STD { int svr4_sys_creat64(char *path, \
int mode); }
225 AUE_NULL STD { int svr4_sys_open64(char *path, int flags, \
int mode); }
226 AUE_NULL UNIMPL rpcsys
227 AUE_NULL UNIMPL whoknows
228 AUE_NULL UNIMPL whoknows
229 AUE_NULL UNIMPL whoknows
230 AUE_NULL STD { int svr4_sys_socket(int domain, int type, \
int protocol); }
231 AUE_NULL NOPROTO { int socketpair(int domain, int type, \
int protocol, int *rsv); }
232 AUE_NULL NOPROTO { int bind(int s, \
const struct sockaddr *name, \
int namelen); }
233 AUE_NULL NOPROTO { int listen(int s, int backlog); }
234 AUE_NULL NOPROTO { int accept(int s, struct sockaddr *name, \
int *anamelen); }
235 AUE_NULL NOPROTO { int connect(int s, \
const struct sockaddr *name, \
int namelen); }
236 AUE_NULL NOPROTO { int shutdown(int s, int how); }
237 AUE_NULL STD { int svr4_sys_recv(int s, caddr_t buf, \
int len, int flags); }
238 AUE_NULL NOPROTO { ssize_t recvfrom(int s, void *buf, \
size_t len, int flags, \
struct sockaddr *from, \
int *fromlenaddr); }
239 AUE_NULL NOPROTO { ssize_t recvmsg(int s, struct msghdr *msg, \
int flags); }
240 AUE_NULL STD { int svr4_sys_send(int s, caddr_t buf, \
int len, int flags); }
241 AUE_NULL NOPROTO { ssize_t sendmsg(int s, \
const struct msghdr *msg, int flags); }
242 AUE_NULL STD { ssize_t svr4_sys_sendto(int s, void *buf, \
size_t len, int flags, \
struct sockaddr *to, int tolen); }
243 AUE_NULL NOPROTO { int getpeername(int fdes, \
struct sockaddr *asa, int *alen); }
244 AUE_NULL NOPROTO { int getsockname(int fdes, \
struct sockaddr *asa, int *alen); }
245 AUE_NULL NOPROTO { int getsockopt(int s, int level, int name, \
void *val, int *avalsize); }
246 AUE_NULL NOPROTO { int setsockopt(int s, int level, int name, \
const void *val, int valsize); }
247 AUE_NULL UNIMPL sockconfig
248 AUE_NULL UNIMPL { int ntp_gettime(struct ntptimeval *ntvp); }
249 AUE_NULL UNIMPL { int ntp_adjtime(struct timex *tp); }

View File

@ -2959,7 +2959,6 @@ dev/stg/tmc18c30_pccard.c optional stg pccard
dev/stg/tmc18c30_pci.c optional stg pci
dev/stg/tmc18c30_subr.c optional stg
dev/stge/if_stge.c optional stge
dev/streams/streams.c optional streams
dev/sym/sym_hipd.c optional sym \
dependency "$S/dev/sym/sym_{conf,defs}.h"
dev/syscons/blank/blank_saver.c optional blank_saver

View File

@ -43,18 +43,6 @@ linux_vdso.so optional compat_linux \
no-implicit-rule \
clean "linux_vdso.so"
#
svr4_genassym.o optional compat_svr4 \
dependency "$S/i386/svr4/svr4_genassym.c" \
compile-with "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
no-obj no-implicit-rule \
clean "svr4_genassym.o"
#
svr4_assym.h optional compat_svr4 \
dependency "$S/kern/genassym.sh svr4_genassym.o" \
compile-with "sh $S/kern/genassym.sh svr4_genassym.o > ${.TARGET}" \
no-obj no-implicit-rule before-depend \
clean "svr4_assym.h"
#
font.h optional sc_dflt_font \
compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \
no-obj no-implicit-rule before-depend \
@ -127,22 +115,6 @@ compat/ndis/subr_ntoskrnl.c optional ndisapi pci
compat/ndis/subr_pe.c optional ndisapi pci
compat/ndis/subr_usbd.c optional ndisapi pci
compat/ndis/winx32_wrap.S optional ndisapi pci
compat/svr4/imgact_svr4.c optional compat_svr4
compat/svr4/svr4_fcntl.c optional compat_svr4
compat/svr4/svr4_filio.c optional compat_svr4
compat/svr4/svr4_ioctl.c optional compat_svr4
compat/svr4/svr4_ipc.c optional compat_svr4
compat/svr4/svr4_misc.c optional compat_svr4
compat/svr4/svr4_resource.c optional compat_svr4
compat/svr4/svr4_signal.c optional compat_svr4
compat/svr4/svr4_socket.c optional compat_svr4
compat/svr4/svr4_sockio.c optional compat_svr4
compat/svr4/svr4_stat.c optional compat_svr4
compat/svr4/svr4_stream.c optional compat_svr4
compat/svr4/svr4_syscallnames.c optional compat_svr4
compat/svr4/svr4_sysent.c optional compat_svr4
compat/svr4/svr4_sysvec.c optional compat_svr4
compat/svr4/svr4_termios.c optional compat_svr4
bf_enc.o optional crypto | ipsec | ipsec_support \
dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \
compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \
@ -546,11 +518,6 @@ i386/linux/linux_sysent.c optional compat_linux
i386/linux/linux_sysvec.c optional compat_linux
i386/pci/pci_cfgreg.c optional pci
i386/pci/pci_pir.c optional pci
i386/svr4/svr4_locore.s optional compat_svr4 \
dependency "svr4_assym.h" \
warning "COMPAT_SVR4 is broken and should be avoided"
i386/svr4/svr4_machdep.c optional compat_svr4
#
isa/syscons_isa.c optional sc
isa/vga_isa.c optional vga
kern/kern_clocksource.c standard

View File

@ -18,8 +18,6 @@ COMPAT_FREEBSD32 opt_compat.h
#IBCS2 opt_dontuse.h
#COMPAT_LINUX opt_dontuse.h
COMPAT_LINUX32 opt_compat.h
#COMPAT_SVR4 opt_dontuse.h
#DEBUG_SVR4 opt_svr4.h
LINPROCFS opt_dontuse.h
LINSYSFS opt_dontuse.h
NDISAPI opt_dontuse.h

View File

@ -24,8 +24,6 @@ PV_STATS opt_pmap.h
COMPAT_AOUT opt_dontuse.h
IBCS2 opt_dontuse.h
COMPAT_LINUX opt_dontuse.h
COMPAT_SVR4 opt_dontuse.h
DEBUG_SVR4 opt_svr4.h
LINPROCFS opt_dontuse.h
LINSYSFS opt_dontuse.h
NDISAPI opt_dontuse.h

View File

@ -1,339 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* Copyright (c) 1997 Todd Vierling
* 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.
* 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 names of the authors 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.
*
* Stolen from NetBSD /sys/compat/svr4/svr4_net.c. Pseudo-device driver
* skeleton produced from /usr/share/examples/drivers/make_pseudo_driver.sh
* in 3.0-980524-SNAP then hacked a bit (but probably not enough :-).
*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h> /* SYSINIT stuff */
#include <sys/conf.h> /* cdevsw stuff */
#include <sys/malloc.h> /* malloc region definitions */
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/unistd.h>
#include <sys/fcntl.h>
#include <sys/socket.h>
#include <sys/protosw.h>
#include <sys/socketvar.h>
#include <sys/syscallsubr.h>
#include <sys/un.h>
#include <sys/domain.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/proc.h>
#include <sys/uio.h>
#include <sys/sysproto.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_ioctl.h>
#include <compat/svr4/svr4_stropts.h>
#include <compat/svr4/svr4_socket.h>
static int svr4_soo_close(struct file *, struct thread *);
static int svr4_ptm_alloc(struct thread *);
static d_open_t streamsopen;
/*
* Device minor numbers
*/
enum {
dev_ptm = 10,
dev_arp = 26,
dev_icmp = 27,
dev_ip = 28,
dev_tcp = 35,
dev_udp = 36,
dev_rawip = 37,
dev_unix_dgram = 38,
dev_unix_stream = 39,
dev_unix_ord_stream = 40
};
static struct cdev *dt_ptm, *dt_arp, *dt_icmp, *dt_ip, *dt_tcp, *dt_udp,
*dt_rawip, *dt_unix_dgram, *dt_unix_stream, *dt_unix_ord_stream;
static struct fileops svr4_netops;
static struct cdevsw streams_cdevsw = {
.d_version = D_VERSION,
.d_open = streamsopen,
.d_name = "streams",
};
struct streams_softc {
struct isa_device *dev;
} ;
#define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */
typedef struct streams_softc *sc_p;
static int
streams_modevent(module_t mod, int type, void *unused)
{
switch (type) {
case MOD_LOAD:
dt_ptm = make_dev(&streams_cdevsw, dev_ptm, 0, 0, 0666,
"ptm");
dt_arp = make_dev(&streams_cdevsw, dev_arp, 0, 0, 0666,
"arp");
dt_icmp = make_dev(&streams_cdevsw, dev_icmp, 0, 0, 0666,
"icmp");
dt_ip = make_dev(&streams_cdevsw, dev_ip, 0, 0, 0666,
"ip");
dt_tcp = make_dev(&streams_cdevsw, dev_tcp, 0, 0, 0666,
"tcp");
dt_udp = make_dev(&streams_cdevsw, dev_udp, 0, 0, 0666,
"udp");
dt_rawip = make_dev(&streams_cdevsw, dev_rawip, 0, 0, 0666,
"rawip");
dt_unix_dgram = make_dev(&streams_cdevsw, dev_unix_dgram,
0, 0, 0666, "ticlts");
dt_unix_stream = make_dev(&streams_cdevsw, dev_unix_stream,
0, 0, 0666, "ticots");
dt_unix_ord_stream = make_dev(&streams_cdevsw,
dev_unix_ord_stream, 0, 0, 0666, "ticotsord");
if (! (dt_ptm && dt_arp && dt_icmp && dt_ip && dt_tcp &&
dt_udp && dt_rawip && dt_unix_dgram &&
dt_unix_stream && dt_unix_ord_stream)) {
printf("WARNING: device config for STREAMS failed\n");
printf("Suggest unloading streams KLD\n");
}
/* Inherit generic socket file operations, except close(2). */
bcopy(&socketops, &svr4_netops, sizeof(struct fileops));
svr4_netops.fo_close = svr4_soo_close;
return 0;
case MOD_UNLOAD:
/* XXX should check to see if it's busy first */
destroy_dev(dt_ptm);
destroy_dev(dt_arp);
destroy_dev(dt_icmp);
destroy_dev(dt_ip);
destroy_dev(dt_tcp);
destroy_dev(dt_udp);
destroy_dev(dt_rawip);
destroy_dev(dt_unix_dgram);
destroy_dev(dt_unix_stream);
destroy_dev(dt_unix_ord_stream);
return 0;
default:
return EOPNOTSUPP;
break;
}
return 0;
}
static moduledata_t streams_mod = {
"streams",
streams_modevent,
0
};
DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
MODULE_VERSION(streams, 1);
MODULE_DEPEND(streams, svr4elf, 1, 1, 1);
/*
* We only need open() and close() routines. open() calls socreate()
* to allocate a "real" object behind the stream and mallocs some state
* info for use by the svr4 emulator; close() deallocates the state
* information and passes the underlying object to the normal socket close
* routine.
*/
static int
streamsopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
struct svr4_strm *st;
struct socket *so;
struct file *fp;
int family, type, protocol;
int error, fd;
if (td->td_dupfd >= 0)
return ENODEV;
switch (dev2unit(dev)) {
case dev_udp:
family = AF_INET;
type = SOCK_DGRAM;
protocol = IPPROTO_UDP;
break;
case dev_tcp:
family = AF_INET;
type = SOCK_STREAM;
protocol = IPPROTO_TCP;
break;
case dev_ip:
case dev_rawip:
family = AF_INET;
type = SOCK_RAW;
protocol = IPPROTO_IP;
break;
case dev_icmp:
family = AF_INET;
type = SOCK_RAW;
protocol = IPPROTO_ICMP;
break;
case dev_unix_dgram:
family = AF_LOCAL;
type = SOCK_DGRAM;
protocol = 0;
break;
case dev_unix_stream:
case dev_unix_ord_stream:
family = AF_LOCAL;
type = SOCK_STREAM;
protocol = 0;
break;
case dev_ptm:
return svr4_ptm_alloc(td);
default:
return EOPNOTSUPP;
}
if ((error = falloc(td, &fp, &fd, 0)) != 0)
return error;
/* An extra reference on `fp' has been held for us by falloc(). */
error = socreate(family, &so, type, protocol, td->td_ucred, td);
if (error) {
fdclose(td, fp, fd);
fdrop(fp, td);
return error;
}
finit(fp, FREAD | FWRITE, DTYPE_SOCKET, so, &svr4_netops);
/*
* Allocate a stream structure and attach it to this socket.
* We don't bother locking so_emuldata for SVR4 stream sockets as
* its value is constant for the lifetime of the stream once it
* is initialized here.
*/
st = malloc(sizeof(struct svr4_strm), M_TEMP, M_WAITOK);
st->s_family = so->so_proto->pr_domain->dom_family;
st->s_cmd = ~0;
st->s_afd = -1;
st->s_eventmask = 0;
so->so_emuldata = st;
fdrop(fp, td);
td->td_dupfd = fd;
return ENXIO;
}
static int
svr4_ptm_alloc(td)
struct thread *td;
{
/*
* XXX this is very, very ugly. But I can't find a better
* way that won't duplicate a big amount of code from
* sys_open(). Ho hum...
*
* Fortunately for us, Solaris (at least 2.5.1) makes the
* /dev/ptmx open automatically just open a pty, that (after
* STREAMS I_PUSHes), is just a plain pty. fstat() is used
* to get the minor device number to map to a tty.
*
* Cycle through the names. If sys_open() returns ENOENT (or
* ENXIO), short circuit the cycle and exit.
*
* XXX: Maybe this can now be implemented by posix_openpt()?
*/
static char ptyname[] = "/dev/ptyXX";
static char ttyletters[] = "pqrstuwxyzPQRST";
static char ttynumbers[] = "0123456789abcdef";
struct proc *p;
register_t fd;
int error, l, n;
fd = -1;
n = 0;
l = 0;
p = td->td_proc;
while (fd == -1) {
ptyname[8] = ttyletters[l];
ptyname[9] = ttynumbers[n];
error = kern_openat(td, AT_FDCWD, ptyname, UIO_SYSSPACE,
O_RDWR, 0);
switch (error) {
case ENOENT:
case ENXIO:
return error;
case 0:
td->td_dupfd = td->td_retval[0];
return ENXIO;
default:
if (ttynumbers[++n] == '\0') {
if (ttyletters[++l] == '\0')
break;
n = 0;
}
}
}
return ENOENT;
}
static int
svr4_soo_close(struct file *fp, struct thread *td)
{
struct socket *so = fp->f_data;
/* CHECKUNIT_DIAG(ENXIO);*/
svr4_delete_socket(td->td_proc, fp);
free(so->so_emuldata, M_TEMP);
fp->f_ops = &badfileops;
fp->f_data = NULL;
return soclose(so);
}

View File

@ -954,26 +954,6 @@ options LINPROCFS
# and PSEUDOFS)
options LINSYSFS
#
# SysVR4 ABI emulation
#
# The svr4 ABI emulator can be statically compiled into the kernel or loaded as
# a KLD module.
# The STREAMS network emulation code can also be compiled statically or as a
# module. If loaded as a module, it must be loaded before the svr4 module
# (the /usr/sbin/svr4 script does this for you). If compiling statically,
# the `streams' device must be configured into any kernel which also
# specifies COMPAT_SVR4. It is possible to have a statically-configured
# STREAMS device and a dynamically loadable svr4 emulator; the /usr/sbin/svr4
# script understands that it doesn't need to load the `streams' module under
# those circumstances.
# Caveat: At this time, `options KTRACE' is required for the svr4 emulator
# (whether static or dynamic).
#
options COMPAT_SVR4 # build emulator statically
options DEBUG_SVR4 # enable verbose debugging
device streams # STREAMS network driver (required for svr4).
# Enable NDIS binary driver support
options NDISAPI
device ndis

View File

@ -1,24 +0,0 @@
/* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/assym.h>
#include <sys/systm.h>
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_ucontext.h>
/* XXX: This bit sucks rocks, but gets rid of compiler errors. Maybe I should
* fix the include files instead... */
#define SVR4_MACHDEP_JUST_REGS
#include <i386/svr4/svr4_machdep.h>
ASSYM(SVR4_SIGF_HANDLER, offsetof(struct svr4_sigframe, sf_handler));
ASSYM(SVR4_SIGF_UC, offsetof(struct svr4_sigframe, sf_uc));
ASSYM(SVR4_UC_FS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_FS]));
ASSYM(SVR4_UC_GS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_GS]));
ASSYM(SVR4_UC_EFLAGS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_EFL]));

View File

@ -1,32 +0,0 @@
#include "svr4_assym.h" /* system definitions */
#include <machine/asmacros.h> /* miscellaneous asm macros */
#include <compat/svr4/svr4_syscall.h> /* system call numbers */
/* $FreeBSD$ */
NON_GPROF_ENTRY(svr4_sigcode)
call *SVR4_SIGF_HANDLER(%esp)
leal SVR4_SIGF_UC(%esp),%eax /* ucp (the call may have clobbered the
copy at SIGF_UCP(%esp)) */
#ifdef VM86
#warning "VM86 doesn't work yet - do you really want this?"
testl $PSL_VM,SVR4_UC_EFLAGS(%eax)
jnz 1f
#endif
mov SVR4_UC_GS(%eax),%gs
1: pushl %eax # pointer to ucontext
pushl $1 # set context
movl $svr4_sys_context,%eax
int $0x80 # enter kernel with args on stack
0: jmp 0b
ALIGN_TEXT
svr4_esigcode:
.data
.globl svr4_szsigcode
svr4_szsigcode:
.long svr4_esigcode - svr4_sigcode
.text

View File

@ -1,610 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/exec.h>
#include <sys/filedesc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/signal.h>
#include <sys/signalvar.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>
#include <machine/vm86.h>
#include <machine/vmparam.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_signal.h>
#include <i386/svr4/svr4_machdep.h>
#include <compat/svr4/svr4_ucontext.h>
#include <compat/svr4/svr4_proto.h>
#include <compat/svr4/svr4_util.h>
#undef sigcode
#undef szsigcode
extern int svr4_szsigcode;
extern char svr4_sigcode[];
static void svr4_getsiginfo(union svr4_siginfo *, int, u_long, caddr_t);
#if !defined(__NetBSD__)
/* taken from /sys/arch/i386/include/psl.h on NetBSD-1.3 */
# define PSL_MBZ 0xffc08028
# define PSL_USERSTATIC (PSL_USER | PSL_MBZ | PSL_IOPL | PSL_NT | PSL_VM | PSL_VIF | PSL_VIP)
# define USERMODE(c, f) (ISPL(c) == SEL_UPL)
#endif
#if defined(__NetBSD__)
void
svr4_setregs(td, epp, stack)
struct thread *td;
struct exec_package *epp;
u_long stack;
{
register struct pcb *pcb = td->td_pcb;
pcb->pcb_savefpu.sv_env.en_cw = __SVR4_NPXCW__;
setregs(td, epp, stack, 0UL);
}
#endif /* __NetBSD__ */
void
svr4_getcontext(td, uc, mask, oonstack)
struct thread *td;
struct svr4_ucontext *uc;
sigset_t *mask;
int oonstack;
{
struct proc *p = td->td_proc;
struct trapframe *tf = td->td_frame;
svr4_greg_t *r = uc->uc_mcontext.greg;
struct svr4_sigaltstack *s = &uc->uc_stack;
#if defined(DONE_MORE_SIGALTSTACK_WORK)
struct sigacts *psp;
struct sigaltstack *sf;
#endif
PROC_LOCK(p);
#if defined(DONE_MORE_SIGALTSTACK_WORK)
psp = p->p_sigacts;
sf = &p->p_sigstk;
#endif
memset(uc, 0, sizeof(struct svr4_ucontext));
uc->uc_link = p->p_emuldata;
/*
* Set the general purpose registers
*/
#ifdef VM86
if (tf->tf_eflags & PSL_VM) {
r[SVR4_X86_GS] = tf->tf_vm86_gs;
r[SVR4_X86_FS] = tf->tf_vm86_fs;
r[SVR4_X86_ES] = tf->tf_vm86_es;
r[SVR4_X86_DS] = tf->tf_vm86_ds;
r[SVR4_X86_EFL] = get_vflags(td);
} else
#endif
{
#if defined(__NetBSD__)
__asm("movl %%gs,%w0" : "=r" (r[SVR4_X86_GS]));
__asm("movl %%fs,%w0" : "=r" (r[SVR4_X86_FS]));
#else
r[SVR4_X86_GS] = rgs();
r[SVR4_X86_FS] = tf->tf_fs;
#endif
r[SVR4_X86_ES] = tf->tf_es;
r[SVR4_X86_DS] = tf->tf_ds;
r[SVR4_X86_EFL] = tf->tf_eflags;
}
r[SVR4_X86_EDI] = tf->tf_edi;
r[SVR4_X86_ESI] = tf->tf_esi;
r[SVR4_X86_EBP] = tf->tf_ebp;
r[SVR4_X86_ESP] = tf->tf_esp;
r[SVR4_X86_EBX] = tf->tf_ebx;
r[SVR4_X86_EDX] = tf->tf_edx;
r[SVR4_X86_ECX] = tf->tf_ecx;
r[SVR4_X86_EAX] = tf->tf_eax;
r[SVR4_X86_TRAPNO] = tf->tf_trapno;
r[SVR4_X86_ERR] = tf->tf_err;
r[SVR4_X86_EIP] = tf->tf_eip;
r[SVR4_X86_CS] = tf->tf_cs;
r[SVR4_X86_UESP] = 0;
r[SVR4_X86_SS] = tf->tf_ss;
/*
* Set the signal stack
*/
#if defined(DONE_MORE_SIGALTSTACK_WORK)
bsd_to_svr4_sigaltstack(sf, s);
#else
s->ss_sp = (void *)rounddown2((u_long)tf->tf_esp, 16384);
s->ss_size = 16384;
s->ss_flags = 0;
#endif
PROC_UNLOCK(p);
/*
* Set the signal mask
*/
bsd_to_svr4_sigset(mask, &uc->uc_sigmask);
/*
* Set the flags
*/
uc->uc_flags = SVR4_UC_SIGMASK|SVR4_UC_CPU|SVR4_UC_STACK;
}
/*
* Set to ucontext specified. Reset signal mask and
* stack state from context.
* Return to previous pc and psl as specified by
* context left by sendsig. Check carefully to
* make sure that the user has not modified the
* psl to gain improper privileges or to cause
* a machine fault.
*/
int
svr4_setcontext(td, uc)
struct thread *td;
struct svr4_ucontext *uc;
{
#if defined(DONE_MORE_SIGALTSTACK_WORK)
struct sigacts *psp;
#endif
struct proc *p = td->td_proc;
register struct trapframe *tf;
svr4_greg_t *r = uc->uc_mcontext.greg;
struct svr4_sigaltstack *s = &uc->uc_stack;
struct sigaltstack *sf;
sigset_t mask;
PROC_LOCK(p);
#if defined(DONE_MORE_SIGALTSTACK_WORK)
psp = p->p_sigacts;
#endif
sf = &td->td_sigstk;
/*
* XXX:
* Should we check the value of flags to determine what to restore?
* What to do with uc_link?
* What to do with floating point stuff?
* Should we bother with the rest of the registers that we
* set to 0 right now?
*/
if ((uc->uc_flags & SVR4_UC_CPU) == 0) {
PROC_UNLOCK(p);
return 0;
}
DPRINTF(("svr4_setcontext(%d)\n", p->p_pid));
tf = td->td_frame;
/*
* Restore register context.
*/
#ifdef VM86
#warning "VM86 doesn't work yet, please don't try to use it."
if (r[SVR4_X86_EFL] & PSL_VM) {
tf->tf_vm86_gs = r[SVR4_X86_GS];
tf->tf_vm86_fs = r[SVR4_X86_FS];
tf->tf_vm86_es = r[SVR4_X86_ES];
tf->tf_vm86_ds = r[SVR4_X86_DS];
set_vflags(td, r[SVR4_X86_EFL]);
} else
#endif
{
/*
* Check for security violations. If we're returning to
* protected mode, the CPU will validate the segment registers
* automatically and generate a trap on violations. We handle
* the trap, rather than doing all of the checking here.
*/
if (((r[SVR4_X86_EFL] ^ tf->tf_eflags) & PSL_USERSTATIC) != 0 ||
!USERMODE(r[SVR4_X86_CS], r[SVR4_X86_EFL])) {
PROC_UNLOCK(p);
return (EINVAL);
}
#if defined(__NetBSD__)
/* %fs and %gs were restored by the trampoline. */
#else
/* %gs was restored by the trampoline. */
tf->tf_fs = r[SVR4_X86_FS];
#endif
tf->tf_es = r[SVR4_X86_ES];
tf->tf_ds = r[SVR4_X86_DS];
tf->tf_eflags = r[SVR4_X86_EFL];
}
tf->tf_edi = r[SVR4_X86_EDI];
tf->tf_esi = r[SVR4_X86_ESI];
tf->tf_ebp = r[SVR4_X86_EBP];
tf->tf_ebx = r[SVR4_X86_EBX];
tf->tf_edx = r[SVR4_X86_EDX];
tf->tf_ecx = r[SVR4_X86_ECX];
tf->tf_eax = r[SVR4_X86_EAX];
tf->tf_trapno = r[SVR4_X86_TRAPNO];
tf->tf_err = r[SVR4_X86_ERR];
tf->tf_eip = r[SVR4_X86_EIP];
tf->tf_cs = r[SVR4_X86_CS];
tf->tf_ss = r[SVR4_X86_SS];
tf->tf_esp = r[SVR4_X86_ESP];
p->p_emuldata = uc->uc_link;
/*
* restore signal stack
*/
if (uc->uc_flags & SVR4_UC_STACK) {
svr4_to_bsd_sigaltstack(s, sf);
}
/*
* restore signal mask
*/
if (uc->uc_flags & SVR4_UC_SIGMASK) {
#if defined(DEBUG_SVR4)
{
int i;
for (i = 0; i < 4; i++)
DPRINTF(("\tuc_sigmask[%d] = %lx\n", i,
uc->uc_sigmask.bits[i]));
}
#endif
svr4_to_bsd_sigset(&uc->uc_sigmask, &mask);
SIG_CANTMASK(mask);
td->td_sigmask = mask;
signotify(td);
}
PROC_UNLOCK(p);
return 0; /*EJUSTRETURN;*/
}
static void
svr4_getsiginfo(si, sig, code, addr)
union svr4_siginfo *si;
int sig;
u_long code;
caddr_t addr;
{
si->svr4_si_signo = bsd_to_svr4_sig[sig];
si->svr4_si_errno = 0;
si->svr4_si_addr = addr;
switch (code) {
case T_PRIVINFLT:
si->svr4_si_code = SVR4_ILL_PRVOPC;
si->svr4_si_trap = SVR4_T_PRIVINFLT;
break;
case T_BPTFLT:
si->svr4_si_code = SVR4_TRAP_BRKPT;
si->svr4_si_trap = SVR4_T_BPTFLT;
break;
case T_ARITHTRAP:
si->svr4_si_code = SVR4_FPE_INTOVF;
si->svr4_si_trap = SVR4_T_DIVIDE;
break;
case T_PROTFLT:
si->svr4_si_code = SVR4_SEGV_ACCERR;
si->svr4_si_trap = SVR4_T_PROTFLT;
break;
case T_TRCTRAP:
si->svr4_si_code = SVR4_TRAP_TRACE;
si->svr4_si_trap = SVR4_T_TRCTRAP;
break;
case T_PAGEFLT:
si->svr4_si_code = SVR4_SEGV_ACCERR;
si->svr4_si_trap = SVR4_T_PAGEFLT;
break;
case T_ALIGNFLT:
si->svr4_si_code = SVR4_BUS_ADRALN;
si->svr4_si_trap = SVR4_T_ALIGNFLT;
break;
case T_DIVIDE:
si->svr4_si_code = SVR4_FPE_FLTDIV;
si->svr4_si_trap = SVR4_T_DIVIDE;
break;
case T_OFLOW:
si->svr4_si_code = SVR4_FPE_FLTOVF;
si->svr4_si_trap = SVR4_T_DIVIDE;
break;
case T_BOUND:
si->svr4_si_code = SVR4_FPE_FLTSUB;
si->svr4_si_trap = SVR4_T_BOUND;
break;
case T_DNA:
si->svr4_si_code = SVR4_FPE_FLTINV;
si->svr4_si_trap = SVR4_T_DNA;
break;
case T_FPOPFLT:
si->svr4_si_code = SVR4_FPE_FLTINV;
si->svr4_si_trap = SVR4_T_FPOPFLT;
break;
case T_SEGNPFLT:
si->svr4_si_code = SVR4_SEGV_MAPERR;
si->svr4_si_trap = SVR4_T_SEGNPFLT;
break;
case T_STKFLT:
si->svr4_si_code = SVR4_ILL_BADSTK;
si->svr4_si_trap = SVR4_T_STKFLT;
break;
default:
si->svr4_si_code = 0;
si->svr4_si_trap = 0;
#if defined(DEBUG_SVR4)
printf("sig %d code %ld\n", sig, code);
/* panic("svr4_getsiginfo");*/
#endif
break;
}
}
/*
* Send an interrupt to process.
*
* Stack is set up to allow sigcode stored
* in u. to call routine. After the handler is
* done svr4 will call setcontext for us
* with the user context we just set up, and we
* will return to the user pc, psl.
*/
void
svr4_sendsig(catcher, ksi, mask)
sig_t catcher;
ksiginfo_t *ksi;
sigset_t *mask;
{
register struct thread *td = curthread;
struct proc *p = td->td_proc;
register struct trapframe *tf;
struct svr4_sigframe *fp, frame;
struct sigacts *psp;
int oonstack;
int sig;
int code;
PROC_LOCK_ASSERT(p, MA_OWNED);
sig = ksi->ksi_signo;
#if defined(DEBUG_SVR4)
printf("svr4_sendsig(%d)\n", sig);
#endif
code = ksi->ksi_trapno; /* use trap No. */
psp = p->p_sigacts;
mtx_assert(&psp->ps_mtx, MA_OWNED);
tf = td->td_frame;
oonstack = sigonstack(tf->tf_esp);
/*
* Allocate space for the signal handler context.
*/
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct svr4_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - sizeof(struct svr4_sigframe));
td->td_sigstk.ss_flags |= SS_ONSTACK;
} else {
fp = (struct svr4_sigframe *)tf->tf_esp - 1;
}
mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(p);
/*
* Build the argument list for the signal handler.
* Notes:
* - we always build the whole argument list, even when we
* don't need to [when SA_SIGINFO is not set, we don't need
* to pass all sf_si and sf_uc]
* - we don't pass the correct signal address [we need to
* modify many kernel files to enable that]
*/
svr4_getcontext(td, &frame.sf_uc, mask, oonstack);
#if defined(DEBUG_SVR4)
printf("obtained ucontext\n");
#endif
svr4_getsiginfo(&frame.sf_si, sig, code, (caddr_t) tf->tf_eip);
#if defined(DEBUG_SVR4)
printf("obtained siginfo\n");
#endif
frame.sf_signum = frame.sf_si.svr4_si_signo;
frame.sf_sip = &fp->sf_si;
frame.sf_ucp = &fp->sf_uc;
frame.sf_handler = catcher;
#if defined(DEBUG_SVR4)
printf("sig = %d, sip %p, ucp = %p, handler = %p\n",
frame.sf_signum, frame.sf_sip, frame.sf_ucp, frame.sf_handler);
#endif
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
* Process has trashed its stack; give it an illegal
* instruction to halt it in its tracks.
*/
PROC_LOCK(p);
sigexit(td, SIGILL);
/* NOTREACHED */
}
#if defined(__NetBSD__)
/*
* Build context to run handler in.
*/
tf->tf_es = GSEL(GUSERLDT_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUSERLDT_SEL, SEL_UPL);
tf->tf_eip = (int)(((char *)PS_STRINGS) -
svr4_szsigcode);
tf->tf_cs = GSEL(GUSERLDT_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC|PSL_D);
tf->tf_esp = (int)fp;
tf->tf_ss = GSEL(GUSERLDT_SEL, SEL_UPL);
#else
tf->tf_esp = (int)fp;
tf->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
tf->tf_eflags &= ~(PSL_T | PSL_D);
tf->tf_cs = _ucodesel;
tf->tf_ds = _udatasel;
tf->tf_es = _udatasel;
tf->tf_fs = _udatasel;
load_gs(_udatasel);
tf->tf_ss = _udatasel;
PROC_LOCK(p);
mtx_lock(&psp->ps_mtx);
#endif
}
int
svr4_sys_sysarch(td, v)
struct thread *td;
struct svr4_sys_sysarch_args *v;
{
struct svr4_sys_sysarch_args *uap = v;
#if 0 /* USER_LDT */
#if defined(__NetBSD__)
caddr_t sg = stackgap_init(p->p_emul);
#else
caddr_t sg = stackgap_init();
#endif
int error;
#endif
switch (uap->op) {
case SVR4_SYSARCH_FPHW:
return 0;
case SVR4_SYSARCH_DSCR:
#if 0 /* USER_LDT */
#warning "USER_LDT doesn't work - are you sure you want this?"
{
struct i386_set_ldt_args sa, *sap;
struct sys_sysarch_args ua;
struct svr4_ssd ssd;
union descriptor bsd;
if ((error = copyin(uap->a1, &ssd,
sizeof(ssd))) != 0) {
printf("Cannot copy arg1\n");
return error;
}
printf("s=%x, b=%x, l=%x, a1=%x a2=%x\n",
ssd.selector, ssd.base, ssd.limit,
ssd.access1, ssd.access2);
/* We can only set ldt's for now. */
if (!ISLDT(ssd.selector)) {
printf("Not an ldt\n");
return EPERM;
}
/* Oh, well we don't cleanup either */
if (ssd.access1 == 0)
return 0;
bsd.sd.sd_lobase = ssd.base & 0xffffff;
bsd.sd.sd_hibase = (ssd.base >> 24) & 0xff;
bsd.sd.sd_lolimit = ssd.limit & 0xffff;
bsd.sd.sd_hilimit = (ssd.limit >> 16) & 0xf;
bsd.sd.sd_type = ssd.access1 & 0x1f;
bsd.sd.sd_dpl = (ssd.access1 >> 5) & 0x3;
bsd.sd.sd_p = (ssd.access1 >> 7) & 0x1;
bsd.sd.sd_xx = ssd.access2 & 0x3;
bsd.sd.sd_def32 = (ssd.access2 >> 2) & 0x1;
bsd.sd.sd_gran = (ssd.access2 >> 3)& 0x1;
sa.start = IDXSEL(ssd.selector);
sa.desc = stackgap_alloc(&sg, sizeof(union descriptor));
sa.num = 1;
sap = stackgap_alloc(&sg,
sizeof(struct i386_set_ldt_args));
if ((error = copyout(&sa, sap, sizeof(sa))) != 0) {
printf("Cannot copyout args\n");
return error;
}
ua.op = I386_SET_LDT;
ua.parms = (char *) sap;
if ((error = copyout(&bsd, sa.desc, sizeof(bsd))) != 0) {
printf("Cannot copyout desc\n");
return error;
}
return sys_sysarch(td, &ua, retval);
}
#endif
default:
printf("svr4_sysarch(%d), a1 %p\n", uap->op,
uap->a1);
return 0;
}
}

View File

@ -1,120 +0,0 @@
/*-
* Copyright (c) 1998 Mark Newton
* Copyright (c) 1994 Christos Zoulas
* 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.
* 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 _I386_SVR4_MACHDEP_H_
#define _I386_SVR4_MACHDEP_H_
#if !defined(SVR4_MACHDEP_JUST_REGS)
#include <sys/signal.h>
#include <compat/svr4/svr4_types.h>
#endif
/*
* Machine dependent portions [X86]
*/
#define SVR4_X86_GS 0
#define SVR4_X86_FS 1
#define SVR4_X86_ES 2
#define SVR4_X86_DS 3
#define SVR4_X86_EDI 4
#define SVR4_X86_ESI 5
#define SVR4_X86_EBP 6
#define SVR4_X86_ESP 7
#define SVR4_X86_EBX 8
#define SVR4_X86_EDX 9
#define SVR4_X86_ECX 10
#define SVR4_X86_EAX 11
#define SVR4_X86_TRAPNO 12
#define SVR4_X86_ERR 13
#define SVR4_X86_EIP 14
#define SVR4_X86_CS 15
#define SVR4_X86_EFL 16
#define SVR4_X86_UESP 17
#define SVR4_X86_SS 18
#define SVR4_X86_MAXREG 19
#if !defined(SVR4_MACHDEP_JUST_REGS)
typedef int svr4_greg_t;
typedef svr4_greg_t svr4_gregset_t[SVR4_X86_MAXREG];
typedef struct {
int f_x87[62]; /* x87 registers */
long f_weitek[33]; /* weitek */
} svr4_fregset_t;
struct thread;
struct svr4_ucontext;
void svr4_getcontext(struct thread *, struct svr4_ucontext *, sigset_t *, int);
int svr4_setcontext(struct thread *p, struct svr4_ucontext *);
typedef struct {
svr4_gregset_t greg;
svr4_fregset_t freg;
} svr4_mcontext_t;
/*
* SYSARCH numbers
*/
#define SVR4_SYSARCH_FPHW 40
#define SVR4_SYSARCH_DSCR 75
struct svr4_ssd {
unsigned int selector;
unsigned int base;
unsigned int limit;
unsigned int access1;
unsigned int access2;
};
/*
* Processor traps
*/
#define SVR4_T_DIVIDE 0
#define SVR4_T_TRCTRAP 1
#define SVR4_T_NMI 2
#define SVR4_T_BPTFLT 3
#define SVR4_T_OFLOW 4
#define SVR4_T_BOUND 5
#define SVR4_T_PRIVINFLT 6
#define SVR4_T_DNA 7
#define SVR4_T_DOUBLEFLT 8
#define SVR4_T_FPOPFLT 9
#define SVR4_T_TSSFLT 10
#define SVR4_T_SEGNPFLT 11
#define SVR4_T_STKFLT 12
#define SVR4_T_PROTFLT 13
#define SVR4_T_PAGEFLT 14
#define SVR4_T_ALIGNFLT 17
#endif /* !SVR4_MACHDEP_JUST_REGS */
#endif /* !_I386_SVR4_MACHDEP_H_ */

View File

@ -455,9 +455,8 @@ sed -e '
if (!flag("NOPROTO") && !flag("NODEF")) {
if (funcname == "nosys" || funcname == "lkmnosys" ||
funcname == "sysarch" || funcname ~ /^freebsd/ ||
funcname ~ /^linux/ || funcname ~ /^svr4/ ||
funcname ~ /^ibcs2/ || funcname ~ /^xenix/ ||
funcname ~ /^cloudabi/) {
funcname ~ /^linux/ || funcname ~ /^ibcs2/ ||
funcname ~ /^xenix/ || funcname ~ /^cloudabi/) {
printf("%s\t%s(struct thread *, struct %s *)",
rettype, funcname, argalias) > sysdcl
} else {
@ -476,9 +475,8 @@ sed -e '
} else {
if (funcname == "nosys" || funcname == "sysarch" ||
funcname == "lkmnosys" || funcname ~ /^freebsd/ ||
funcname ~ /^linux/ || funcname ~ /^svr4/ ||
funcname ~ /^ibcs2/ || funcname ~ /^xenix/ ||
funcname ~ /^cloudabi/) {
funcname ~ /^linux/ || funcname ~ /^ibcs2/ ||
funcname ~ /^xenix/ || funcname ~ /^cloudabi/) {
printf("%s, %s, NULL, 0, 0, %s, %s },", funcname, auditev, flags, thr_flag) > sysent
column = column + length(funcname) + length(auditev) + length(flags) + 3
} else {

View File

@ -350,8 +350,6 @@ SUBDIR= \
ste \
${_stg} \
stge \
${_streams} \
${_svr4} \
${_sym} \
${_syscons} \
sysvipc \
@ -732,9 +730,7 @@ _nsp= nsp
_pcfclock= pcfclock
_pst= pst
_sbni= sbni
_streams= streams
_stg= stg
_svr4= svr4
_cm= cm
.if ${MK_SOURCELESS_UCODE} != "no"
_ctau= ctau

View File

@ -1,13 +0,0 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../dev/streams
KMOD= streams
SRCS= streams.c
.if defined(DEBUG)
CFLAGS+= -DDEBUG_SVR4
.endif
CFLAGS+= -O
.include <bsd.kmod.mk>

View File

@ -1,32 +0,0 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/svr4 ${.CURDIR}/../../compat/svr4
KMOD= svr4
SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \
vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c \
svr4_misc.c svr4_ioctl.c svr4_stat.c svr4_filio.c \
svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \
svr4_machdep.c svr4_resource.c svr4_ipc.c
OBJS= svr4_locore.o
EXPORT_SYMS= svr4_delete_socket
SRCS+= opt_ktrace.h opt_sysvipc.h
CLEANFILES= svr4_assym.h svr4_genassym.o
svr4_assym.h: svr4_genassym.o
sh ${SYSDIR}/kern/genassym.sh svr4_genassym.o > ${.TARGET}
svr4_locore.o: svr4_locore.s svr4_assym.h
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
${.IMPSRC} -o ${.TARGET}
svr4_genassym.o: svr4_genassym.c svr4.h
${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
.if !defined(KERNBUILDDIR) && defined(DEBUG)
opt_svr4.h:
echo "#define DEBUG_SVR4 1" > ${.TARGET}
.endif
.include <bsd.kmod.mk>

View File

@ -2703,9 +2703,6 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
return (error);
}
/* COMPAT_SVR4 */
#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf)
#ifdef COMPAT_FREEBSD32
struct ifconf32 {
int32_t ifc_len;
@ -2745,7 +2742,6 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)
switch (cmd) {
case SIOCGIFCONF:
case OSIOCGIFCONF: /* COMPAT_SVR4 */
error = ifconf(cmd, data);
CURVNET_RESTORE();
return (error);
@ -3017,15 +3013,6 @@ ifconf(u_long cmd, caddr_t data)
if (prison_if(curthread->td_ucred, sa) != 0)
continue;
addrs++;
/* COMPAT_SVR4 */
if (cmd == OSIOCGIFCONF) {
struct osockaddr *osa =
(struct osockaddr *)&ifr.ifr_addr;
ifr.ifr_addr = *sa;
osa->sa_family = sa->sa_family;
sbuf_bcat(sb, &ifr, sizeof(ifr));
max_len += sizeof(ifr);
} else
if (sa->sa_len <= sizeof(*sa)) {
ifr.ifr_addr = *sa;
sbuf_bcat(sb, &ifr, sizeof(ifr));

View File

@ -101,8 +101,6 @@ msg_show_value_desc="Show configured startup value (fast)"
msg_startup="Startup"
msg_startup_dirs="Startup dirs"
msg_startup_dirs_desc="Set the list of dirs to look for startup scripts"
msg_svr4="SVR4"
msg_svr4_desc="This host wants to be able to run SVR4 binaries."
msg_toggle_startup_services="Toggle Startup Services"
msg_unknown_startup_menu_selection="Unknown startup menu selection"
msg_value_required="Value Required"

View File

@ -74,7 +74,6 @@ dialog_menu_main()
var_list="$var_list
apm_enable
ibcs2_enable
svr4_enable
" # END-QUOTE
fi
@ -96,7 +95,6 @@ dialog_menu_main()
export msg_accounting msg_accounting_desc
export msg_lpd msg_lpd_desc
export msg_sco msg_sco_desc
export msg_svr4 msg_svr4_desc
:| awk \
-v uname_p="$UNAME_P" \
-v menu_tags="$DIALOG_MENU_TAGS" \
@ -238,18 +236,6 @@ dialog_menu_main()
tag = sprintf(mtag_fmt, char, mark, subtag)
mprint(tag, ENVIRON["msg_sco_desc"])
if (ditem == char) defaultitem = tag
#
# SVR4: This host wants to be able to run SVR4
# binaries.
#
char = substr(menu_tags, i++, 1)
mark = ( ENVIRON["svr4_enable"] ~ \
/^[Yy][Ee][Ss]$/ ? "X" : " " )
subtag = ENVIRON["msg_svr4"]
tag = sprintf(mtag_fmt, char, mark, subtag)
mprint(tag, ENVIRON["msg_svr4_desc"])
if (ditem == char) defaultitem = tag
}
printf "\"\n"
@ -360,9 +346,6 @@ while :; do
?" ["?"] $msg_sco")
f_eval_catch -dk err "$0" f_sysrc_set \
'f_sysrc_set ibcs2_enable "%s"' "$reverse" ;;
?" ["?"] $msg_svr4")
f_eval_catch -dk err "$0" f_sysrc_set \
'f_sysrc_set svr4_enable "%s"' "$reverse" ;;
# Multi-variable On/Off toggle bits
?" ["?"] $msg_nis_client")
if f_eval_catch -dk err "$0" f_sysrc_set \