mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 17:54:52 +00:00
Remove old files no longer needed.
Add new files created for emulator. Modify NetBSD import to work with FreeBSD and add new features and code. The complete emulator is essentially a combination of work/code implemented by Sean Eric Fagan, Soren Schmidt, Scott Bartram, and myself, Steven Wallace. Features of this new emulator system include: o "clean" code, including strict prototyping. o Auto-generation of ibcs2 system calls, xenix system calls, isc system calls. Generation includes system tables, structure definitions, and prototyping of function calls. o ibcs2 emulator does not rely on any COMPAT_43 system calls. o embedded socksys support o ibcs2 msgsys, semsys, shmsys calls supported if supported in kernel o alternate /emul/ibcs2 namespace searched first for files in ibcs2 system. Usefull to keep sysv libraries, binaries in /emul/ibcs2. o many other finer details and functions fixed or implemented.
This commit is contained in:
parent
3e174373d3
commit
9e03db613c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11397
|
@ -34,7 +34,7 @@
|
|||
#ifndef _IBCS2_DIRENT_H
|
||||
#define _IBCS2_DIRENT_H 1
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define IBCS2_MAXNAMLEN 512
|
||||
#define IBCS2_DIRBUF 1048
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <compat/ibcs2/ibcs2_errno.h>
|
||||
#include <i386/ibcs2/ibcs2_errno.h>
|
||||
|
||||
int bsd2ibcs_errno[] = {
|
||||
int bsd_to_ibcs2_errno[] = {
|
||||
0, /* 0 */
|
||||
IBCS2_EPERM, /* 1 */
|
||||
IBCS2_ENOENT, /* 2 */
|
||||
|
|
|
@ -36,14 +36,19 @@
|
|||
#include <sys/kernel.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/syscallargs.h>
|
||||
#include <sys/sysproto.h>
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <compat/ibcs2/ibcs2_fcntl.h>
|
||||
#include <compat/ibcs2/ibcs2_signal.h>
|
||||
#include <compat/ibcs2/ibcs2_syscallargs.h>
|
||||
#include <compat/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_fcntl.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
static void cvt_iflock2flock __P((struct ibcs2_flock *, struct flock *));
|
||||
static void cvt_flock2iflock __P((struct flock *, struct ibcs2_flock *));
|
||||
static int cvt_o_flags __P((int));
|
||||
static int oflags2ioflags __P((int));
|
||||
static int ioflags2oflags __P((int));
|
||||
|
||||
static int
|
||||
cvt_o_flags(flags)
|
||||
|
@ -53,13 +58,16 @@ cvt_o_flags(flags)
|
|||
|
||||
/* convert mode into NetBSD mode */
|
||||
if (flags & IBCS2_O_WRONLY) r |= O_WRONLY;
|
||||
if (flags & IBCS2_O_RDWR) r |= O_RDWR;
|
||||
if (flags & IBCS2_O_RDWR) r |= O_RDWR;
|
||||
if (flags & (IBCS2_O_NDELAY | IBCS2_O_NONBLOCK)) r |= O_NONBLOCK;
|
||||
if (flags & IBCS2_O_APPEND) r |= O_APPEND;
|
||||
if (flags & IBCS2_O_SYNC) r |= O_FSYNC;
|
||||
if (flags & IBCS2_O_CREAT) r |= O_CREAT;
|
||||
if (flags & IBCS2_O_TRUNC) r |= O_TRUNC;
|
||||
if (flags & IBCS2_O_EXCL) r |= O_EXCL;
|
||||
if (flags & IBCS2_O_SYNC) r |= O_FSYNC;
|
||||
if (flags & IBCS2_O_CREAT) r |= O_CREAT;
|
||||
if (flags & IBCS2_O_TRUNC) r |= O_TRUNC /* | O_CREAT ??? */;
|
||||
if (flags & IBCS2_O_EXCL) r |= O_EXCL;
|
||||
if (flags & IBCS2_O_RDONLY) r |= O_RDONLY;
|
||||
if (flags & IBCS2_O_PRIV) r |= O_EXLOCK;
|
||||
if (flags & IBCS2_O_NOCTTY) r |= O_NOCTTY;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -86,6 +94,16 @@ cvt_flock2iflock(flp, iflp)
|
|||
iflp->l_pid = (ibcs2_pid_t)flp->l_pid;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_IBCS2
|
||||
static void
|
||||
print_flock(struct flock *flp)
|
||||
{
|
||||
printf("flock: start=%x len=%x pid=%d type=%d whence=%d\n",
|
||||
(int)flp->l_start, (int)flp->l_len, (int)flp->l_pid,
|
||||
flp->l_type, flp->l_whence);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
cvt_iflock2flock(iflp, flp)
|
||||
struct ibcs2_flock *iflp;
|
||||
|
@ -165,7 +183,7 @@ ibcs2_open(p, uap, retval)
|
|||
CHECKALTCREAT(p, &sg, SCARG(uap, path));
|
||||
else
|
||||
CHECKALTEXIST(p, &sg, SCARG(uap, path));
|
||||
ret = open(p, uap, retval);
|
||||
ret = open(p, (struct open_args *)uap, retval);
|
||||
|
||||
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
|
||||
struct filedesc *fdp = p->p_fd;
|
||||
|
@ -248,7 +266,7 @@ ibcs2_fcntl(p, uap, retval)
|
|||
case IBCS2_F_SETFL:
|
||||
SCARG(&fa, fd) = SCARG(uap, fd);
|
||||
SCARG(&fa, cmd) = F_SETFL;
|
||||
SCARG(&fa, arg) = (void *)ioflags2oflags(SCARG(uap, arg));
|
||||
SCARG(&fa, arg) = (void *)ioflags2oflags((int)SCARG(uap, arg));
|
||||
return fcntl(p, &fa, retval);
|
||||
|
||||
case IBCS2_F_GETLK:
|
||||
|
@ -283,6 +301,7 @@ ibcs2_fcntl(p, uap, retval)
|
|||
SCARG(&fa, fd) = SCARG(uap, fd);
|
||||
SCARG(&fa, cmd) = F_SETLK;
|
||||
SCARG(&fa, arg) = (void *)flp;
|
||||
|
||||
return fcntl(p, &fa, retval);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef _IBCS2_FCNTL_H
|
||||
#define _IBCS2_FCNTL_H 1
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define IBCS2_O_RDONLY 0x0000
|
||||
#define IBCS2_O_WRONLY 0x0001
|
||||
|
@ -46,6 +46,7 @@
|
|||
#define IBCS2_O_TRUNC 0x0200
|
||||
#define IBCS2_O_EXCL 0x0400
|
||||
#define IBCS2_O_NOCTTY 0x0800
|
||||
#define IBCS2_O_PRIV 0x1000
|
||||
|
||||
#define IBCS2_F_DUPFD 0
|
||||
#define IBCS2_F_GETFD 1
|
||||
|
|
File diff suppressed because it is too large
Load diff
55
sys/i386/ibcs2/ibcs2_ioctl.h
Normal file
55
sys/i386/ibcs2/ibcs2_ioctl.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* misc IOCTL's */
|
||||
|
||||
/* Unix to Jerq I/O control */
|
||||
#define IBCS2_JTYPE ('j'<<8)
|
||||
#define IBCS2_JBOOT (IBCS2_JTYPE|1)
|
||||
#define IBCS2_JTERM (IBCS2_JTYPE|2)
|
||||
#define IBCS2_JMPX (IBCS2_JTYPE|3)
|
||||
#define IBCS2_JTIMO (IBCS2_JTYPE|4)
|
||||
#define IBCS2_JWINSIZE (IBCS2_JTYPE|5)
|
||||
#define IBCS2_JTIMOM (IBCS2_JTYPE|6)
|
||||
#define IBCS2_JZOMBOOT (IBCS2_JTYPE|7)
|
||||
#define IBCS2_JAGENT (IBCS2_JTYPE|9)
|
||||
#define IBCS2_JTRUN (IBCS2_JTYPE|10)
|
||||
|
||||
|
||||
/* Defines for keyboard and display ioctl's */
|
||||
#define IBCS2_KIOC ('K'<<8)
|
||||
#define IBCS2_KDDISPTYPE (IBCS2_KIOC|1)
|
||||
#define IBCS2_KDMAPDISP (IBCS2_KIOC|2)
|
||||
#define IBCS2_KDUNMAPDISP (IBCS2_KIOC|3)
|
||||
#define IBCS2_KDGKBENT (IBCS2_KIOC|4)
|
||||
#define IBCS2_KDSKBENT (IBCS2_KIOC|5)
|
||||
#define IBCS2_KDGKBMODE (IBCS2_KIOC|6)
|
||||
#define IBCS2_KDSKBMODE (IBCS2_KIOC|7)
|
||||
#define IBCS2_KDMKTONE (IBCS2_KIOC|8)
|
||||
#define IBCS2_KDGETMODE (IBCS2_KIOC|9)
|
||||
#define IBCS2_KDSETMODE (IBCS2_KIOC|10)
|
||||
#define IBCS2_KDADDIO (IBCS2_KIOC|11)
|
||||
#define IBCS2_KDDELIO (IBCS2_KIOC|12)
|
||||
#define IBCS2_KDSBORDER (IBCS2_KIOC|13)
|
||||
#define IBCS2_KDQUEMODE (IBCS2_KIOC|15)
|
||||
#define IBCS2_KDVDCTYPE (IBCS2_KIOC|16)
|
||||
#define IBCS2_KDGKBSTATE (IBCS2_KIOC|19)
|
||||
#define IBCS2_KDSETRAD (IBCS2_KIOC|20)
|
||||
#define IBCS2_KDENABIO (IBCS2_KIOC|60)
|
||||
#define IBCS2_KDDISABIO (IBCS2_KIOC|61)
|
||||
#define IBCS2_KIOCINFO (IBCS2_KIOC|62)
|
||||
#define IBCS2_KIOCSOUND (IBCS2_KIOC|63)
|
||||
#define IBCS2_KDGKBTYPE (IBCS2_KIOC|64)
|
||||
#define IBCS2_KDGETLED (IBCS2_KIOC|65)
|
||||
#define IBCS2_KDSETLED (IBCS2_KIOC|66)
|
||||
|
||||
|
||||
/* Defines for Xenix keyboard and display ioctl's */
|
||||
#define IBCS2_MIOC ('k' << 8)
|
||||
#define IBCS2_GETFKEY (IBCS2_MIOC | 0)
|
||||
#define IBCS2_SETFKEY (IBCS2_MIOC | 1)
|
||||
#define IBCS2_GIO_SCRNMAP (IBCS2_MIOC | 2)
|
||||
#define IBCS2_PIO_SCRNMAP (IBCS2_MIOC | 3)
|
||||
#define IBCS2_GIO_STRMAP_21 (IBCS2_MIOC | 4)
|
||||
#define IBCS2_PIO_STRMAP_21 (IBCS2_MIOC | 5)
|
||||
#define IBCS2_GIO_KEYMAP (IBCS2_MIOC | 6)
|
||||
#define IBCS2_PIO_KEYMAP (IBCS2_MIOC | 7)
|
||||
#define IBCS2_GIO_STRMAP (IBCS2_MIOC | 11)
|
||||
#define IBCS2_PIO_STRMAP (IBCS2_MIOC | 12)
|
|
@ -1,18 +1,15 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
/*
|
||||
* Copyright (c) 1995 Scott Bartram
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software withough specific prior written permission
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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
|
||||
|
@ -24,52 +21,367 @@
|
|||
* 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.
|
||||
*
|
||||
* $Id: ibcs2_ipc.c,v 1.1 1994/10/14 08:53:04 sos Exp $
|
||||
*/
|
||||
|
||||
#include <i386/ibcs2/ibcs2.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/sem.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/sysproto.h>
|
||||
|
||||
int
|
||||
ibcs2_msgsys(struct proc *p, void *args, int *retval)
|
||||
#include <vm/vm.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_ipc.h>
|
||||
|
||||
#define IBCS2_IPC_RMID 0
|
||||
#define IBCS2_IPC_SET 1
|
||||
#define IBCS2_IPC_STAT 2
|
||||
|
||||
|
||||
static void cvt_msqid2imsqid __P((struct msqid_ds *, struct ibcs2_msqid_ds *));
|
||||
static void cvt_imsqid2msqid __P((struct ibcs2_msqid_ds *, struct msqid_ds *));
|
||||
static void cvt_sem2isem __P((struct sem *, struct ibcs2_sem *));
|
||||
static void cvt_isem2sem __P((struct ibcs2_sem *, struct sem *));
|
||||
static void cvt_semid2isemid __P((struct semid_ds *, struct ibcs2_semid_ds *));
|
||||
static void cvt_isemid2semid __P((struct ibcs2_semid_ds *, struct semid_ds *));
|
||||
static void cvt_shmid2ishmid __P((struct shmid_ds *, struct ibcs2_shmid_ds *));
|
||||
static void cvt_ishmid2shmid __P((struct ibcs2_shmid_ds *, struct shmid_ds *));
|
||||
|
||||
|
||||
/*
|
||||
* iBCS2 msgsys call
|
||||
*/
|
||||
|
||||
static void
|
||||
cvt_msqid2imsqid(bp, ibp)
|
||||
struct msqid_ds *bp;
|
||||
struct ibcs2_msqid_ds *ibp;
|
||||
{
|
||||
if (ibcs2_trace & IBCS2_TRACE_MISC)
|
||||
printf("IBCS2: 'msgsys'\n");
|
||||
ibp->msg_perm = bp->msg_perm;
|
||||
ibp->msg_first = bp->msg_first;
|
||||
ibp->msg_last = bp->msg_last;
|
||||
ibp->msg_cbytes = (u_short)bp->msg_cbytes;
|
||||
ibp->msg_qnum = (u_short)bp->msg_qnum;
|
||||
ibp->msg_qbytes = (u_short)bp->msg_qbytes;
|
||||
ibp->msg_lspid = (u_short)bp->msg_lspid;
|
||||
ibp->msg_lrpid = (u_short)bp->msg_lrpid;
|
||||
ibp->msg_stime = bp->msg_stime;
|
||||
ibp->msg_rtime = bp->msg_rtime;
|
||||
ibp->msg_ctime = bp->msg_ctime;
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_imsqid2msqid(ibp, bp)
|
||||
struct ibcs2_msqid_ds *ibp;
|
||||
struct msqid_ds *bp;
|
||||
{
|
||||
bp->msg_perm = ibp->msg_perm;
|
||||
bp->msg_first = ibp->msg_first;
|
||||
bp->msg_last = ibp->msg_last;
|
||||
bp->msg_cbytes = ibp->msg_cbytes;
|
||||
bp->msg_qnum = ibp->msg_qnum;
|
||||
bp->msg_qbytes = ibp->msg_qbytes;
|
||||
bp->msg_lspid = ibp->msg_lspid;
|
||||
bp->msg_lrpid = ibp->msg_lrpid;
|
||||
bp->msg_stime = ibp->msg_stime;
|
||||
bp->msg_rtime = ibp->msg_rtime;
|
||||
bp->msg_ctime = ibp->msg_ctime;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SYSVMSG
|
||||
return msgsys(p, args, retval);
|
||||
#else
|
||||
printf("IBCS2: 'msgsys' not implemented yet\n");
|
||||
return EINVAL;
|
||||
int
|
||||
ibcs2_msgsys(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct ibcs2_msgsys_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
switch (SCARG(uap, which)) {
|
||||
case 0: /* msgget */
|
||||
SCARG(uap, which) = 1;
|
||||
return msgsys(p, (struct msgsys_args *)uap, retval);
|
||||
case 1: { /* msgctl */
|
||||
int error;
|
||||
struct msgsys_args margs;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
SCARG(&margs, which) = 0;
|
||||
SCARG(&margs, a2) = SCARG(uap, a2);
|
||||
SCARG(&margs, a4) =
|
||||
(int)stackgap_alloc(&sg, sizeof(struct msqid_ds));
|
||||
SCARG(&margs, a3) = SCARG(uap, a3);
|
||||
switch (SCARG(&margs, a3)) {
|
||||
case IBCS2_IPC_STAT:
|
||||
error = msgsys(p, &margs, retval);
|
||||
if (!error)
|
||||
cvt_msqid2imsqid(SCARG(&margs, a4),
|
||||
(struct ibcs2_msqid_ds *)SCARG(uap, a4));
|
||||
return error;
|
||||
case IBCS2_IPC_SET:
|
||||
cvt_imsqid2msqid((struct ibcs2_msqid_ds *)SCARG(uap,
|
||||
a4),
|
||||
SCARG(&margs, a4));
|
||||
return msgsys(p, &margs, retval);
|
||||
case IBCS2_IPC_RMID:
|
||||
return msgsys(p, &margs, retval);
|
||||
}
|
||||
return EINVAL;
|
||||
}
|
||||
case 2: /* msgrcv */
|
||||
SCARG(uap, which) = 3;
|
||||
return msgsys(p, (struct msgsys_args *)uap, retval);
|
||||
case 3: /* msgsnd */
|
||||
SCARG(uap, which) = 2;
|
||||
return msgsys(p, (struct msgsys_args *)uap, retval);
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* iBCS2 semsys call
|
||||
*/
|
||||
|
||||
static void
|
||||
cvt_sem2isem(bp, ibp)
|
||||
struct sem *bp;
|
||||
struct ibcs2_sem *ibp;
|
||||
{
|
||||
ibp->semval = bp->semval;
|
||||
ibp->sempid = bp->sempid;
|
||||
ibp->semncnt = bp->semncnt;
|
||||
ibp->semzcnt = bp->semzcnt;
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_semsys(struct proc *p, void *args, int *retval)
|
||||
static void
|
||||
cvt_isem2sem(ibp, bp)
|
||||
struct ibcs2_sem *ibp;
|
||||
struct sem *bp;
|
||||
{
|
||||
if (ibcs2_trace & IBCS2_TRACE_MISC)
|
||||
printf("IBCS2: 'semsys'\n");
|
||||
bp->semval = ibp->semval;
|
||||
bp->sempid = ibp->sempid;
|
||||
bp->semncnt = ibp->semncnt;
|
||||
bp->semzcnt = ibp->semzcnt;
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_semid2isemid(bp, ibp)
|
||||
struct semid_ds *bp;
|
||||
struct ibcs2_semid_ds *ibp;
|
||||
{
|
||||
ibp->sem_perm = bp->sem_perm;
|
||||
ibp->sem_base = (struct ibcs2_sem *)bp->sem_base;
|
||||
ibp->sem_nsems = bp->sem_nsems;
|
||||
ibp->sem_otime = bp->sem_otime;
|
||||
ibp->sem_ctime = bp->sem_ctime;
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_isemid2semid(ibp, bp)
|
||||
struct ibcs2_semid_ds *ibp;
|
||||
struct semid_ds *bp;
|
||||
{
|
||||
bp->sem_perm = ibp->sem_perm;
|
||||
bp->sem_base = (struct sem *)ibp->sem_base;
|
||||
bp->sem_nsems = ibp->sem_nsems;
|
||||
bp->sem_otime = ibp->sem_otime;
|
||||
bp->sem_ctime = ibp->sem_ctime;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SYSVSEM
|
||||
return semsys(p, args, retval);
|
||||
#else
|
||||
printf("IBCS2: 'semsys' not implemented yet\n");
|
||||
return EINVAL;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_shmsys(struct proc *p, void *args, int *retval)
|
||||
ibcs2_semsys(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct ibcs2_semsys_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
if (ibcs2_trace & IBCS2_TRACE_MISC)
|
||||
printf("IBCS2: 'shmsys'\n");
|
||||
#ifdef SYSVSHM
|
||||
return shmsys(p, args, retval);
|
||||
#else
|
||||
printf("IBCS2: 'shmsys' not implemented yet\n");
|
||||
int error;
|
||||
|
||||
switch (SCARG(uap, which)) {
|
||||
case 0: /* semctl */
|
||||
switch(SCARG(uap, a4)) {
|
||||
case IBCS2_IPC_STAT:
|
||||
{
|
||||
struct ibcs2_semid_ds *isp;
|
||||
struct semid_ds *sp;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
isp = (struct ibcs2_semid_ds *)SCARG(uap, a5);
|
||||
sp = stackgap_alloc(&sg, sizeof(struct semid_ds));
|
||||
SCARG(uap, a5) = (int)sp;
|
||||
error = semsys(p, (struct semsys_args *)uap, retval);
|
||||
if (!error) {
|
||||
SCARG(uap, a5) = (int)isp;
|
||||
isp = stackgap_alloc(&sg, sizeof(*isp));
|
||||
cvt_semid2isemid(sp, isp);
|
||||
error = copyout((caddr_t)isp,
|
||||
(caddr_t)SCARG(uap, a5),
|
||||
sizeof(*isp));
|
||||
}
|
||||
return error;
|
||||
}
|
||||
case IBCS2_IPC_SET:
|
||||
{
|
||||
struct ibcs2_semid_ds *isp;
|
||||
struct semid_ds *sp;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
isp = stackgap_alloc(&sg, sizeof(*isp));
|
||||
sp = stackgap_alloc(&sg, sizeof(*sp));
|
||||
error = copyin((caddr_t)SCARG(uap, a5), (caddr_t)isp,
|
||||
sizeof(*isp));
|
||||
if (error)
|
||||
return error;
|
||||
cvt_isemid2semid(isp, sp);
|
||||
SCARG(uap, a5) = (int)sp;
|
||||
return semsys(p, (struct semsys_args *)uap, retval);
|
||||
}
|
||||
}
|
||||
return semsys(p, (struct semsys_args *)uap, retval);
|
||||
|
||||
case 1: /* semget */
|
||||
return semsys(p, (struct semsys_args *)uap, retval);
|
||||
|
||||
case 2: /* semop */
|
||||
return semsys(p, (struct semsys_args *)uap, retval);
|
||||
}
|
||||
return EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* iBCS2 shmsys call
|
||||
*/
|
||||
|
||||
static void
|
||||
cvt_shmid2ishmid(bp, ibp)
|
||||
struct shmid_ds *bp;
|
||||
struct ibcs2_shmid_ds *ibp;
|
||||
{
|
||||
ibp->shm_perm = bp->shm_perm;
|
||||
ibp->shm_segsz = bp->shm_segsz;
|
||||
ibp->shm_lpid = bp->shm_lpid;
|
||||
ibp->shm_cpid = bp->shm_cpid;
|
||||
ibp->shm_nattch = bp->shm_nattch;
|
||||
ibp->shm_cnattch = 0; /* ignored anyway */
|
||||
ibp->shm_atime = bp->shm_atime;
|
||||
ibp->shm_dtime = bp->shm_dtime;
|
||||
ibp->shm_ctime = bp->shm_ctime;
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_ishmid2shmid(ibp, bp)
|
||||
struct ibcs2_shmid_ds *ibp;
|
||||
struct shmid_ds *bp;
|
||||
{
|
||||
bp->shm_perm = ibp->shm_perm;
|
||||
bp->shm_segsz = ibp->shm_segsz;
|
||||
bp->shm_lpid = ibp->shm_lpid;
|
||||
bp->shm_cpid = ibp->shm_cpid;
|
||||
bp->shm_nattch = ibp->shm_nattch;
|
||||
bp->shm_atime = ibp->shm_atime;
|
||||
bp->shm_dtime = ibp->shm_dtime;
|
||||
bp->shm_ctime = ibp->shm_ctime;
|
||||
bp->shm_internal = (void *)0; /* ignored anyway */
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SYSVSHM
|
||||
int
|
||||
ibcs2_shmsys(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct ibcs2_shmsys_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int error;
|
||||
|
||||
switch (SCARG(uap, which)) {
|
||||
case 0: /* shmat */
|
||||
return shmsys(p, (struct shmsys_args *)uap, retval);
|
||||
|
||||
case 1: /* shmctl */
|
||||
switch(SCARG(uap, a3)) {
|
||||
case IBCS2_IPC_STAT:
|
||||
{
|
||||
struct ibcs2_shmid_ds *isp;
|
||||
struct shmid_ds *sp;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
isp = (struct ibcs2_shmid_ds *)SCARG(uap, a4);
|
||||
sp = stackgap_alloc(&sg, sizeof(*sp));
|
||||
SCARG(uap, a4) = (int)sp;
|
||||
error = shmsys(p, (struct shmsys_args *)uap, retval);
|
||||
if (!error) {
|
||||
SCARG(uap, a4) = (int)isp;
|
||||
isp = stackgap_alloc(&sg, sizeof(*isp));
|
||||
cvt_shmid2ishmid(sp, isp);
|
||||
error = copyout((caddr_t)isp,
|
||||
(caddr_t)SCARG(uap, a4),
|
||||
sizeof(*isp));
|
||||
}
|
||||
return error;
|
||||
}
|
||||
case IBCS2_IPC_SET:
|
||||
{
|
||||
struct ibcs2_shmid_ds *isp;
|
||||
struct shmid_ds *sp;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
isp = stackgap_alloc(&sg, sizeof(*isp));
|
||||
sp = stackgap_alloc(&sg, sizeof(*sp));
|
||||
error = copyin((caddr_t)SCARG(uap, a4), (caddr_t)isp,
|
||||
sizeof(*isp));
|
||||
if (error)
|
||||
return error;
|
||||
cvt_ishmid2shmid(isp, sp);
|
||||
SCARG(uap, a4) = (int)sp;
|
||||
return shmsys(p, (struct shmsys_args *)uap, retval);
|
||||
}
|
||||
}
|
||||
return shmsys(p, (struct shmsys_args *)uap, retval);
|
||||
|
||||
case 2: /* shmdt */
|
||||
return shmsys(p, (struct shmsys_args *)uap, retval);
|
||||
|
||||
case 3: /* shmget */
|
||||
return shmsys(p, (struct shmsys_args *)uap, retval);
|
||||
}
|
||||
return EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
|
76
sys/i386/ibcs2/ibcs2_ipc.h
Normal file
76
sys/i386/ibcs2/ibcs2_ipc.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* 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 Steven Wallace.
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
struct ibcs2_msqid_ds {
|
||||
struct ipc_perm msg_perm;
|
||||
struct msg *msg_first;
|
||||
struct msg *msg_last;
|
||||
u_short msg_cbytes;
|
||||
u_short msg_qnum;
|
||||
u_short msg_qbytes;
|
||||
u_short msg_lspid;
|
||||
u_short msg_lrpid;
|
||||
ibcs2_time_t msg_stime;
|
||||
ibcs2_time_t msg_rtime;
|
||||
ibcs2_time_t msg_ctime;
|
||||
};
|
||||
|
||||
struct ibcs2_semid_ds {
|
||||
struct ipc_perm sem_perm;
|
||||
struct ibcs2_sem *sem_base;
|
||||
u_short sem_nsems;
|
||||
int pad1;
|
||||
ibcs2_time_t sem_otime;
|
||||
ibcs2_time_t sem_ctime;
|
||||
};
|
||||
|
||||
struct ibcs2_sem {
|
||||
u_short semval;
|
||||
ibcs2_pid_t sempid;
|
||||
u_short semncnt;
|
||||
u_short semzcnt;
|
||||
};
|
||||
|
||||
struct ibcs2_shmid_ds {
|
||||
struct ipc_perm shm_perm;
|
||||
int shm_segsz;
|
||||
int pad1;
|
||||
char pad2[4];
|
||||
u_short shm_lpid;
|
||||
u_short shm_cpid;
|
||||
u_short shm_nattch;
|
||||
u_short shm_cnattch;
|
||||
ibcs2_time_t shm_atime;
|
||||
ibcs2_time_t shm_dtime;
|
||||
ibcs2_time_t shm_ctime;
|
||||
};
|
|
@ -1,6 +1,7 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* Copyright (c) 1994 Sean Eric Fagan
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -26,166 +27,37 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ibcs2_isc.c,v 1.3 1995/04/30 11:30:12 ache Exp $
|
||||
* $Id: ibcs2_isc.c,v 1.4 1995/05/30 07:59:58 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#include <i386/ibcs2/ibcs2.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/syslimits.h>
|
||||
#include <sys/timeb.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/psl.h>
|
||||
#include <machine/reg.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_isc_syscall.h>
|
||||
|
||||
extern struct sysent isc_sysent[];
|
||||
|
||||
int
|
||||
ibcs2_cisc(struct proc *p, void *args, int *retval)
|
||||
ibcs2_isc(struct proc *p, struct ibcs2_isc_args *uap, int *retval)
|
||||
{
|
||||
struct trapframe *tf = (struct trapframe *)p->p_md.md_regs;
|
||||
struct sysent *callp;
|
||||
u_int code;
|
||||
|
||||
switch ((tf->tf_eax & 0xffffff00) >> 8) {
|
||||
code = (tf->tf_eax & 0xffffff00) >> 8;
|
||||
callp = &isc_sysent[code];
|
||||
|
||||
case 0x00:
|
||||
printf("IBCS2: 'cisc #0' what is this ??\n");
|
||||
return 0;
|
||||
|
||||
case 0x02:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc rename'\n");
|
||||
return rename(p, args, retval);
|
||||
|
||||
case 0x03:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc sigaction'\n");
|
||||
return ibcs2_sigaction(p, args, retval);
|
||||
|
||||
case 0x04:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc sigprocmask'\n");
|
||||
return ibcs2_sigprocmask(p, args, retval);
|
||||
|
||||
case 0x05:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc sigpending'\n");
|
||||
return ibcs2_sigpending(p, args, retval);
|
||||
|
||||
case 0x06:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc getgroups'\n");
|
||||
return getgroups(p, args, retval);
|
||||
|
||||
case 0x07:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc setgroups'\n");
|
||||
return setgroups(p, args, retval);
|
||||
|
||||
case 0x08: /* pathconf */
|
||||
case 0x09: /* fpathconf */
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc (f)pathconf'");
|
||||
return ibcs2_pathconf(p, args, retval);
|
||||
|
||||
case 0x10: { /* sysconf */
|
||||
struct ibcs2_sysconf_args {
|
||||
int num;
|
||||
} *sysconf_args = args;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc sysconf'");
|
||||
switch (sysconf_args->num) {
|
||||
case 0: /* _SC_ARG_MAX */
|
||||
*retval = (ARG_MAX);
|
||||
break;
|
||||
case 1: /* _SC_CHILD_MAX */
|
||||
*retval = (CHILD_MAX);
|
||||
break;
|
||||
case 2: /* _SC_CLK_TCK */
|
||||
*retval = (_BSD_CLK_TCK_);
|
||||
break;
|
||||
case 3: /* _SC_NGROUPS_MAX */
|
||||
*retval = (NGROUPS_MAX);
|
||||
break;
|
||||
case 4: /* _SC_OPEN_MAX */
|
||||
*retval = (OPEN_MAX);
|
||||
break;
|
||||
case 5: /* _SC_JOB_CONTROL */
|
||||
#ifdef _POSIX_JOB_CONTROL
|
||||
*retval = (1);
|
||||
#else
|
||||
*retval = (-1);
|
||||
#endif
|
||||
break;
|
||||
case 6: /* _SC_SAVED_IDS */
|
||||
#ifdef _POSIX_SAVED_IDS
|
||||
*retval = (1);
|
||||
#else
|
||||
*retval = (-1);
|
||||
#endif
|
||||
break;
|
||||
case 7: /* _SC_VERSION */
|
||||
*retval = (_POSIX_VERSION);
|
||||
break;
|
||||
default:
|
||||
*retval = -1;
|
||||
return EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case 0x0b:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc waitpid'\n");
|
||||
return ibcs2_wait(p, args, retval);
|
||||
|
||||
case 0x0c:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc setsid'\n");
|
||||
return setsid(p, args, retval);
|
||||
|
||||
case 0x0d:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc setpgid'\n");
|
||||
return setpgid(p, args, retval);
|
||||
|
||||
case 0x11:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc sigsuspend'\n");
|
||||
return ibcs2_sigsuspend(p, args, retval);
|
||||
|
||||
case 0x12:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc symlink'\n");
|
||||
return symlink(p, args, retval);
|
||||
|
||||
case 0x13:
|
||||
if (ibcs2_trace & IBCS2_TRACE_ISC)
|
||||
printf("IBCS2: 'cisc readlink'\n");
|
||||
return readlink(p, args, retval);
|
||||
|
||||
/* Here needs more work to be done */
|
||||
case 0x01:
|
||||
printf("IBCS2: 'cisc setostype'");
|
||||
break;
|
||||
case 0x0e:
|
||||
printf("IBCS2: 'cisc adduser'");
|
||||
break;
|
||||
case 0x0f:
|
||||
printf("IBCS2: 'cisc setuser'");
|
||||
break;
|
||||
case 0x14:
|
||||
printf("IBCS2: 'cisc getmajor'");
|
||||
break;
|
||||
default:
|
||||
printf("IBCS2: 'cisc' function %d(0x%x)",
|
||||
tf->tf_eax>>8, tf->tf_eax>>8);
|
||||
break;
|
||||
}
|
||||
printf(" not implemented yet\n");
|
||||
return EINVAL;
|
||||
if(code < IBCS2_ISC_MAXSYSCALL)
|
||||
return((*callp->sy_call)(p, (void *)uap, retval));
|
||||
else
|
||||
return ENOSYS;
|
||||
}
|
||||
|
|
23
sys/i386/ibcs2/ibcs2_isc_syscall.h
Normal file
23
sys/i386/ibcs2/ibcs2_isc_syscall.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* System call numbers.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.isc,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#define IBCS2_ISC_ibcs2_rename 2
|
||||
#define IBCS2_ISC_ibcs2_sigaction 3
|
||||
#define IBCS2_ISC_ibcs2_sigprocmask 4
|
||||
#define IBCS2_ISC_ibcs2_sigpending 5
|
||||
#define IBCS2_ISC_getgroups 6
|
||||
#define IBCS2_ISC_setgroups 7
|
||||
#define IBCS2_ISC_ibcs2_pathconf 8
|
||||
#define IBCS2_ISC_ibcs2_fpathconf 9
|
||||
#define IBCS2_ISC_ibcs2_wait 11
|
||||
#define IBCS2_ISC_setsid 12
|
||||
#define IBCS2_ISC_getpid 13
|
||||
#define IBCS2_ISC_ibcs2_sysconf 16
|
||||
#define IBCS2_ISC_ibcs2_sigsuspend 17
|
||||
#define IBCS2_ISC_ibcs2_symlink 18
|
||||
#define IBCS2_ISC_ibcs2_readlink 19
|
||||
#define IBCS2_ISC_MAXSYSCALL 21
|
49
sys/i386/ibcs2/ibcs2_isc_sysent.c
Normal file
49
sys/i386/ibcs2/ibcs2_isc_sysent.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* System call switch table.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.isc,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
|
||||
#ifdef COMPAT_43
|
||||
#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)
|
||||
#else
|
||||
#define compat(n, name) 0, (sy_call_t *)nosys
|
||||
#endif
|
||||
|
||||
/* The casts are bogus but will do for now. */
|
||||
struct sysent isc_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys }, /* 0 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 1 = isc_setostype */
|
||||
{ 2, (sy_call_t *)ibcs2_rename }, /* 2 = ibcs2_rename */
|
||||
{ 3, (sy_call_t *)ibcs2_sigaction }, /* 3 = ibcs2_sigaction */
|
||||
{ 3, (sy_call_t *)ibcs2_sigprocmask }, /* 4 = ibcs2_sigprocmask */
|
||||
{ 1, (sy_call_t *)ibcs2_sigpending }, /* 5 = ibcs2_sigpending */
|
||||
{ 2, (sy_call_t *)getgroups }, /* 6 = getgroups */
|
||||
{ 2, (sy_call_t *)setgroups }, /* 7 = setgroups */
|
||||
{ 2, (sy_call_t *)ibcs2_pathconf }, /* 8 = ibcs2_pathconf */
|
||||
{ 2, (sy_call_t *)ibcs2_fpathconf }, /* 9 = ibcs2_fpathconf */
|
||||
{ 0, (sy_call_t *)nosys }, /* 10 = nosys */
|
||||
{ 3, (sy_call_t *)ibcs2_wait }, /* 11 = ibcs2_wait */
|
||||
{ 0, (sy_call_t *)setsid }, /* 12 = setsid */
|
||||
{ 0, (sy_call_t *)getpid }, /* 13 = getpid */
|
||||
{ 0, (sy_call_t *)nosys }, /* 14 = isc_adduser */
|
||||
{ 0, (sy_call_t *)nosys }, /* 15 = isc_setuser */
|
||||
{ 1, (sy_call_t *)ibcs2_sysconf }, /* 16 = ibcs2_sysconf */
|
||||
{ 1, (sy_call_t *)ibcs2_sigsuspend }, /* 17 = ibcs2_sigsuspend */
|
||||
{ 2, (sy_call_t *)ibcs2_symlink }, /* 18 = ibcs2_symlink */
|
||||
{ 3, (sy_call_t *)ibcs2_readlink }, /* 19 = ibcs2_readlink */
|
||||
{ 0, (sy_call_t *)nosys }, /* 20 = isc_getmajor */
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
142
sys/i386/ibcs2/ibcs2_msg.c
Normal file
142
sys/i386/ibcs2/ibcs2_msg.c
Normal file
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* 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. 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* IBCS2 message compatibility module.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/kernel.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_poll.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
|
||||
|
||||
int
|
||||
ibcs2_getmsg(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct ibcs2_getmsg_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
return 0; /* fake */
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_putmsg(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct ibcs2_putmsg_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
return 0; /* fake */
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ibcs2_poll(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct ibcs2_poll_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int error, i;
|
||||
fd_set *readfds, *writefds, *exceptfds;
|
||||
struct timeval *timeout;
|
||||
struct ibcs2_poll conv;
|
||||
struct select_args tmp_select;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
if (uap->nfds > FD_SETSIZE)
|
||||
return EINVAL;
|
||||
readfds = stackgap_alloc(&sg, sizeof(fd_set *));
|
||||
writefds = stackgap_alloc(&sg, sizeof(fd_set *));
|
||||
exceptfds = stackgap_alloc(&sg, sizeof(fd_set *));
|
||||
timeout = stackgap_alloc(&sg, sizeof(struct timeval *));
|
||||
|
||||
FD_ZERO(readfds);
|
||||
FD_ZERO(writefds);
|
||||
FD_ZERO(exceptfds);
|
||||
if (uap->timeout == -1)
|
||||
timeout = NULL;
|
||||
else {
|
||||
timeout->tv_usec = (uap->timeout % 1000)*1000;
|
||||
timeout->tv_sec = uap->timeout / 1000;
|
||||
}
|
||||
|
||||
tmp_select.nd = 0;
|
||||
tmp_select.in = readfds;
|
||||
tmp_select.ou = writefds;
|
||||
tmp_select.ex = exceptfds;
|
||||
tmp_select.tv = timeout;
|
||||
|
||||
for (i = 0; i < uap->nfds; i++) {
|
||||
if (error = copyin(uap->fds + i*sizeof(struct ibcs2_poll),
|
||||
&conv, sizeof(conv)))
|
||||
return error;
|
||||
conv.revents = 0;
|
||||
if (conv.fd < 0 || conv.fd > FD_SETSIZE)
|
||||
continue;
|
||||
if (conv.fd >= tmp_select.nd)
|
||||
tmp_select.nd = conv.fd + 1;
|
||||
if (conv.events & IBCS2_READPOLL)
|
||||
FD_SET(conv.fd, readfds);
|
||||
if (conv.events & IBCS2_WRITEPOLL)
|
||||
FD_SET(conv.fd, writefds);
|
||||
FD_SET(conv.fd, exceptfds);
|
||||
}
|
||||
if (error = select(p, &tmp_select, retval))
|
||||
return error;
|
||||
if (*retval == 0)
|
||||
return 0;
|
||||
*retval = 0;
|
||||
for (*retval = 0, i = 0; i < uap->nfds; i++) {
|
||||
copyin(uap->fds + i*sizeof(struct ibcs2_poll),
|
||||
&conv, sizeof(conv));
|
||||
conv.revents = 0;
|
||||
if (conv.fd < 0 || conv.fd > FD_SETSIZE)
|
||||
/* should check for open as well */
|
||||
conv.revents |= IBCS2_POLLNVAL;
|
||||
else {
|
||||
if (FD_ISSET(conv.fd, readfds))
|
||||
conv.revents |= IBCS2_POLLIN;
|
||||
if (FD_ISSET(conv.fd, writefds))
|
||||
conv.revents |= IBCS2_POLLOUT;
|
||||
if (FD_ISSET(conv.fd, exceptfds))
|
||||
conv.revents |= IBCS2_POLLERR;
|
||||
if (conv.revents)
|
||||
++*retval;
|
||||
}
|
||||
if (error = copyout(&conv,
|
||||
uap->fds + i*sizeof(struct ibcs2_poll),
|
||||
sizeof(conv)))
|
||||
return error;
|
||||
}
|
||||
return 0;
|
||||
}
|
76
sys/i386/ibcs2/ibcs2_other.c
Normal file
76
sys/i386/ibcs2/ibcs2_other.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* 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. 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* IBCS2 compatibility module.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/kernel.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
|
||||
#define IBCS2_SECURE_GETLUID 1
|
||||
#define IBCS2_SECURE_SETLUID 2
|
||||
|
||||
int
|
||||
ibcs2_secure(struct proc *p, struct ibcs2_secure_args *uap, int *retval)
|
||||
{
|
||||
switch (uap->cmd) {
|
||||
|
||||
case IBCS2_SECURE_GETLUID: /* get login uid */
|
||||
*retval = p->p_ucred->cr_uid;
|
||||
return 0;
|
||||
|
||||
case IBCS2_SECURE_SETLUID: /* set login uid */
|
||||
return EPERM;
|
||||
|
||||
default:
|
||||
printf("IBCS2: 'secure' cmd=%d not implemented\n", uap->cmd);
|
||||
}
|
||||
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_lseek(struct proc *p, register struct ibcs2_lseek_args *uap, int *retval)
|
||||
{
|
||||
struct lseek_args largs;
|
||||
off_t lret;
|
||||
int error;
|
||||
|
||||
largs.fd = uap->fd;
|
||||
largs.offset = uap->offset;
|
||||
largs.whence = uap->whence;
|
||||
error = lseek(p, &largs, (int *)&lret);
|
||||
*(long *)retval = lret;
|
||||
return (error);
|
||||
}
|
51
sys/i386/ibcs2/ibcs2_poll.h
Normal file
51
sys/i386/ibcs2/ibcs2_poll.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* 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. 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _IBCS2_POLL_H
|
||||
#define _IBCS2_POLL_H 1
|
||||
|
||||
/* iBCS2 poll commands */
|
||||
#define IBCS2_POLLIN 0x0001
|
||||
#define IBCS2_POLLPRI 0x0002
|
||||
#define IBCS2_POLLOUT 0x0004
|
||||
#define IBCS2_POLLERR 0x0008
|
||||
#define IBCS2_POLLHUP 0x0010
|
||||
#define IBCS2_POLLNVAL 0x0020
|
||||
#define IBCS2_POLLRDNORM 0x0040
|
||||
#define IBCS2_POLLWRNORM 0x0004
|
||||
#define IBCS2_POLLRDBAND 0x0080
|
||||
#define IBCS2_POLLWRBAND 0x0100
|
||||
#define IBCS2_READPOLL (IBCS2_POLLIN|IBCS2_POLLRDNORM|IBCS2_POLLRDBAND)
|
||||
#define IBCS2_WRITEPOLL (IBCS2_POLLOUT|IBCS2_POLLWRNORM|IBCS2_POLLWRBAND)
|
||||
|
||||
struct ibcs2_poll {
|
||||
int fd;
|
||||
short events;
|
||||
short revents;
|
||||
};
|
||||
|
||||
#endif /* _IBCS2_POLL_H */
|
359
sys/i386/ibcs2/ibcs2_proto.h
Normal file
359
sys/i386/ibcs2/ibcs2_proto.h
Normal file
|
@ -0,0 +1,359 @@
|
|||
/*
|
||||
* System call prototypes.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.master,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_SYSPROTO_H_
|
||||
#define _IBCS2_SYSPROTO_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
struct ibcs2_read_args {
|
||||
int fd;
|
||||
char * buf;
|
||||
u_int nbytes;
|
||||
};
|
||||
struct ibcs2_open_args {
|
||||
char * path;
|
||||
int flags;
|
||||
int mode;
|
||||
};
|
||||
struct ibcs2_wait_args {
|
||||
int a1;
|
||||
int a2;
|
||||
int a3;
|
||||
};
|
||||
struct ibcs2_creat_args {
|
||||
char * path;
|
||||
int mode;
|
||||
};
|
||||
struct ibcs2_unlink_args {
|
||||
char * path;
|
||||
};
|
||||
struct ibcs2_execv_args {
|
||||
char * path;
|
||||
char ** argp;
|
||||
};
|
||||
struct ibcs2_chdir_args {
|
||||
char * path;
|
||||
};
|
||||
struct ibcs2_time_args {
|
||||
ibcs2_time_t * tp;
|
||||
};
|
||||
struct ibcs2_mknod_args {
|
||||
char * path;
|
||||
int mode;
|
||||
int dev;
|
||||
};
|
||||
struct ibcs2_chmod_args {
|
||||
char * path;
|
||||
int mode;
|
||||
};
|
||||
struct ibcs2_chown_args {
|
||||
char * path;
|
||||
int uid;
|
||||
int gid;
|
||||
};
|
||||
struct ibcs2_stat_args {
|
||||
char * path;
|
||||
struct ibcs2_stat * st;
|
||||
};
|
||||
struct ibcs2_lseek_args {
|
||||
int fd;
|
||||
long offset;
|
||||
int whence;
|
||||
};
|
||||
struct ibcs2_mount_args {
|
||||
char * special;
|
||||
char * dir;
|
||||
int flags;
|
||||
int fstype;
|
||||
char * data;
|
||||
int len;
|
||||
};
|
||||
struct ibcs2_umount_args {
|
||||
char * name;
|
||||
};
|
||||
struct ibcs2_setuid_args {
|
||||
int uid;
|
||||
};
|
||||
struct ibcs2_stime_args {
|
||||
long * timep;
|
||||
};
|
||||
struct ibcs2_alarm_args {
|
||||
unsigned sec;
|
||||
};
|
||||
struct ibcs2_fstat_args {
|
||||
int fd;
|
||||
struct ibcs2_stat * st;
|
||||
};
|
||||
struct ibcs2_pause_args {
|
||||
int dummy;
|
||||
};
|
||||
struct ibcs2_utime_args {
|
||||
char * path;
|
||||
struct ibcs2_utimbuf * buf;
|
||||
};
|
||||
struct ibcs2_stty_args {
|
||||
int fd;
|
||||
struct sgttyb * buf;
|
||||
};
|
||||
struct ibcs2_gtty_args {
|
||||
int fd;
|
||||
struct sgttyb * buf;
|
||||
};
|
||||
struct ibcs2_access_args {
|
||||
char * path;
|
||||
int flags;
|
||||
};
|
||||
struct ibcs2_nice_args {
|
||||
int incr;
|
||||
};
|
||||
struct ibcs2_statfs_args {
|
||||
char * path;
|
||||
struct ibcs2_statfs * buf;
|
||||
int len;
|
||||
int fstype;
|
||||
};
|
||||
struct ibcs2_kill_args {
|
||||
int pid;
|
||||
int signo;
|
||||
};
|
||||
struct ibcs2_fstatfs_args {
|
||||
int fd;
|
||||
struct ibcs2_statfs * buf;
|
||||
int len;
|
||||
int fstype;
|
||||
};
|
||||
struct ibcs2_pgrpsys_args {
|
||||
int type;
|
||||
caddr_t dummy;
|
||||
int pid;
|
||||
int pgid;
|
||||
};
|
||||
struct ibcs2_xenix_args {
|
||||
int a1;
|
||||
int a2;
|
||||
int a3;
|
||||
int a4;
|
||||
int a5;
|
||||
};
|
||||
struct ibcs2_times_args {
|
||||
struct tms * tp;
|
||||
};
|
||||
struct ibcs2_plock_args {
|
||||
int cmd;
|
||||
};
|
||||
struct ibcs2_setgid_args {
|
||||
int gid;
|
||||
};
|
||||
struct ibcs2_sigsys_args {
|
||||
int sig;
|
||||
ibcs2_sig_t fp;
|
||||
};
|
||||
#ifdef SYSVMSG
|
||||
struct ibcs2_msgsys_args {
|
||||
int which;
|
||||
int a2;
|
||||
int a3;
|
||||
int a4;
|
||||
int a5;
|
||||
int a6;
|
||||
};
|
||||
#else
|
||||
#endif
|
||||
struct ibcs2_sysi86_args {
|
||||
int cmd;
|
||||
int * arg;
|
||||
};
|
||||
#ifdef SYSVSHM
|
||||
struct ibcs2_shmsys_args {
|
||||
int which;
|
||||
int a2;
|
||||
int a3;
|
||||
int a4;
|
||||
};
|
||||
#else
|
||||
#endif
|
||||
#ifdef SYSVSEM
|
||||
struct ibcs2_semsys_args {
|
||||
int which;
|
||||
int a2;
|
||||
int a3;
|
||||
int a4;
|
||||
int a5;
|
||||
};
|
||||
#else
|
||||
#endif
|
||||
struct ibcs2_ioctl_args {
|
||||
int fd;
|
||||
int cmd;
|
||||
caddr_t data;
|
||||
};
|
||||
struct ibcs2_uadmin_args {
|
||||
int cmd;
|
||||
int func;
|
||||
caddr_t data;
|
||||
};
|
||||
struct ibcs2_utssys_args {
|
||||
int a1;
|
||||
int a2;
|
||||
int flag;
|
||||
};
|
||||
struct ibcs2_execve_args {
|
||||
char * path;
|
||||
char ** argp;
|
||||
char ** envp;
|
||||
};
|
||||
struct ibcs2_fcntl_args {
|
||||
int fd;
|
||||
int cmd;
|
||||
char * arg;
|
||||
};
|
||||
struct ibcs2_ulimit_args {
|
||||
int cmd;
|
||||
int newlimit;
|
||||
};
|
||||
struct ibcs2_rmdir_args {
|
||||
char * path;
|
||||
};
|
||||
struct ibcs2_mkdir_args {
|
||||
char * path;
|
||||
int mode;
|
||||
};
|
||||
struct ibcs2_getdents_args {
|
||||
int fd;
|
||||
char * buf;
|
||||
int nbytes;
|
||||
};
|
||||
struct ibcs2_sysfs_args {
|
||||
int cmd;
|
||||
caddr_t d1;
|
||||
char * buf;
|
||||
};
|
||||
struct ibcs2_getmsg_args {
|
||||
int fd;
|
||||
struct ibcs2_stropts * ctl;
|
||||
struct ibcs2_stropts * dat;
|
||||
int * flags;
|
||||
};
|
||||
struct ibcs2_putmsg_args {
|
||||
int fd;
|
||||
struct ibcs2_stropts * ctl;
|
||||
struct ibcs2_stropts * dat;
|
||||
int flags;
|
||||
};
|
||||
struct ibcs2_poll_args {
|
||||
struct ibcs2_poll * fds;
|
||||
long nfds;
|
||||
int timeout;
|
||||
};
|
||||
struct ibcs2_secure_args {
|
||||
int cmd;
|
||||
int a1;
|
||||
int a2;
|
||||
int a3;
|
||||
int a4;
|
||||
int a5;
|
||||
};
|
||||
struct ibcs2_symlink_args {
|
||||
char * path;
|
||||
char * link;
|
||||
};
|
||||
struct ibcs2_lstat_args {
|
||||
char * path;
|
||||
struct ibcs2_stat * st;
|
||||
};
|
||||
struct ibcs2_readlink_args {
|
||||
char * path;
|
||||
char * buf;
|
||||
int count;
|
||||
};
|
||||
struct ibcs2_isc_args {
|
||||
int dummy;
|
||||
};
|
||||
int ibcs2_read __P((struct proc *, struct ibcs2_read_args *, int []));
|
||||
int ibcs2_open __P((struct proc *, struct ibcs2_open_args *, int []));
|
||||
int ibcs2_wait __P((struct proc *, struct ibcs2_wait_args *, int []));
|
||||
int ibcs2_creat __P((struct proc *, struct ibcs2_creat_args *, int []));
|
||||
int ibcs2_unlink __P((struct proc *, struct ibcs2_unlink_args *, int []));
|
||||
int ibcs2_execv __P((struct proc *, struct ibcs2_execv_args *, int []));
|
||||
int ibcs2_chdir __P((struct proc *, struct ibcs2_chdir_args *, int []));
|
||||
int ibcs2_time __P((struct proc *, struct ibcs2_time_args *, int []));
|
||||
int ibcs2_mknod __P((struct proc *, struct ibcs2_mknod_args *, int []));
|
||||
int ibcs2_chmod __P((struct proc *, struct ibcs2_chmod_args *, int []));
|
||||
int ibcs2_chown __P((struct proc *, struct ibcs2_chown_args *, int []));
|
||||
int ibcs2_stat __P((struct proc *, struct ibcs2_stat_args *, int []));
|
||||
int ibcs2_lseek __P((struct proc *, struct ibcs2_lseek_args *, int []));
|
||||
int ibcs2_mount __P((struct proc *, struct ibcs2_mount_args *, int []));
|
||||
int ibcs2_umount __P((struct proc *, struct ibcs2_umount_args *, int []));
|
||||
int ibcs2_setuid __P((struct proc *, struct ibcs2_setuid_args *, int []));
|
||||
int ibcs2_stime __P((struct proc *, struct ibcs2_stime_args *, int []));
|
||||
int ibcs2_alarm __P((struct proc *, struct ibcs2_alarm_args *, int []));
|
||||
int ibcs2_fstat __P((struct proc *, struct ibcs2_fstat_args *, int []));
|
||||
int ibcs2_pause __P((struct proc *, struct ibcs2_pause_args *, int []));
|
||||
int ibcs2_utime __P((struct proc *, struct ibcs2_utime_args *, int []));
|
||||
int ibcs2_stty __P((struct proc *, struct ibcs2_stty_args *, int []));
|
||||
int ibcs2_gtty __P((struct proc *, struct ibcs2_gtty_args *, int []));
|
||||
int ibcs2_access __P((struct proc *, struct ibcs2_access_args *, int []));
|
||||
int ibcs2_nice __P((struct proc *, struct ibcs2_nice_args *, int []));
|
||||
int ibcs2_statfs __P((struct proc *, struct ibcs2_statfs_args *, int []));
|
||||
int ibcs2_kill __P((struct proc *, struct ibcs2_kill_args *, int []));
|
||||
int ibcs2_fstatfs __P((struct proc *, struct ibcs2_fstatfs_args *, int []));
|
||||
int ibcs2_pgrpsys __P((struct proc *, struct ibcs2_pgrpsys_args *, int []));
|
||||
int ibcs2_xenix __P((struct proc *, struct ibcs2_xenix_args *, int []));
|
||||
int ibcs2_times __P((struct proc *, struct ibcs2_times_args *, int []));
|
||||
int ibcs2_plock __P((struct proc *, struct ibcs2_plock_args *, int []));
|
||||
int ibcs2_setgid __P((struct proc *, struct ibcs2_setgid_args *, int []));
|
||||
int ibcs2_sigsys __P((struct proc *, struct ibcs2_sigsys_args *, int []));
|
||||
#ifdef SYSVMSG
|
||||
int ibcs2_msgsys __P((struct proc *, struct ibcs2_msgsys_args *, int []));
|
||||
#else
|
||||
#endif
|
||||
int ibcs2_sysi86 __P((struct proc *, struct ibcs2_sysi86_args *, int []));
|
||||
#ifdef SYSVSHM
|
||||
int ibcs2_shmsys __P((struct proc *, struct ibcs2_shmsys_args *, int []));
|
||||
#else
|
||||
#endif
|
||||
#ifdef SYSVSEM
|
||||
int ibcs2_semsys __P((struct proc *, struct ibcs2_semsys_args *, int []));
|
||||
#else
|
||||
#endif
|
||||
int ibcs2_ioctl __P((struct proc *, struct ibcs2_ioctl_args *, int []));
|
||||
int ibcs2_uadmin __P((struct proc *, struct ibcs2_uadmin_args *, int []));
|
||||
int ibcs2_utssys __P((struct proc *, struct ibcs2_utssys_args *, int []));
|
||||
int ibcs2_execve __P((struct proc *, struct ibcs2_execve_args *, int []));
|
||||
int ibcs2_fcntl __P((struct proc *, struct ibcs2_fcntl_args *, int []));
|
||||
int ibcs2_ulimit __P((struct proc *, struct ibcs2_ulimit_args *, int []));
|
||||
int ibcs2_rmdir __P((struct proc *, struct ibcs2_rmdir_args *, int []));
|
||||
int ibcs2_mkdir __P((struct proc *, struct ibcs2_mkdir_args *, int []));
|
||||
int ibcs2_getdents __P((struct proc *, struct ibcs2_getdents_args *, int []));
|
||||
int ibcs2_sysfs __P((struct proc *, struct ibcs2_sysfs_args *, int []));
|
||||
int ibcs2_getmsg __P((struct proc *, struct ibcs2_getmsg_args *, int []));
|
||||
int ibcs2_putmsg __P((struct proc *, struct ibcs2_putmsg_args *, int []));
|
||||
int ibcs2_poll __P((struct proc *, struct ibcs2_poll_args *, int []));
|
||||
int ibcs2_secure __P((struct proc *, struct ibcs2_secure_args *, int []));
|
||||
int ibcs2_symlink __P((struct proc *, struct ibcs2_symlink_args *, int []));
|
||||
int ibcs2_lstat __P((struct proc *, struct ibcs2_lstat_args *, int []));
|
||||
int ibcs2_readlink __P((struct proc *, struct ibcs2_readlink_args *, int []));
|
||||
int ibcs2_isc __P((struct proc *, struct ibcs2_isc_args *, int []));
|
||||
|
||||
#ifdef COMPAT_43
|
||||
|
||||
#ifdef SYSVMSG
|
||||
#else
|
||||
#endif
|
||||
#ifdef SYSVSHM
|
||||
#else
|
||||
#endif
|
||||
#ifdef SYSVSEM
|
||||
#else
|
||||
#endif
|
||||
|
||||
#endif /* COMPAT_43 */
|
||||
|
||||
#endif /* !_IBCS2_SYSPROTO_H_ */
|
|
@ -1,462 +1,475 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Sean Eric Fagan
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
|
||||
/* $NetBSD: ibcs2_signal.c,v 1.6 1995/09/19 22:19:07 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Scott Bartram
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 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 the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 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 REGENTS 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 REGENTS 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.
|
||||
*
|
||||
* $Id: ibcs2_signal.c,v 1.1 1994/10/14 08:53:07 sos Exp $
|
||||
* 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 <i386/ibcs2/ibcs2.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/ioctl_compat.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/termios.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_param.h>
|
||||
#include <vm/vm_map.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/sysproto.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
#define DONTMASK (sigmask(SIGKILL)|sigmask(SIGSTOP)|sigmask(SIGCHLD))
|
||||
#define sigemptyset(s) bzero((s), sizeof(*(s)))
|
||||
#define sigismember(s, n) (*(s) & sigmask(n))
|
||||
#define sigaddset(s, n) (*(s) |= sigmask(n))
|
||||
|
||||
int bsd_to_ibcs2_signal[NSIG] = {
|
||||
0, IBCS2_SIGHUP, IBCS2_SIGINT, IBCS2_SIGQUIT,
|
||||
IBCS2_SIGILL, IBCS2_SIGTRAP, IBCS2_SIGABRT, IBCS2_SIGEMT,
|
||||
IBCS2_SIGFPE, IBCS2_SIGKILL, IBCS2_SIGBUS, IBCS2_SIGSEGV,
|
||||
IBCS2_SIGSYS, IBCS2_SIGPIPE, IBCS2_SIGALRM, IBCS2_SIGTERM,
|
||||
IBCS2_SIGURG, IBCS2_SIGSTOP, IBCS2_SIGTSTP, IBCS2_SIGCONT,
|
||||
IBCS2_SIGCHLD, IBCS2_SIGTTIN, IBCS2_SIGTTOU, IBCS2_SIGIO,
|
||||
IBCS2_SIGGXCPU, IBCS2_SIGGXFSZ, IBCS2_SIGVTALRM, IBCS2_SIGPROF,
|
||||
IBCS2_SIGWINCH, 0, IBCS2_SIGUSR1, IBCS2_SIGUSR2
|
||||
#define ibcs2_sigmask(n) (1 << ((n) - 1))
|
||||
#define ibcs2_sigemptyset(s) bzero((s), sizeof(*(s)))
|
||||
#define ibcs2_sigismember(s, n) (*(s) & ibcs2_sigmask(n))
|
||||
#define ibcs2_sigaddset(s, n) (*(s) |= ibcs2_sigmask(n))
|
||||
|
||||
static void ibcs2_to_bsd_sigset __P((const ibcs2_sigset_t *, sigset_t *));
|
||||
static void bsd_to_ibcs2_sigset __P((const sigset_t *, ibcs2_sigset_t *));
|
||||
static void ibcs2_to_bsd_sigaction __P((struct ibcs2_sigaction *,
|
||||
struct sigaction *));
|
||||
static void bsd_to_ibcs2_sigaction __P((struct sigaction *,
|
||||
struct ibcs2_sigaction *));
|
||||
|
||||
int bsd_to_ibcs2_sig[] = {
|
||||
0, /* 0 */
|
||||
IBCS2_SIGHUP, /* 1 */
|
||||
IBCS2_SIGINT, /* 2 */
|
||||
IBCS2_SIGQUIT, /* 3 */
|
||||
IBCS2_SIGILL, /* 4 */
|
||||
IBCS2_SIGTRAP, /* 5 */
|
||||
IBCS2_SIGABRT, /* 6 */
|
||||
IBCS2_SIGEMT, /* 7 */
|
||||
IBCS2_SIGFPE, /* 8 */
|
||||
IBCS2_SIGKILL, /* 9 */
|
||||
IBCS2_SIGBUS, /* 10 */
|
||||
IBCS2_SIGSEGV, /* 11 */
|
||||
IBCS2_SIGSYS, /* 12 */
|
||||
IBCS2_SIGPIPE, /* 13 */
|
||||
IBCS2_SIGALRM, /* 14 */
|
||||
IBCS2_SIGTERM, /* 15 */
|
||||
0, /* 16 - SIGURG */
|
||||
IBCS2_SIGSTOP, /* 17 */
|
||||
IBCS2_SIGTSTP, /* 18 */
|
||||
IBCS2_SIGCONT, /* 19 */
|
||||
IBCS2_SIGCLD, /* 20 */
|
||||
IBCS2_SIGTTIN, /* 21 */
|
||||
IBCS2_SIGTTOU, /* 22 */
|
||||
IBCS2_SIGPOLL, /* 23 */
|
||||
0, /* 24 - SIGXCPU */
|
||||
0, /* 25 - SIGXFSZ */
|
||||
IBCS2_SIGVTALRM, /* 26 */
|
||||
IBCS2_SIGPROF, /* 27 */
|
||||
IBCS2_SIGWINCH, /* 28 */
|
||||
0, /* 29 */
|
||||
IBCS2_SIGUSR1, /* 30 */
|
||||
IBCS2_SIGUSR2, /* 31 */
|
||||
};
|
||||
|
||||
int ibcs2_to_bsd_signal[IBCS2_NSIG] = {
|
||||
0, SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGEMT,
|
||||
SIGFPE, SIGKILL, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGALRM, SIGTERM,
|
||||
SIGUSR1, SIGUSR2, SIGCHLD, 0, SIGWINCH, SIGURG, SIGIO, SIGSTOP,
|
||||
SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU, SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ
|
||||
static int ibcs2_to_bsd_sig[] = {
|
||||
0, /* 0 */
|
||||
SIGHUP, /* 1 */
|
||||
SIGINT, /* 2 */
|
||||
SIGQUIT, /* 3 */
|
||||
SIGILL, /* 4 */
|
||||
SIGTRAP, /* 5 */
|
||||
SIGABRT, /* 6 */
|
||||
SIGEMT, /* 7 */
|
||||
SIGFPE, /* 8 */
|
||||
SIGKILL, /* 9 */
|
||||
SIGBUS, /* 10 */
|
||||
SIGSEGV, /* 11 */
|
||||
SIGSYS, /* 12 */
|
||||
SIGPIPE, /* 13 */
|
||||
SIGALRM, /* 14 */
|
||||
SIGTERM, /* 15 */
|
||||
SIGUSR1, /* 16 */
|
||||
SIGUSR2, /* 17 */
|
||||
SIGCHLD, /* 18 */
|
||||
0, /* 19 - SIGPWR */
|
||||
SIGWINCH, /* 20 */
|
||||
0, /* 21 */
|
||||
SIGIO, /* 22 */
|
||||
SIGSTOP, /* 23 */
|
||||
SIGTSTP, /* 24 */
|
||||
SIGCONT, /* 25 */
|
||||
SIGTTIN, /* 26 */
|
||||
SIGTTOU, /* 27 */
|
||||
SIGVTALRM, /* 28 */
|
||||
SIGPROF, /* 29 */
|
||||
0, /* 30 */
|
||||
0, /* 31 */
|
||||
};
|
||||
|
||||
static char ibcs2_sig_name[IBCS2_NSIG][10] = {
|
||||
"UNKNOWN", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP",
|
||||
"SIGABRT", "SIGEMT", "SIGFPE", "SIGKILL", "SIGBUS", "SIGSEGV",
|
||||
"SIGSYS", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGUSR1", "SIGUSR2",
|
||||
"SIGCHLD", "SIGPWR", "SIGWINCH", "SIGURG", "SIGIO", "SIGSTOP",
|
||||
"SIGTSTP", "SIGCONT", "SIGTTIN", "SIGTTOU", "SIGVTALRM",
|
||||
"SIGPROF", "SIGXCPU", "SIGXFSZ"
|
||||
};
|
||||
|
||||
/*#define LEGAL_SIG(x) \
|
||||
(((x & IBCS2_SIGMASK) < IBCS2_NSIG) ? (x & IBCS2_SIGMASK) : (0))*/
|
||||
int
|
||||
LEGAL_SIG(int sig)
|
||||
void
|
||||
ibcs2_to_bsd_sigset(iss, bss)
|
||||
const ibcs2_sigset_t *iss;
|
||||
sigset_t *bss;
|
||||
{
|
||||
if ((sig & IBCS2_SIGMASK) > IBCS2_NSIG) {
|
||||
printf("IBCS2: illegal ibcs2 signal %d(%08x)\n",
|
||||
sig & IBCS2_SIGMASK, sig);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return (sig & IBCS2_SIGMASK);
|
||||
}
|
||||
int i, newsig;
|
||||
|
||||
char *
|
||||
ibcs2_sig_to_str(int sig)
|
||||
{
|
||||
if (sig > IBCS2_NSIG) {
|
||||
printf("IBCS2: ibcs2 signal out of range (%d)\n", sig);
|
||||
return ibcs2_sig_name[0];
|
||||
}
|
||||
else
|
||||
return ibcs2_sig_name[sig];
|
||||
}
|
||||
|
||||
static sig_t
|
||||
ibcs2_to_bsd_sigfunc(ibcs2_sig_t func) {
|
||||
switch ((int)func) {
|
||||
case IBCS2_SIG_DFL:
|
||||
return SIG_DFL;
|
||||
case IBCS2_SIG_IGN:
|
||||
return SIG_IGN;
|
||||
case IBCS2_SIG_HOLD:
|
||||
return SIG_HOLD;
|
||||
default:
|
||||
return func;
|
||||
}
|
||||
}
|
||||
|
||||
static ibcs2_sig_t
|
||||
bsd_to_ibcs2_sigfunc(sig_t func) {
|
||||
switch ((int)func) {
|
||||
case SIG_DFL:
|
||||
return IBCS2_SIG_DFL;
|
||||
case SIG_IGN:
|
||||
return IBCS2_SIG_IGN;
|
||||
case SIG_CATCH:
|
||||
printf("IBCS2: Oops - SIG_CATCH does not translate :-(\n");
|
||||
return IBCS2_SIG_DFL;
|
||||
case SIG_HOLD:
|
||||
return IBCS2_SIG_HOLD;
|
||||
default:
|
||||
return func;
|
||||
}
|
||||
}
|
||||
|
||||
static sigset_t
|
||||
ibcs2_to_bsd_sigmask(ibcs2_sigset_t mask) {
|
||||
int i;
|
||||
sigset_t new = 0;
|
||||
|
||||
for (i = 1; i < NSIG; i++)
|
||||
if (mask & (1 << i-1))
|
||||
new |= (1 << (ibcs2_to_bsd_signal[i]-1));
|
||||
return new;
|
||||
}
|
||||
|
||||
static ibcs2_sigset_t
|
||||
bsd_to_ibcs2_sigmask(sigset_t mask) {
|
||||
int i;
|
||||
sigset_t new = 0;
|
||||
|
||||
for (i = 1; i < IBCS2_NSIG; i++)
|
||||
if (mask & (1 << i-1))
|
||||
new |= (1 << (bsd_to_ibcs2_signal[i]-1));
|
||||
return new;
|
||||
}
|
||||
|
||||
struct ibcs2_signal_args {
|
||||
int signo;
|
||||
ibcs2_sig_t func;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_sigset(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
struct sigaction tmp;
|
||||
int sig_bsd = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
|
||||
*retval = (int)bsd_to_ibcs2_sigfunc(p->p_sigacts->ps_sigact[sig_bsd]);
|
||||
if (args->func == IBCS2_SIG_HOLD) {
|
||||
(void) splhigh();
|
||||
p->p_sigmask |= (sigmask(sig_bsd) &~ DONTMASK);
|
||||
(void) spl0();
|
||||
}
|
||||
else {
|
||||
tmp.sa_mask = sigmask(sig_bsd);
|
||||
tmp.sa_handler = ibcs2_to_bsd_sigfunc(args->func);
|
||||
tmp.sa_flags = 0;
|
||||
setsigvec(p, sig_bsd, &tmp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_sighold(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
int sig_bsd = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
|
||||
(void) splhigh();
|
||||
*retval = p->p_sigmask;
|
||||
p->p_sigmask |= (sigmask(sig_bsd) & ~DONTMASK);
|
||||
(void) spl0();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_sigrelse(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
int sig_bsd = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
|
||||
(void) splhigh();
|
||||
*retval = p->p_sigmask;
|
||||
p->p_sigmask &= ~sigmask(sig_bsd);
|
||||
(void) spl0();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_sigignore(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
struct sigaction tmp;
|
||||
int sig_bsd = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
|
||||
tmp.sa_mask = sigmask(sig_bsd);
|
||||
tmp.sa_handler = SIG_IGN;
|
||||
tmp.sa_flags = 0;
|
||||
*retval = (int)bsd_to_ibcs2_sigfunc(p->p_sigacts->ps_sigact[sig_bsd]);
|
||||
setsigvec(p, sig_bsd, &tmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_sigpause(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
struct sigacts *ps = p->p_sigacts;
|
||||
int sig_bsd = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
|
||||
ps->ps_oldmask = p->p_sigmask;
|
||||
ps->ps_flags |= SAS_OLDMASK;
|
||||
p->p_sigmask = sigmask(sig_bsd) &~ DONTMASK;
|
||||
(void) tsleep((caddr_t) ps, PPAUSE|PCATCH, "i-pause", 0);
|
||||
*retval = -1;
|
||||
return EINTR;
|
||||
}
|
||||
|
||||
static int
|
||||
ibcs2_signal(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
struct sigaction tmp;
|
||||
int sig_bsd = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
|
||||
tmp.sa_mask = sigmask(sig_bsd);
|
||||
tmp.sa_handler = ibcs2_to_bsd_sigfunc(args->func);
|
||||
tmp.sa_flags = 0;
|
||||
*retval = (int)bsd_to_ibcs2_sigfunc(p->p_sigacts->ps_sigact[sig_bsd]);
|
||||
setsigvec(p, sig_bsd, &tmp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigsys(struct proc *p, struct ibcs2_signal_args *args, int *retval)
|
||||
{
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("IBCS2: 'sigsys' signo=%d(%s) ",
|
||||
args->signo & IBCS2_SIGMASK,
|
||||
ibcs2_sig_to_str(args->signo & IBCS2_SIGMASK));
|
||||
|
||||
switch (args->signo & ~IBCS2_SIGMASK ) {
|
||||
case 0x0000:
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("signal() func=%x\n", args->func);
|
||||
return ibcs2_signal(p, args, retval);
|
||||
case 0x0100:
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("sigset() func=%x\n", args->func);
|
||||
return ibcs2_sigset(p, args, retval);
|
||||
case 0x0200:
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("sighold()\n");
|
||||
return ibcs2_sighold(p, args, retval);
|
||||
case 0x0400:
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("sigrelse()\n");
|
||||
return ibcs2_sigrelse(p, args, retval);
|
||||
case 0x0800:
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("sigignore()\n");
|
||||
return ibcs2_sigignore(p, args, retval);
|
||||
case 0x1000:
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("sigpause()\n");
|
||||
return ibcs2_sigpause(p, args, retval);
|
||||
default:
|
||||
printf("IBCS2: unknown signal action\n"); break;
|
||||
}
|
||||
*retval = -1;
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
struct ibcs2_sigaction_args {
|
||||
int signo;
|
||||
struct sigaction *osa, *nsa;
|
||||
};
|
||||
|
||||
int
|
||||
ibcs2_sigaction(struct proc *p, struct ibcs2_sigaction_args *args, int *retval)
|
||||
{
|
||||
struct sigaction vec;
|
||||
register struct sigaction *sa;
|
||||
register struct sigacts *ps = p->p_sigacts;
|
||||
register int sig;
|
||||
int bit, error;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("IBCS2: 'sigaction' signo=%d(%s)\n",
|
||||
args->signo, ibcs2_sig_to_str(args->signo));
|
||||
sig = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)];
|
||||
if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) {
|
||||
*retval = -1;
|
||||
return EINVAL;
|
||||
}
|
||||
sa = &vec;
|
||||
if (args->osa) {
|
||||
sa->sa_handler = ps->ps_sigact[sig];
|
||||
sa->sa_mask = ps->ps_catchmask[sig];
|
||||
bit = sigmask(sig);
|
||||
sa->sa_flags = 0;
|
||||
if (p->p_flag & SA_NOCLDSTOP)
|
||||
sa->sa_flags = IBCS2_SA_NOCLDSTOP;
|
||||
if (error = copyout((caddr_t)sa, (caddr_t)args->osa,
|
||||
sizeof(vec))) {
|
||||
*retval = -1;
|
||||
return error;
|
||||
sigemptyset(bss);
|
||||
for (i = 1; i < IBCS2_NSIG; i++) {
|
||||
if (ibcs2_sigismember(iss, i)) {
|
||||
newsig = ibcs2_to_bsd_sig[i];
|
||||
if (newsig)
|
||||
sigaddset(bss, newsig);
|
||||
}
|
||||
}
|
||||
if (args->nsa) {
|
||||
if (error = copyin((caddr_t)args->nsa, (caddr_t)sa,
|
||||
sizeof(vec))) {
|
||||
*retval = -1;
|
||||
return error;
|
||||
}
|
||||
|
||||
static void
|
||||
bsd_to_ibcs2_sigset(bss, iss)
|
||||
const sigset_t *bss;
|
||||
ibcs2_sigset_t *iss;
|
||||
{
|
||||
int i, newsig;
|
||||
|
||||
ibcs2_sigemptyset(iss);
|
||||
for (i = 1; i < NSIG; i++) {
|
||||
if (sigismember(bss, i)) {
|
||||
newsig = bsd_to_ibcs2_sig[i];
|
||||
if (newsig)
|
||||
ibcs2_sigaddset(iss, newsig);
|
||||
}
|
||||
/*
|
||||
* iBCS2 only defines one SA_ flag right now
|
||||
*/
|
||||
if (vec.sa_flags & IBCS2_SA_NOCLDSTOP)
|
||||
vec.sa_flags = SA_NOCLDSTOP;
|
||||
setsigvec(p, sig, sa);
|
||||
}
|
||||
*retval = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ibcs2_to_bsd_sigaction(isa, bsa)
|
||||
struct ibcs2_sigaction *isa;
|
||||
struct sigaction *bsa;
|
||||
{
|
||||
|
||||
bsa->sa_handler = isa->sa_handler;
|
||||
ibcs2_to_bsd_sigset(&isa->sa_mask, &bsa->sa_mask);
|
||||
bsa->sa_flags = 0;
|
||||
if ((isa->sa_flags & IBCS2_SA_NOCLDSTOP) != 0)
|
||||
bsa->sa_flags |= SA_NOCLDSTOP;
|
||||
}
|
||||
|
||||
static void
|
||||
bsd_to_ibcs2_sigaction(bsa, isa)
|
||||
struct sigaction *bsa;
|
||||
struct ibcs2_sigaction *isa;
|
||||
{
|
||||
|
||||
isa->sa_handler = bsa->sa_handler;
|
||||
bsd_to_ibcs2_sigset(&bsa->sa_mask, &isa->sa_mask);
|
||||
isa->sa_flags = 0;
|
||||
if ((bsa->sa_flags & SA_NOCLDSTOP) != 0)
|
||||
isa->sa_flags |= SA_NOCLDSTOP;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigaction(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_sigaction_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct ibcs2_sigaction *nisa, *oisa, tmpisa;
|
||||
struct sigaction *nbsa, *obsa, tmpbsa;
|
||||
struct sigaction_args sa;
|
||||
caddr_t sg;
|
||||
int error;
|
||||
|
||||
sg = stackgap_init();
|
||||
nisa = SCARG(uap, act);
|
||||
oisa = SCARG(uap, oact);
|
||||
|
||||
if (oisa != NULL)
|
||||
obsa = stackgap_alloc(&sg, sizeof(struct sigaction));
|
||||
else
|
||||
obsa = NULL;
|
||||
|
||||
if (nisa != NULL) {
|
||||
nbsa = stackgap_alloc(&sg, sizeof(struct sigaction));
|
||||
if ((error = copyin(nisa, &tmpisa, sizeof(tmpisa))) != 0)
|
||||
return error;
|
||||
ibcs2_to_bsd_sigaction(&tmpisa, &tmpbsa);
|
||||
if ((error = copyout(&tmpbsa, nbsa, sizeof(tmpbsa))) != 0)
|
||||
return error;
|
||||
} else
|
||||
nbsa = NULL;
|
||||
|
||||
SCARG(&sa, signum) = ibcs2_to_bsd_sig[SCARG(uap, sig)];
|
||||
SCARG(&sa, nsa) = nbsa;
|
||||
SCARG(&sa, osa) = obsa;
|
||||
|
||||
if ((error = sigaction(p, &sa, retval)) != 0)
|
||||
return error;
|
||||
|
||||
if (oisa != NULL) {
|
||||
if ((error = copyin(obsa, &tmpbsa, sizeof(tmpbsa))) != 0)
|
||||
return error;
|
||||
bsd_to_ibcs2_sigaction(&tmpbsa, &tmpisa);
|
||||
if ((error = copyout(&tmpisa, oisa, sizeof(tmpisa))) != 0)
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ibcs2_sigprocmask_args {
|
||||
int how;
|
||||
unsigned long *mask;
|
||||
unsigned long *omask;
|
||||
};
|
||||
int
|
||||
ibcs2_sigsys(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_sigsys_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int signum = ibcs2_to_bsd_sig[IBCS2_SIGNO(SCARG(uap, sig))];
|
||||
int error;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
if (signum <= 0 || signum >= IBCS2_NSIG) {
|
||||
if (IBCS2_SIGCALL(SCARG(uap, sig)) == IBCS2_SIGNAL_MASK ||
|
||||
IBCS2_SIGCALL(SCARG(uap, sig)) == IBCS2_SIGSET_MASK)
|
||||
*retval = (int)IBCS2_SIG_ERR;
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
switch (IBCS2_SIGCALL(SCARG(uap, sig))) {
|
||||
/*
|
||||
* sigset is identical to signal() except that SIG_HOLD is allowed as
|
||||
* an action.
|
||||
*/
|
||||
case IBCS2_SIGSET_MASK:
|
||||
/*
|
||||
* sigset is identical to signal() except
|
||||
* that SIG_HOLD is allowed as
|
||||
* an action.
|
||||
*/
|
||||
if (SCARG(uap, fp) == IBCS2_SIG_HOLD) {
|
||||
struct sigprocmask_args sa;
|
||||
|
||||
SCARG(&sa, how) = SIG_BLOCK;
|
||||
SCARG(&sa, mask) = sigmask(signum);
|
||||
return sigprocmask(p, &sa, retval);
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case IBCS2_SIGNAL_MASK:
|
||||
{
|
||||
struct sigaction_args sa_args;
|
||||
struct sigaction *nbsa, *obsa, sa;
|
||||
|
||||
nbsa = stackgap_alloc(&sg, sizeof(struct sigaction));
|
||||
obsa = stackgap_alloc(&sg, sizeof(struct sigaction));
|
||||
SCARG(&sa_args, signum) = signum;
|
||||
SCARG(&sa_args, nsa) = nbsa;
|
||||
SCARG(&sa_args, osa) = obsa;
|
||||
|
||||
sa.sa_handler = SCARG(uap, fp);
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
#if 0
|
||||
if (signum != SIGALRM)
|
||||
sa.sa_flags = SA_RESTART;
|
||||
#endif
|
||||
if ((error = copyout(&sa, nbsa, sizeof(sa))) != 0)
|
||||
return error;
|
||||
if ((error = sigaction(p, &sa_args, retval)) != 0) {
|
||||
DPRINTF(("signal: sigaction failed: %d\n",
|
||||
error));
|
||||
*retval = (int)IBCS2_SIG_ERR;
|
||||
return error;
|
||||
}
|
||||
if ((error = copyin(obsa, &sa, sizeof(sa))) != 0)
|
||||
return error;
|
||||
*retval = (int)sa.sa_handler;
|
||||
return 0;
|
||||
}
|
||||
|
||||
case IBCS2_SIGHOLD_MASK:
|
||||
{
|
||||
struct sigprocmask_args sa;
|
||||
|
||||
SCARG(&sa, how) = SIG_BLOCK;
|
||||
SCARG(&sa, mask) = sigmask(signum);
|
||||
return sigprocmask(p, &sa, retval);
|
||||
}
|
||||
|
||||
case IBCS2_SIGRELSE_MASK:
|
||||
{
|
||||
struct sigprocmask_args sa;
|
||||
|
||||
SCARG(&sa, how) = SIG_UNBLOCK;
|
||||
SCARG(&sa, mask) = sigmask(signum);
|
||||
return sigprocmask(p, &sa, retval);
|
||||
}
|
||||
|
||||
case IBCS2_SIGIGNORE_MASK:
|
||||
{
|
||||
struct sigaction_args sa_args;
|
||||
struct sigaction *bsa, sa;
|
||||
|
||||
bsa = stackgap_alloc(&sg, sizeof(struct sigaction));
|
||||
SCARG(&sa_args, signum) = signum;
|
||||
SCARG(&sa_args, nsa) = bsa;
|
||||
SCARG(&sa_args, osa) = NULL;
|
||||
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
if ((error = copyout(&sa, bsa, sizeof(sa))) != 0)
|
||||
return error;
|
||||
if ((error = sigaction(p, &sa_args, retval)) != 0) {
|
||||
DPRINTF(("sigignore: sigaction failed\n"));
|
||||
return error;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case IBCS2_SIGPAUSE_MASK:
|
||||
{
|
||||
struct sigsuspend_args sa;
|
||||
|
||||
SCARG(&sa, mask) = p->p_sigmask &~ sigmask(signum);
|
||||
return sigsuspend(p, &sa, retval);
|
||||
}
|
||||
|
||||
default:
|
||||
return ENOSYS;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigprocmask(struct proc *p, struct ibcs2_sigprocmask_args *args, int *retval)
|
||||
ibcs2_sigprocmask(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_sigprocmask_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int error;
|
||||
sigset_t umask;
|
||||
sigset_t omask = bsd_to_ibcs2_sigmask(p->p_sigmask);
|
||||
ibcs2_sigset_t iss;
|
||||
sigset_t bss;
|
||||
int error = 0;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("IBCS2: 'sigprocmask' how=%d\n", args->how);
|
||||
if (error = copyin(args->mask, &umask, sizeof(args->mask))) {
|
||||
*retval = -1;
|
||||
return error;
|
||||
if (SCARG(uap, oset) != NULL) {
|
||||
/* Fix the return value first if needed */
|
||||
bsd_to_ibcs2_sigset(&p->p_sigmask, &iss);
|
||||
if ((error = copyout(&iss, SCARG(uap, oset), sizeof(iss))) != 0)
|
||||
return error;
|
||||
}
|
||||
umask = ibcs2_to_bsd_sigmask(umask);
|
||||
if (args->omask)
|
||||
if (error = copyout(&omask, args->omask, sizeof(args->omask))) {
|
||||
*retval = -1;
|
||||
return error;
|
||||
}
|
||||
|
||||
if (SCARG(uap, set) == NULL)
|
||||
/* Just examine */
|
||||
return 0;
|
||||
|
||||
if ((error = copyin(SCARG(uap, set), &iss, sizeof(iss))) != 0)
|
||||
return error;
|
||||
|
||||
ibcs2_to_bsd_sigset(&iss, &bss);
|
||||
|
||||
(void) splhigh();
|
||||
switch (args->how) {
|
||||
case 0: /* SIG_SETMASK */
|
||||
p->p_sigmask = umask &~ DONTMASK;
|
||||
|
||||
switch (SCARG(uap, how)) {
|
||||
case IBCS2_SIG_BLOCK:
|
||||
p->p_sigmask |= bss & ~sigcantmask;
|
||||
break;
|
||||
|
||||
case 1: /* SIG_BLOCK */
|
||||
p->p_sigmask |= (umask &~ DONTMASK);
|
||||
case IBCS2_SIG_UNBLOCK:
|
||||
p->p_sigmask &= ~bss;
|
||||
break;
|
||||
|
||||
case 2: /* SIG_UNBLOCK */
|
||||
p->p_sigmask &= ~umask;
|
||||
case IBCS2_SIG_SETMASK:
|
||||
p->p_sigmask = bss & ~sigcantmask;
|
||||
break;
|
||||
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
(void) spl0();
|
||||
if (error)
|
||||
*retval = -1;
|
||||
else
|
||||
*retval = 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
struct ibcs2_sigpending_args {
|
||||
unsigned long *sigs;
|
||||
};
|
||||
return error;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigpending(struct proc *p, struct ibcs2_sigpending_args *args, int *retval)
|
||||
ibcs2_sigpending(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_sigpending_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int error;
|
||||
sigset_t mask = bsd_to_ibcs2_sigmask(p->p_siglist);
|
||||
sigset_t bss;
|
||||
ibcs2_sigset_t iss;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("IBCS2: 'sigpending' which=%x\n", args->sigs);
|
||||
if (error = copyout(&mask, args->sigs, sizeof(unsigned long)))
|
||||
*retval = -1;
|
||||
else
|
||||
*retval = 0;
|
||||
return error;
|
||||
bss = p->p_siglist & p->p_sigmask;
|
||||
bsd_to_ibcs2_sigset(&bss, &iss);
|
||||
|
||||
return copyout(&iss, SCARG(uap, mask), sizeof(iss));
|
||||
}
|
||||
|
||||
struct ibcs2_sigsuspend_args {
|
||||
sigset_t *mask;
|
||||
};
|
||||
|
||||
int
|
||||
ibcs2_sigsuspend(struct proc *p, struct ibcs2_sigsuspend_args *args, int *retval)
|
||||
ibcs2_sigsuspend(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_sigsuspend_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
sigset_t mask = ibcs2_to_bsd_sigmask((sigset_t)args->mask);
|
||||
ibcs2_sigset_t sss;
|
||||
sigset_t bss;
|
||||
struct sigsuspend_args sa;
|
||||
int error;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("IBCS2: 'sigsuspend'\n");
|
||||
return sigsuspend(p, &mask, retval);
|
||||
if ((error = copyin(SCARG(uap, mask), &sss, sizeof(sss))) != 0)
|
||||
return error;
|
||||
|
||||
ibcs2_to_bsd_sigset(&sss, &bss);
|
||||
|
||||
SCARG(&sa, mask) = bss;
|
||||
return sigsuspend(p, &sa, retval);
|
||||
}
|
||||
|
||||
struct kill_args {
|
||||
int pid;
|
||||
int signo;
|
||||
};
|
||||
|
||||
int
|
||||
ibcs2_kill(struct proc *p, struct kill_args *args, int *retval)
|
||||
ibcs2_pause(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_pause_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct kill_args tmp;
|
||||
struct sigsuspend_args bsa;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_SIGNAL)
|
||||
printf("IBCS2: 'kill' pid=%d, sig=%d(%s)\n", args->pid,
|
||||
args->signo, ibcs2_sig_to_str(args->signo));
|
||||
tmp.pid = args->pid;
|
||||
tmp.signo = (args->signo < IBCS2_NSIG) ?
|
||||
ibcs2_to_bsd_signal[args->signo] : IBCS2_NSIG;
|
||||
return kill(p, &tmp, retval);
|
||||
SCARG(&bsa, mask) = p->p_sigmask;
|
||||
return sigsuspend(p, &bsa, retval);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_kill(p, uap, retval)
|
||||
register struct proc *p;
|
||||
struct ibcs2_kill_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct kill_args ka;
|
||||
|
||||
SCARG(&ka, pid) = SCARG(uap, pid);
|
||||
SCARG(&ka, signum) = ibcs2_to_bsd_sig[SCARG(uap, signo)];
|
||||
return kill(p, &ka, retval);
|
||||
}
|
||||
|
|
|
@ -79,15 +79,6 @@
|
|||
#define IBCS2_SIGNO(x) ((x) & IBCS2_SIGNO_MASK)
|
||||
#define IBCS2_SIGCALL(x) ((x) & ~IBCS2_SIGNO_MASK)
|
||||
|
||||
#define IBCS2_SIG_DFL (void(*)())0
|
||||
#define IBCS2_SIG_ERR (void(*)())-1
|
||||
#define IBCS2_SIG_IGN (void(*)())1
|
||||
#define IBCS2_SIG_HOLD (void(*)())2
|
||||
|
||||
#define IBCS2_SIG_SETMASK 0
|
||||
#define IBCS2_SIG_BLOCK 1
|
||||
#define IBCS2_SIG_UNBLOCK 2
|
||||
|
||||
typedef long ibcs2_sigset_t;
|
||||
typedef void (*ibcs2_sig_t) __P((int));
|
||||
|
||||
|
@ -97,6 +88,15 @@ struct ibcs2_sigaction {
|
|||
int sa_flags;
|
||||
};
|
||||
|
||||
#define IBCS2_SIG_DFL (ibcs2_sig_t)(0)
|
||||
#define IBCS2_SIG_ERR (ibcs2_sig_t)(-1)
|
||||
#define IBCS2_SIG_IGN (ibcs2_sig_t)(1)
|
||||
#define IBCS2_SIG_HOLD (ibcs2_sig_t)(2)
|
||||
|
||||
#define IBCS2_SIG_SETMASK 0
|
||||
#define IBCS2_SIG_BLOCK 1
|
||||
#define IBCS2_SIG_UNBLOCK 2
|
||||
|
||||
/* sa_flags */
|
||||
#define IBCS2_SA_NOCLDSTOP 1
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,21 +1,15 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Mostyn Lewis
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Scott Bartram
|
||||
* Copyright (c) 1994 Arne H Juul
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is based on code which is:
|
||||
* Copyright (c) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
|
||||
*
|
||||
* 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 withough specific prior written permission
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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
|
||||
|
@ -27,370 +21,106 @@
|
|||
* 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.
|
||||
*
|
||||
* $Id: ibcs2_socksys.h,v 1.2 1994/10/17 22:13:10 sos Exp $
|
||||
*/
|
||||
|
||||
struct ss_call {
|
||||
int arg[7];
|
||||
};
|
||||
|
||||
/* Alien socket */
|
||||
struct alien_sockaddr {
|
||||
unsigned short sa_family; /* address family, AF_xxx */
|
||||
char sa_data[14]; /* 14 bytes of protocol address */
|
||||
};
|
||||
#ifndef _IBCS2_SOCKSYS_H
|
||||
#define _IBCS2_SOCKSYS_H 1
|
||||
|
||||
struct alien_in_addr {
|
||||
unsigned long int s_addr;
|
||||
};
|
||||
#include <sys/ioccom.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define __ALIEN_SOCK_SIZE__ 16 /* sizeof(struct alien_sockaddr)*/
|
||||
struct alien_sockaddr_in {
|
||||
short int sin_family; /* Address family */
|
||||
unsigned short int sin_port; /* Port number */
|
||||
struct alien_in_addr sin_addr; /* Internet address */
|
||||
unsigned char __filling[__ALIEN_SOCK_SIZE__ - sizeof(short int) -
|
||||
sizeof(unsigned short int) - sizeof(struct alien_in_addr)];
|
||||
};
|
||||
#define SOCKSYS_ACCEPT 1
|
||||
#define SOCKSYS_BIND 2
|
||||
#define SOCKSYS_CONNECT 3
|
||||
#define SOCKSYS_GETPEERNAME 4
|
||||
#define SOCKSYS_GETSOCKNAME 5
|
||||
#define SOCKSYS_GETSOCKOPT 6
|
||||
#define SOCKSYS_LISTEN 7
|
||||
#define SOCKSYS_RECV 8
|
||||
#define SOCKSYS_RECVFROM 9
|
||||
#define SOCKSYS_SEND 10
|
||||
#define SOCKSYS_SENDTO 11
|
||||
#define SOCKSYS_SETSOCKOPT 12
|
||||
#define SOCKSYS_SHUTDOWN 13
|
||||
#define SOCKSYS_SOCKET 14
|
||||
#define SOCKSYS_SELECT 15
|
||||
#define SOCKSYS_GETIPDOMAIN 16
|
||||
#define SOCKSYS_SETIPDOMAIN 17
|
||||
#define SOCKSYS_ADJTIME 18
|
||||
#define SOCKSYS_SETREUID 19
|
||||
#define SOCKSYS_SETREGID 20
|
||||
#define SOCKSYS_GETTIME 21
|
||||
#define SOCKSYS_SETTIME 22
|
||||
#define SOCKSYS_GETITIMER 23
|
||||
#define SOCKSYS_SETITIMER 24
|
||||
|
||||
struct sgdomarg {
|
||||
char *name;
|
||||
int namelen;
|
||||
};
|
||||
#define IBCS2_SIOCSHIWAT _IOW('S', 1, int)
|
||||
#define IBCS2_SIOCGHIWAT _IOR('S', 2, int)
|
||||
#define IBCS2_SIOCSLOWAT _IOW('S', 3, int)
|
||||
#define IBCS2_SIOCGLOWAT _IOR('S', 4, int)
|
||||
#define IBCS2_SIOCATMARK _IOR('S', 5, int)
|
||||
#define IBCS2_SIOCSPGRP _IOW('S', 6, int)
|
||||
#define IBCS2_SIOCGPGRP _IOR('S', 7, int)
|
||||
#define IBCS2_FIONREAD _IOR('S', 8, int)
|
||||
#define IBCS2_FIONBIO _IOW('S', 9, int)
|
||||
#define IBCS2_FIOASYNC _IOW('S', 10, int)
|
||||
#define IBCS2_SIOCPROTO _IOW('S', 11, struct socknewproto)
|
||||
#define IBCS2_SIOCGETNAME _IOR('S', 12, struct sockaddr)
|
||||
#define IBCS2_SIOCGETPEER _IOR('S', 13, struct sockaddr)
|
||||
#define IBCS2_IF_UNITSEL _IOW('S', 14, int)
|
||||
#define IBCS2_SIOCXPROTO _IO('S', 15)
|
||||
|
||||
struct lstatarg {
|
||||
char *fname;
|
||||
void *statb;
|
||||
#define IBCS2_SIOCADDRT _IOW('R', 9, struct rtentry)
|
||||
#define IBCS2_SIOCDELRT _IOW('R', 10, struct rtentry)
|
||||
|
||||
#define IBCS2_SIOCSIFADDR _IOW('I', 11, struct ifreq)
|
||||
#define IBCS2_SIOCGIFADDR _IOWR('I', 12, struct ifreq)
|
||||
#define IBCS2_SIOCSIFDSTADDR _IOW('I', 13, struct ifreq)
|
||||
#define IBCS2_SIOCGIFDSTADDR _IOWR('I', 14, struct ifreq)
|
||||
#define IBCS2_SIOCSIFFLAGS _IOW('I', 15, struct ifreq)
|
||||
#define IBCS2_SIOCGIFFLAGS _IOWR('I', 16, struct ifreq)
|
||||
#define IBCS2_SIOCGIFCONF _IOWR('I', 17, struct ifconf)
|
||||
#define IBCS2_SIOCSIFMTU _IOW('I', 21, struct ifreq)
|
||||
#define IBCS2_SIOCGIFMTU _IOWR('I', 22, struct ifreq)
|
||||
#define IBCS2_SIOCIFDETACH _IOW('I', 26, struct ifreq)
|
||||
#define IBCS2_SIOCGENPSTATS _IOWR('I', 27, struct ifreq)
|
||||
#define IBCS2_SIOCX25XMT _IOWR('I', 29, struct ifreq)
|
||||
#define IBCS2_SIOCX25RCV _IOWR('I', 30, struct ifreq)
|
||||
#define IBCS2_SIOCX25TBL _IOWR('I', 31, struct ifreq)
|
||||
#define IBCS2_SIOCGIFBRDADDR _IOWR('I', 32, struct ifreq)
|
||||
#define IBCS2_SIOCSIFBRDADDR _IOW('I', 33, struct ifreq)
|
||||
#define IBCS2_SIOCGIFNETMASK _IOWR('I', 34, struct ifreq)
|
||||
#define IBCS2_SIOCSIFNETMASK _IOW('I', 35, struct ifreq)
|
||||
#define IBCS2_SIOCGIFMETRIC _IOWR('I', 36, struct ifreq)
|
||||
#define IBCS2_SIOCSIFMETRIC _IOW('I', 37, struct ifreq)
|
||||
#define IBCS2_SIOCSARP _IOW('I', 38, struct arpreq)
|
||||
#define IBCS2_SIOCGARP _IOWR('I', 39, struct arpreq)
|
||||
#define IBCS2_SIOCDARP _IOW('I', 40, struct arpreq)
|
||||
#define IBCS2_SIOCSIFNAME _IOW('I', 41, struct ifreq)
|
||||
#define IBCS2_SIOCGIFONEP _IOWR('I', 42, struct ifreq)
|
||||
#define IBCS2_SIOCSIFONEP _IOW('I', 43, struct ifreq)
|
||||
#define IBCS2_SIOCGENADDR _IOWR('I', 65, struct ifreq)
|
||||
#define IBCS2_SIOCSOCKSYS _IOW('I', 66, struct socksysreq)
|
||||
|
||||
struct socksysreq {
|
||||
int realargs[7];
|
||||
};
|
||||
|
||||
struct socknewproto {
|
||||
int family; /* address family (AF_INET, etc.) */
|
||||
int type; /* protocol type (SOCK_STREAM, etc.) */
|
||||
int proto; /* per family proto number */
|
||||
dev_t dev; /* major/minor to use (must be a clone) */
|
||||
int flags; /* protosw flags */
|
||||
int family;
|
||||
int type;
|
||||
int proto;
|
||||
ibcs2_dev_t dev;
|
||||
int flags;
|
||||
};
|
||||
|
||||
/* System type ordinals */
|
||||
#define SS_FREEBSD 0
|
||||
#define SS_SYSVR4 1
|
||||
#define SS_SYSVR3 2
|
||||
#define SS_SCO_32 3
|
||||
#define SS_WYSE_321 4
|
||||
#define SS_ISC 5
|
||||
#define SS_LINUX 6
|
||||
|
||||
|
||||
/* Socksys macros */
|
||||
#define IOCTL(cmd) \
|
||||
if(error = ss_IOCTL(fp, cmd, arg, p))\
|
||||
return(error);
|
||||
#define SYSCALL(number,conv_arg,indicator) \
|
||||
if(error = ss_SYSCALL(number,conv_arg,indicator,arg,p,retval))\
|
||||
return(error);
|
||||
#define SYSCALL_N(number,conv_arg,indicator) \
|
||||
arg = (caddr_t)(((int *)arg) - 1);\
|
||||
if(error = ss_SYSCALL(number,conv_arg,indicator,arg,p,retval))\
|
||||
return(error);
|
||||
#define SYSCALLX(number,arg) (*sysent[number].sy_call)(p, (caddr_t)arg, retval)
|
||||
#define SYSCALL_RETURN(number) SYSCALL(number) ; IBCS2_MAGIC_RETURN
|
||||
|
||||
/* Socksys commands */
|
||||
#define CMD_SO_ACCEPT 1
|
||||
#define CMD_SO_BIND 2
|
||||
#define CMD_SO_CONNECT 3
|
||||
#define CMD_SO_GETPEERNAME 4
|
||||
#define CMD_SO_GETSOCKNAME 5
|
||||
#define CMD_SO_GETSOCKOPT 6
|
||||
#define CMD_SO_LISTEN 7
|
||||
#define CMD_SO_RECV 8
|
||||
#define CMD_SO_RECVFROM 9
|
||||
#define CMD_SO_SEND 10
|
||||
#define CMD_SO_SENDTO 11
|
||||
#define CMD_SO_SETSOCKOPT 12
|
||||
#define CMD_SO_SHUTDOWN 13
|
||||
#define CMD_SO_SOCKET 14
|
||||
#define CMD_SO_SELECT 15
|
||||
#define CMD_SO_GETIPDOMAIN 16
|
||||
#define CMD_SO_SETIPDOMAIN 17
|
||||
#define CMD_SO_ADJTIME 18
|
||||
#define CMD_SO_SETREUID 19
|
||||
#define CMD_SO_SETREGID 20
|
||||
#define CMD_SO_GETTIME 21
|
||||
#define CMD_SO_SETTIME 22
|
||||
#define CMD_SO_GETITIMER 23
|
||||
#define CMD_SO_SETITIMER 24
|
||||
|
||||
#define CMD_SO_SS_DEBUG 255
|
||||
|
||||
/* socksys ioctls */
|
||||
#define SS_IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
|
||||
#define SS_IOC_VOID 0x20000000 /* no parameters */
|
||||
#define SS_IOC_OUT 0x40000000 /* copy out parameters */
|
||||
#define SS_IOC_IN 0x80000000 /* copy in parameters */
|
||||
#define SS_IOC_INOUT (SS_IOC_IN|SS_IOC_OUT)
|
||||
|
||||
#define SS_IO(x,y) (SS_IOC_VOID|(x<<8)|y)
|
||||
#define SS_IOR(x,y,t) (SS_IOC_OUT|((sizeof(t)&SS_IOCPARM_MASK)<<16)|(x<<8)|y)
|
||||
#define SS_IOW(x,y,t) (SS_IOC_IN|((sizeof(t)&SS_IOCPARM_MASK)<<16)|(x<<8)|y)
|
||||
#define SS_IOWR(x,y,t) (SS_IOC_INOUT|((sizeof(t)&SS_IOCPARM_MASK)<<16)|(x<<8)|y)
|
||||
|
||||
#define SS_SIOCSHIWAT SS_IOW ('S', 1, int) /* set high watermark */
|
||||
#define SS_SIOCGHIWAT SS_IOR ('S', 2, int) /* get high watermark */
|
||||
#define SS_SIOCSLOWAT SS_IOW ('S', 3, int) /* set low watermark */
|
||||
#define SS_SIOCGLOWAT SS_IOR ('S', 4, int) /* get low watermark */
|
||||
#define SS_SIOCATMARK SS_IOR ('S', 5, int) /* at oob mark? */
|
||||
#define SS_SIOCSPGRP SS_IOW ('S', 6, int) /* set process group */
|
||||
#define SS_SIOCGPGRP SS_IOR ('S', 7, int) /* get process group */
|
||||
#define SS_FIONREAD SS_IOR ('S', 8, int)
|
||||
#define SS_FIONBIO SS_IOW ('S', 9, int)
|
||||
#define SS_FIOASYNC SS_IOW ('S', 10, int)
|
||||
#define SS_SIOCPROTO SS_IOW ('S', 11, struct socknewproto) /* link proto */
|
||||
#define SS_SIOCGETNAME SS_IOR ('S', 12, struct sockaddr) /* getsockname */
|
||||
#define SS_SIOCGETPEER SS_IOR ('S', 13,struct sockaddr) /* getpeername */
|
||||
#define SS_IF_UNITSEL SS_IOW ('S', 14, int)/* set unit number */
|
||||
#define SS_SIOCXPROTO SS_IO ('S', 15) /* empty proto table */
|
||||
|
||||
#define SS_SIOCADDRT SS_IOW ('R', 9, struct ortentry) /* add route */
|
||||
#define SS_SIOCDELRT SS_IOW ('R', 10, struct ortentry)/* delete route */
|
||||
|
||||
#define SS_SIOCSIFADDR SS_IOW ('I', 11, struct ifreq)/* set ifnet address */
|
||||
#define SS_SIOCGIFADDR SS_IOWR('I', 12, struct ifreq)/* get ifnet address */
|
||||
#define SS_SIOCSIFDSTADDR SS_IOW ('I', 13, struct ifreq)/* set p-p address */
|
||||
#define SS_SIOCGIFDSTADDR SS_IOWR('I', 14,struct ifreq) /* get p-p address */
|
||||
#define SS_SIOCSIFFLAGS SS_IOW ('I', 15, struct ifreq)/* set ifnet flags */
|
||||
#define SS_SIOCGIFFLAGS SS_IOWR('I', 16, struct ifreq)/* get ifnet flags */
|
||||
#define SS_SIOCGIFCONF SS_IOWR('I', 17, struct ifconf)/* get ifnet list */
|
||||
|
||||
#define SS_SIOCSIFMTU SS_IOW ('I', 21, struct ifreq)/* get if_mtu */
|
||||
#define SS_SIOCGIFMTU SS_IOWR('I', 22, struct ifreq)/* set if_mtu */
|
||||
|
||||
#define SS_SIOCIFDETACH SS_IOW ('I', 26, struct ifreq)/* detach interface */
|
||||
#define SS_SIOCGENPSTATS SS_IOWR('I', 27, struct ifreq)/* get ENP stats */
|
||||
|
||||
#define SS_SIOCX25XMT SS_IOWR('I', 29, struct ifreq)/* start a slp proc in x25if */
|
||||
#define SS_SIOCX25RCV SS_IOWR('I', 30, struct ifreq)/* start a slp proc in x25if */
|
||||
#define SS_SIOCX25TBL SS_IOWR('I', 31, struct ifreq)/* xfer lun table to kernel */
|
||||
|
||||
#define SS_SIOCGIFBRDADDR SS_IOWR('I', 32, struct ifreq)/* get broadcast addr */
|
||||
#define SS_SIOCSIFBRDADDR SS_IOW ('I', 33, struct ifreq)/* set broadcast addr */
|
||||
#define SS_SIOCGIFNETMASK SS_IOWR('I', 34, struct ifreq)/* get net addr mask */
|
||||
#define SS_SIOCSIFNETMASK SS_IOW ('I', 35, struct ifreq)/* set net addr mask */
|
||||
#define SS_SIOCGIFMETRIC SS_IOWR('I', 36, struct ifreq)/* get IF metric */
|
||||
#define SS_SIOCSIFMETRIC SS_IOW ('I', 37, struct ifreq)/* set IF metric */
|
||||
|
||||
#define SS_SIOCSARP SS_IOW ('I', 38, struct arpreq)/* set arp entry */
|
||||
#define SS_SIOCGARP SS_IOWR('I', 39, struct arpreq)/* get arp entry */
|
||||
#define SS_SIOCDARP SS_IOW ('I', 40, struct arpreq)/* delete arp entry */
|
||||
|
||||
#define SS_SIOCSIFNAME SS_IOW ('I', 41, struct ifreq)/* set interface name */
|
||||
#define SS_SIOCGIFONEP SS_IOWR('I', 42, struct ifreq)/* get 1-packet parms */
|
||||
#define SS_SIOCSIFONEP SS_IOW ('I', 43, struct ifreq)/* set 1-packet parms */
|
||||
|
||||
#define SS_SIOCGENADDR SS_IOWR('I', 65, struct ifreq)/* Get ethernet addr */
|
||||
|
||||
#define SS_SIOCSOCKSYS SS_IOW ('I', 66, struct ss_call)/* ss syscall */
|
||||
|
||||
|
||||
/*
|
||||
* NFS/NIS has a pseudo device called /dev/nfsd which may accept ioctl
|
||||
* calls. /dev/nfsd is linked to /dev/socksys.
|
||||
*/
|
||||
|
||||
#define NIOCNFSD 1
|
||||
#define NIOCOLDGETFH 2
|
||||
#define NIOCASYNCD 3
|
||||
#define NIOCSETDOMNAM 4
|
||||
#define NIOCGETDOMNAM 5
|
||||
#define NIOCCLNTHAND 6
|
||||
#define NIOCEXPORTFS 7
|
||||
#define NIOCGETFH 8
|
||||
#define NIOCLSTAT 9
|
||||
|
||||
|
||||
/*
|
||||
* noso
|
||||
*/
|
||||
|
||||
#define SO_ORDREL 0xff02
|
||||
#define SO_IMASOCKET 0xff03
|
||||
#define SO_PROTOTYPE 0xff04
|
||||
/* Check below */
|
||||
#define SO_NO_CHECK 11
|
||||
#define SO_PRIORITY 12
|
||||
|
||||
/*
|
||||
* convert
|
||||
*/
|
||||
|
||||
/* Structure conversion indicators */
|
||||
|
||||
#define SS_STRUCT_ARPREQ 1
|
||||
#define SS_STRUCT_IFCONF 2
|
||||
#define SS_STRUCT_IFREQ 3
|
||||
#define SS_STRUCT_ORTENTRY 4
|
||||
#define SS_STRUCT_SOCKADDR 5
|
||||
#define SS_STRUCT_SOCKNEWPROTO 6
|
||||
|
||||
#define SS_ALIEN_TO_NATIVE 1
|
||||
#define SS_NATIVE_TO_ALIEN 2
|
||||
|
||||
struct whatever {
|
||||
int from, to;
|
||||
unsigned char *conversion;
|
||||
unsigned char all_the_same;
|
||||
struct whatever *more;
|
||||
struct ibcs2_socksys_args {
|
||||
int fd;
|
||||
int magic;
|
||||
caddr_t argsp;
|
||||
};
|
||||
|
||||
int ibcs2_socksys __P((struct proc *, struct ibcs2_socksys_args *, int *));
|
||||
|
||||
extern struct whatever *af_whatevers[];
|
||||
extern struct whatever *type_whatevers[];
|
||||
extern struct whatever *sopt_whatevers[];
|
||||
extern struct whatever *struct_whatevers[];
|
||||
|
||||
extern int ss_convert(struct whatever **what, int *this, int otherwise);
|
||||
extern int ss_convert_struct(char *alien, int indicator, int direction);
|
||||
|
||||
/*
|
||||
* convert af
|
||||
*/
|
||||
|
||||
|
||||
static struct whatever af_whatevers_all[] = {
|
||||
{ 0, 2, NULL, 0, 0 },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
|
||||
struct whatever *af_whatevers[] = {
|
||||
NULL, /* FreeBSD */
|
||||
af_whatevers_all, /* SysVR4 */
|
||||
af_whatevers_all, /* SysVR3 */
|
||||
af_whatevers_all, /* SCO 3.2.[24] */
|
||||
af_whatevers_all, /* Wyse Unix V/386 3.2.1 */
|
||||
af_whatevers_all, /* ISC */
|
||||
af_whatevers_all /* Linux */
|
||||
};
|
||||
|
||||
/*
|
||||
* convert sopt
|
||||
*/
|
||||
|
||||
static struct whatever sopt_whatevers_all[] = {
|
||||
{ 0x0001, 0x0001, (char *)SO_DEBUG, 0, 0 },
|
||||
{ 0x0002, 0x0002, (char *)SO_ACCEPTCONN, 0, 0 },
|
||||
{ 0x0004, 0x0004, (char *)SO_REUSEADDR, 0, 0 },
|
||||
{ 0x0008, 0x0008, (char *)SO_KEEPALIVE, 0, 0 },
|
||||
{ 0x0010, 0x0010, (char *)SO_DONTROUTE, 0, 0 },
|
||||
{ 0x0020, 0x0020, (char *)SO_BROADCAST, 0, 0 },
|
||||
{ 0x0040, 0x0040, (char *)SO_USELOOPBACK, 0, 0 },
|
||||
{ 0x0080, 0x0080, (char *)SO_LINGER, 0, 0 },
|
||||
{ 0x0100, 0x0100, (char *)SO_OOBINLINE, 0, 0 },
|
||||
{ 0x0200, 0x0200, (char *)SO_ORDREL, 0, 0 },
|
||||
{ 0x0400, 0x0400, (char *)SO_IMASOCKET, 0, 0 },
|
||||
{ 0x1001, 0x1001, (char *)SO_SNDBUF, 0, 0 },
|
||||
{ 0x1002, 0x1001, (char *)SO_RCVBUF, 0, 0 },
|
||||
{ 0x1003, 0x1001, (char *)SO_SNDLOWAT, 0, 0 },
|
||||
{ 0x1004, 0x1001, (char *)SO_RCVLOWAT, 0, 0 },
|
||||
{ 0x1005, 0x1001, (char *)SO_SNDTIMEO, 0, 0 },
|
||||
{ 0x1006, 0x1001, (char *)SO_RCVTIMEO, 0, 0 },
|
||||
{ 0x1007, 0x1001, (char *)SO_ERROR, 0, 0 },
|
||||
{ 0x1008, 0x1001, (char *)SO_TYPE, 0, 0 },
|
||||
{ 0x1009, 0x1001, (char *)SO_PROTOTYPE, 0, 0 },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
|
||||
struct whatever *sopt_whatevers[] = {
|
||||
NULL, /* FreeBSD */
|
||||
sopt_whatevers_all, /* SysVR4 */
|
||||
sopt_whatevers_all, /* SysVR3 */
|
||||
sopt_whatevers_all, /* SCO 3.2.[24] */
|
||||
sopt_whatevers_all, /* Wyse Unix V/386 3.2.1 */
|
||||
sopt_whatevers_all, /* ISC */
|
||||
sopt_whatevers_all /* Linux */
|
||||
};
|
||||
|
||||
/*
|
||||
* convert struct
|
||||
*/
|
||||
|
||||
static struct whatever struct_whatever_typeI_ranges[] = {
|
||||
{ 11, 16, (char *)SS_STRUCT_IFREQ , 1, 0 }, /* OK */
|
||||
{ 17, 17, (char *)SS_STRUCT_IFCONF , 1, 0 }, /* OK */
|
||||
{ 21, 22, (char *)SS_STRUCT_IFREQ , 1, 0 }, /* SIZE OK */
|
||||
{ 26, 27, (char *)SS_STRUCT_IFREQ , 1, 0 }, /* SIZE OK */
|
||||
{ 29, 37, (char *)SS_STRUCT_IFREQ , 1, 0 }, /* SIZE OK */
|
||||
{ 38, 40, (char *)SS_STRUCT_ARPREQ , 1, 0 }, /* OK */
|
||||
{ 41, 43, (char *)SS_STRUCT_IFREQ , 1, 0 }, /* SIZE OK */
|
||||
{ 65, 65, (char *)SS_STRUCT_IFREQ , 1, 0 }, /* SIZE OK */
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
static struct whatever struct_whatever_typeR_ranges[] = {
|
||||
{ 9, 10, (char *)SS_STRUCT_ORTENTRY , 1, 0 }, /* SIZE OK */
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
static struct whatever struct_whatever_typeS_ranges[] = {
|
||||
{ 1, 10, 0 , 1, 0 },
|
||||
{ 11, 11, (char *)SS_STRUCT_SOCKNEWPROTO, 1, 0 }, /* NO SUPPORT */
|
||||
{ 12, 13, (char *)SS_STRUCT_SOCKADDR , 1, 0 }, /* len and family */
|
||||
{ 14, 15, 0 , 1, 0 },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
static struct whatever struct_whatevers_all[] = {
|
||||
{ 'I', 'I', 0, 0, struct_whatever_typeI_ranges },
|
||||
{ 'R', 'R', 0, 0, struct_whatever_typeR_ranges },
|
||||
{ 'S', 'S', 0, 0, struct_whatever_typeS_ranges },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
struct whatever *struct_whatevers[] = {
|
||||
struct_whatevers_all, /* FreeBSD */
|
||||
struct_whatevers_all, /* SysVR4 */
|
||||
struct_whatevers_all, /* SysVR3 */
|
||||
struct_whatevers_all, /* SCO 3.2.[24] */
|
||||
struct_whatevers_all, /* Wyse Unix V/386 3.2.1 */
|
||||
struct_whatevers_all, /* ISC */
|
||||
struct_whatevers_all /* Linux */
|
||||
};
|
||||
|
||||
int ss_struct_native_sizes[] = {
|
||||
sizeof(struct arpreq),
|
||||
sizeof(struct ifconf),
|
||||
sizeof(struct ifreq),
|
||||
sizeof(struct rtentry),
|
||||
sizeof(struct sockaddr),
|
||||
sizeof(struct socknewproto)
|
||||
};
|
||||
|
||||
/*
|
||||
* convert type
|
||||
*/
|
||||
|
||||
static char type_conversion_SysVr4_range1[] = {
|
||||
SOCK_DGRAM,
|
||||
SOCK_STREAM,
|
||||
0,
|
||||
SOCK_RAW,
|
||||
SOCK_RDM,
|
||||
SOCK_SEQPACKET
|
||||
};
|
||||
|
||||
static struct whatever type_whatevers_SysVr4[] = {
|
||||
{ 1, 6, type_conversion_SysVr4_range1, 0 },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
struct whatever *type_whatevers[] = {
|
||||
NULL, /* FreeBSD */
|
||||
type_whatevers_SysVr4, /* SysVR4 */
|
||||
NULL, /* SysVR3 */
|
||||
NULL, /* SCO 3.2.[24] */
|
||||
NULL, /* Wyse Unix V/386 3.2.1 */
|
||||
NULL, /* ISC */
|
||||
NULL /* Linux */
|
||||
};
|
||||
#endif /* _IBCS2_SOCKSYS_H */
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 1995 Scott Bartram
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -37,35 +38,41 @@
|
|||
#include <sys/mount.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/syscallargs.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/sysproto.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <compat/ibcs2/ibcs2_fcntl.h>
|
||||
#include <compat/ibcs2/ibcs2_signal.h>
|
||||
#include <compat/ibcs2/ibcs2_stat.h>
|
||||
#include <compat/ibcs2/ibcs2_statfs.h>
|
||||
#include <compat/ibcs2/ibcs2_syscallargs.h>
|
||||
#include <compat/ibcs2/ibcs2_ustat.h>
|
||||
#include <compat/ibcs2/ibcs2_util.h>
|
||||
#include <compat/ibcs2/ibcs2_utsname.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_fcntl.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_stat.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_ustat.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_utsname.h>
|
||||
|
||||
static void bsd_stat2ibcs_stat __P((struct stat *, struct ibcs2_stat *));
|
||||
static int cvt_statfs __P((struct statfs *, caddr_t, int));
|
||||
|
||||
static void
|
||||
bsd_stat2ibcs_stat(st, st4)
|
||||
struct ostat *st;
|
||||
struct stat *st;
|
||||
struct ibcs2_stat *st4;
|
||||
{
|
||||
bzero(st4, sizeof(*st4));
|
||||
st4->st_dev = (ibcs2_dev_t)st->st_dev;
|
||||
st4->st_ino = (ibcs2_ino_t)st->st_ino;
|
||||
st4->st_dev = (ibcs2_dev_t)st->st_dev;
|
||||
st4->st_ino = (ibcs2_ino_t)st->st_ino;
|
||||
st4->st_mode = (ibcs2_mode_t)st->st_mode;
|
||||
st4->st_nlink = (ibcs2_nlink_t)st->st_nlink;
|
||||
st4->st_uid = (ibcs2_uid_t)st->st_uid;
|
||||
st4->st_gid = (ibcs2_gid_t)st->st_gid;
|
||||
st4->st_nlink= (ibcs2_nlink_t)st->st_nlink;
|
||||
st4->st_uid = (ibcs2_uid_t)st->st_uid;
|
||||
st4->st_gid = (ibcs2_gid_t)st->st_gid;
|
||||
st4->st_rdev = (ibcs2_dev_t)st->st_rdev;
|
||||
st4->st_size = (ibcs2_off_t)st->st_size;
|
||||
if (st->st_size < (quad_t)1 << 32)
|
||||
st4->st_size = (ibcs2_off_t)st->st_size;
|
||||
else
|
||||
st4->st_size = -2;
|
||||
st4->st_atim = (ibcs2_time_t)st->st_atime;
|
||||
st4->st_mtim = (ibcs2_time_t)st->st_mtime;
|
||||
st4->st_ctim = (ibcs2_time_t)st->st_ctime;
|
||||
|
@ -144,17 +151,19 @@ ibcs2_stat(p, uap, retval)
|
|||
struct ibcs2_stat_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct ostat st;
|
||||
struct stat st;
|
||||
struct ibcs2_stat ibcs2_st;
|
||||
struct compat_43_stat_args cup;
|
||||
struct stat_args cup;
|
||||
int error;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
CHECKALTEXIST(p, &sg, SCARG(uap, path));
|
||||
SCARG(&cup, path) = SCARG(uap, path);
|
||||
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st));
|
||||
if (error = compat_43_stat(p, &cup, retval))
|
||||
|
||||
if (error = stat(p, &cup, retval))
|
||||
return error;
|
||||
|
||||
if (error = copyin(SCARG(&cup, ub), &st, sizeof(st)))
|
||||
return error;
|
||||
bsd_stat2ibcs_stat(&st, &ibcs2_st);
|
||||
|
@ -168,17 +177,19 @@ ibcs2_lstat(p, uap, retval)
|
|||
struct ibcs2_lstat_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct ostat st;
|
||||
struct stat st;
|
||||
struct ibcs2_stat ibcs2_st;
|
||||
struct compat_43_lstat_args cup;
|
||||
struct lstat_args cup;
|
||||
int error;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
CHECKALTEXIST(p, &sg, SCARG(uap, path));
|
||||
SCARG(&cup, path) = SCARG(uap, path);
|
||||
SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st));
|
||||
if (error = compat_43_lstat(p, &cup, retval))
|
||||
|
||||
if (error = lstat(p, &cup, retval))
|
||||
return error;
|
||||
|
||||
if (error = copyin(SCARG(&cup, ub), &st, sizeof(st)))
|
||||
return error;
|
||||
bsd_stat2ibcs_stat(&st, &ibcs2_st);
|
||||
|
@ -192,16 +203,18 @@ ibcs2_fstat(p, uap, retval)
|
|||
struct ibcs2_fstat_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct ostat st;
|
||||
struct stat st;
|
||||
struct ibcs2_stat ibcs2_st;
|
||||
struct compat_43_fstat_args cup;
|
||||
struct fstat_args cup;
|
||||
int error;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
SCARG(&cup, fd) = SCARG(uap, fd);
|
||||
SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(st));
|
||||
if (error = compat_43_fstat(p, &cup, retval))
|
||||
|
||||
if (error = fstat(p, &cup, retval))
|
||||
return error;
|
||||
|
||||
if (error = copyin(SCARG(&cup, sb), &st, sizeof(st)))
|
||||
return error;
|
||||
bsd_stat2ibcs_stat(&st, &ibcs2_st);
|
||||
|
@ -219,7 +232,6 @@ ibcs2_utssys(p, uap, retval)
|
|||
case 0: /* uname(2) */
|
||||
{
|
||||
struct ibcs2_utsname sut;
|
||||
extern char ostype[], machine[], osrelease[];
|
||||
|
||||
bzero(&sut, ibcs2_utsname_len);
|
||||
bcopy(ostype, sut.sysname, sizeof(sut.sysname) - 1);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef _IBCS2_STAT_H
|
||||
#define _IBCS2_STAT_H
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_stat {
|
||||
ibcs2_dev_t st_dev;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* System call numbers.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from NetBSD: syscalls.master,v 1.4 1995/03/14 15:12:52 scottb Exp
|
||||
* created from Id: syscalls.master,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#define IBCS2_SYS_syscall 0
|
||||
|
@ -12,7 +12,7 @@
|
|||
#define IBCS2_SYS_write 4
|
||||
#define IBCS2_SYS_ibcs2_open 5
|
||||
#define IBCS2_SYS_close 6
|
||||
#define IBCS2_SYS_ibcs2_waitsys 7
|
||||
#define IBCS2_SYS_ibcs2_wait 7
|
||||
#define IBCS2_SYS_ibcs2_creat 8
|
||||
#define IBCS2_SYS_link 9
|
||||
#define IBCS2_SYS_ibcs2_unlink 10
|
||||
|
@ -24,17 +24,20 @@
|
|||
#define IBCS2_SYS_ibcs2_chown 16
|
||||
#define IBCS2_SYS_obreak 17
|
||||
#define IBCS2_SYS_ibcs2_stat 18
|
||||
#define IBCS2_SYS_compat_43_lseek 19
|
||||
#define IBCS2_SYS_ibcs2_lseek 19
|
||||
#define IBCS2_SYS_getpid 20
|
||||
#define IBCS2_SYS_ibcs2_mount 21
|
||||
#define IBCS2_SYS_ibcs2_umount 22
|
||||
#define IBCS2_SYS_ibcs2_setuid 23
|
||||
#define IBCS2_SYS_getuid 24
|
||||
#define IBCS2_SYS_ibcs2_stime 25
|
||||
#define IBCS2_SYS_ptrace 26
|
||||
#define IBCS2_SYS_ibcs2_alarm 27
|
||||
#define IBCS2_SYS_ibcs2_fstat 28
|
||||
#define IBCS2_SYS_ibcs2_pause 29
|
||||
#define IBCS2_SYS_ibcs2_utime 30
|
||||
#define IBCS2_SYS_ibcs2_stty 31
|
||||
#define IBCS2_SYS_ibcs2_gtty 32
|
||||
#define IBCS2_SYS_ibcs2_access 33
|
||||
#define IBCS2_SYS_ibcs2_nice 34
|
||||
#define IBCS2_SYS_ibcs2_statfs 35
|
||||
|
@ -42,19 +45,23 @@
|
|||
#define IBCS2_SYS_ibcs2_kill 37
|
||||
#define IBCS2_SYS_ibcs2_fstatfs 38
|
||||
#define IBCS2_SYS_ibcs2_pgrpsys 39
|
||||
#define IBCS2_SYS_ibcs2_xenix 40
|
||||
#define IBCS2_SYS_dup 41
|
||||
#define IBCS2_SYS_pipe 42
|
||||
#define IBCS2_SYS_ibcs2_times 43
|
||||
#define IBCS2_SYS_profil 44
|
||||
#define IBCS2_SYS_ibcs2_plock 45
|
||||
#define IBCS2_SYS_ibcs2_setgid 46
|
||||
#define IBCS2_SYS_getgid 47
|
||||
#define IBCS2_SYS_ibcs2_sigsys 48
|
||||
#define IBCS2_SYS_ibcs2_msgsys 49
|
||||
#define IBCS2_SYS_ibcs2_sysi86 50
|
||||
#define IBCS2_SYS_ibcs2_shmsys 52
|
||||
#define IBCS2_SYS_ibcs2_semsys 53
|
||||
#define IBCS2_SYS_ibcs2_ioctl 54
|
||||
#define IBCS2_SYS_ibcs2_uadmin 55
|
||||
#define IBCS2_SYS_ibcs2_utssys 57
|
||||
#define IBCS2_SYS_fsync 58
|
||||
#define IBCS2_SYS_ibcs2_execve 59
|
||||
#define IBCS2_SYS_umask 60
|
||||
#define IBCS2_SYS_chroot 61
|
||||
|
@ -75,23 +82,10 @@
|
|||
#define IBCS2_SYS_ibcs2_getmsg 85
|
||||
#define IBCS2_SYS_ibcs2_putmsg 86
|
||||
#define IBCS2_SYS_ibcs2_poll 87
|
||||
#define IBCS2_SYS_ibcs2_secure 89
|
||||
#define IBCS2_SYS_ibcs2_symlink 90
|
||||
#define IBCS2_SYS_ibcs2_lstat 91
|
||||
#define IBCS2_SYS_ibcs2_readlink 92
|
||||
#define IBCS2_SYS_sigreturn 103
|
||||
#define IBCS2_SYS_xenix_rdchk 135
|
||||
#define IBCS2_SYS_xenix_chsize 138
|
||||
#define IBCS2_SYS_xenix_ftime 139
|
||||
#define IBCS2_SYS_xenix_nap 140
|
||||
#define IBCS2_SYS_select 164
|
||||
#define IBCS2_SYS_ibcs2_sigaction 167
|
||||
#define IBCS2_SYS_ibcs2_sigprocmask 168
|
||||
#define IBCS2_SYS_ibcs2_sigpending 169
|
||||
#define IBCS2_SYS_ibcs2_sigsuspend 170
|
||||
#define IBCS2_SYS_ibcs2_getgroups 171
|
||||
#define IBCS2_SYS_ibcs2_setgroups 172
|
||||
#define IBCS2_SYS_ibcs2_sysconf 173
|
||||
#define IBCS2_SYS_ibcs2_pathconf 174
|
||||
#define IBCS2_SYS_ibcs2_fpathconf 175
|
||||
#define IBCS2_SYS_ibcs2_rename 176
|
||||
#define IBCS2_SYS_MAXSYSCALL 177
|
||||
#define IBCS2_SYS_ibcs2_isc 105
|
||||
#define IBCS2_SYS_MAXSYSCALL 128
|
||||
|
|
|
@ -1,500 +1,167 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* Copyright (c) 1994 Sean Eric Fagan
|
||||
* All rights reserved.
|
||||
/*
|
||||
* System call switch table.
|
||||
*
|
||||
* 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 withough 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.
|
||||
*
|
||||
* $Id: ibcs2_sysent.c,v 1.1 1994/10/14 08:53:10 sos Exp $
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.master,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#include <i386/ibcs2/ibcs2.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
|
||||
#define NERR 80 /* XXX must match sys/errno.h */
|
||||
|
||||
/* errno conversion tables */
|
||||
int bsd_to_svr3_errno[NERR] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 45, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
||||
30, 31, 32, 33, 34, 11, 91, 92, 93, 94,
|
||||
95, 96,118, 97, 98, 99,100,101,102,103,
|
||||
104,105,106,107,108, 63,110,111,112,113,
|
||||
114,115, 31, 78,116,117,145, 11, 11, 11,
|
||||
0, 66, 0, 0, 0, 0, 0, 46, 89, 0,
|
||||
};
|
||||
|
||||
/* function defines */
|
||||
int ibcs2_access();
|
||||
int ibcs2_advfs();
|
||||
int ibcs2_alarm();
|
||||
int ibcs2_break();
|
||||
int ibcs2_chdir();
|
||||
int ibcs2_chmod();
|
||||
int ibcs2_chown();
|
||||
int ibcs2_chroot();
|
||||
int ibcs2_cisc();
|
||||
int ibcs2_clocal();
|
||||
int ibcs2_close();
|
||||
int ibcs2_creat();
|
||||
int ibcs2_cxenix();
|
||||
int ibcs2_dup();
|
||||
int ibcs2_exec();
|
||||
int ibcs2_exece();
|
||||
int ibcs2_exit();
|
||||
int ibcs2_fcntl();
|
||||
int ibcs2_fork();
|
||||
int ibcs2_fstat();
|
||||
int ibcs2_fstatfs();
|
||||
int ibcs2_fsync();
|
||||
int ibcs2_getdents();
|
||||
int ibcs2_getgid();
|
||||
int ibcs2_getmsg();
|
||||
int ibcs2_getpid();
|
||||
int ibcs2_getuid();
|
||||
int ibcs2_gtime();
|
||||
int ibcs2_gtty();
|
||||
int ibcs2_ioctl();
|
||||
int ibcs2_kill();
|
||||
int ibcs2_libattach();
|
||||
int ibcs2_libdetach();
|
||||
int ibcs2_link();
|
||||
int ibcs2_lstat();
|
||||
int ibcs2_mkdir();
|
||||
int ibcs2_mknod();
|
||||
int ibcs2_msgsys();
|
||||
int ibcs2_nice();
|
||||
int ibcs2_nosys();
|
||||
int ibcs2_open();
|
||||
int ibcs2_pause();
|
||||
int ibcs2_pipe();
|
||||
int ibcs2_plock();
|
||||
int ibcs2_poll();
|
||||
int ibcs2_procids();
|
||||
int ibcs2_profil();
|
||||
int ibcs2_ptrace();
|
||||
int ibcs2_putmsg();
|
||||
int ibcs2_read();
|
||||
int ibcs2_readlink();
|
||||
int ibcs2_rfdebug();
|
||||
int ibcs2_rfstart();
|
||||
int ibcs2_rfstop();
|
||||
int ibcs2_rfsys();
|
||||
int ibcs2_rmdir();
|
||||
int ibcs2_rmount();
|
||||
int ibcs2_rumount();
|
||||
int ibcs2_secure();
|
||||
int ibcs2_seek();
|
||||
int ibcs2_semsys();
|
||||
int ibcs2_setgid();
|
||||
int ibcs2_setuid();
|
||||
int ibcs2_shmsys();
|
||||
int ibcs2_sigsys();
|
||||
int ibcs2_smount();
|
||||
int ibcs2_stat();
|
||||
int ibcs2_statfs();
|
||||
int ibcs2_stime();
|
||||
int ibcs2_stty();
|
||||
int ibcs2_sumount();
|
||||
int ibcs2_symlink();
|
||||
int ibcs2_sync();
|
||||
int ibcs2_sysacct();
|
||||
int ibcs2_sysfs();
|
||||
int ibcs2_sysi86();
|
||||
int ibcs2_times();
|
||||
int ibcs2_uadmin();
|
||||
int ibcs2_ulimit();
|
||||
int ibcs2_umask();
|
||||
int ibcs2_unadvfs();
|
||||
int ibcs2_unlink();
|
||||
int ibcs2_utime();
|
||||
int ibcs2_utssys();
|
||||
int ibcs2_wait();
|
||||
int ibcs2_write();
|
||||
int ibcs2_traceemu(); /* XXX */
|
||||
int sigreturn(); /* XXX */
|
||||
|
||||
/* ibcs2 svr3 sysent table */
|
||||
struct sysent svr3_sysent[] =
|
||||
{
|
||||
0, ibcs2_nosys, /* 0 = indir */
|
||||
1, ibcs2_exit, /* 1 = exit */
|
||||
0, ibcs2_fork, /* 2 = fork */
|
||||
3, ibcs2_read, /* 3 = read */
|
||||
3, ibcs2_write, /* 4 = write */
|
||||
3, ibcs2_open, /* 5 = open */
|
||||
1, ibcs2_close, /* 6 = close */
|
||||
3, ibcs2_wait, /* 7 = wait */
|
||||
2, ibcs2_creat, /* 8 = creat */
|
||||
2, ibcs2_link, /* 9 = link */
|
||||
1, ibcs2_unlink, /* 10 = unlink */
|
||||
2, ibcs2_exec, /* 11 = exec */
|
||||
1, ibcs2_chdir, /* 12 = chdir */
|
||||
0, ibcs2_gtime, /* 13 = time */
|
||||
3, ibcs2_mknod, /* 14 = mknod */
|
||||
2, ibcs2_chmod, /* 15 = chmod */
|
||||
3, ibcs2_chown, /* 16 = chown */
|
||||
1, ibcs2_break, /* 17 = break */
|
||||
2, ibcs2_stat, /* 18 = stat */
|
||||
3, ibcs2_seek, /* 19 = seek */
|
||||
0, ibcs2_getpid, /* 20 = getpid */
|
||||
6, ibcs2_smount, /* 21 = mount */
|
||||
1, ibcs2_sumount, /* 22 = umount */
|
||||
1, ibcs2_setuid, /* 23 = setuid */
|
||||
0, ibcs2_getuid, /* 24 = getuid */
|
||||
1, ibcs2_stime, /* 25 = stime */
|
||||
4, ibcs2_ptrace, /* 26 = ptrace */
|
||||
1, ibcs2_alarm, /* 27 = alarm */
|
||||
2, ibcs2_fstat, /* 28 = fstat */
|
||||
0, ibcs2_pause, /* 29 = pause */
|
||||
2, ibcs2_utime, /* 30 = utime */
|
||||
2, ibcs2_stty, /* 31 = stty */
|
||||
2, ibcs2_gtty, /* 32 = gtty */
|
||||
2, ibcs2_access, /* 33 = access */
|
||||
1, ibcs2_nice, /* 34 = nice */
|
||||
4, ibcs2_statfs, /* 35 = statfs */
|
||||
0, ibcs2_sync, /* 36 = sync */
|
||||
2, ibcs2_kill, /* 37 = kill */
|
||||
4, ibcs2_fstatfs, /* 38 = fstatfs */
|
||||
1, ibcs2_procids, /* 39 = procids */
|
||||
5, ibcs2_cxenix, /* 40 = XENIX special system call */
|
||||
1, ibcs2_dup, /* 41 = dup */
|
||||
1, ibcs2_pipe, /* 42 = pipe */
|
||||
1, ibcs2_times, /* 43 = times */
|
||||
4, ibcs2_profil, /* 44 = prof */
|
||||
1, ibcs2_plock, /* 45 = proc lock */
|
||||
1, ibcs2_setgid, /* 46 = setgid */
|
||||
0, ibcs2_getgid, /* 47 = getgid */
|
||||
2, ibcs2_sigsys, /* 48 = signal */
|
||||
6, ibcs2_msgsys, /* 49 = IPC message */
|
||||
4, ibcs2_sysi86, /* 50 = i386-specific system call */
|
||||
1, ibcs2_sysacct, /* 51 = turn acct off/on */
|
||||
4, ibcs2_shmsys, /* 52 = shared memory */
|
||||
5, ibcs2_semsys, /* 53 = IPC semaphores */
|
||||
3, ibcs2_ioctl, /* 54 = ioctl */
|
||||
3, ibcs2_uadmin, /* 55 = uadmin */
|
||||
0, ibcs2_nosys, /* 56 = reserved for exch */
|
||||
3, ibcs2_utssys, /* 57 = utssys */
|
||||
1, ibcs2_fsync, /* 58 = fsync */
|
||||
3, ibcs2_exece, /* 59 = exece */
|
||||
1, ibcs2_umask, /* 60 = umask */
|
||||
1, ibcs2_chroot, /* 61 = chroot */
|
||||
3, ibcs2_fcntl, /* 62 = fcntl */
|
||||
2, ibcs2_ulimit, /* 63 = ulimit */
|
||||
0, ibcs2_nosys, /* 64 = nosys */
|
||||
0, ibcs2_nosys, /* 65 = nosys */
|
||||
0, ibcs2_nosys, /* 66 = nosys */
|
||||
0, ibcs2_nosys, /* 67 = file locking call */
|
||||
0, ibcs2_nosys, /* 68 = local system calls */
|
||||
0, ibcs2_nosys, /* 69 = inode open */
|
||||
4, ibcs2_advfs, /* 70 = advfs */
|
||||
1, ibcs2_unadvfs, /* 71 = unadvfs */
|
||||
4, ibcs2_rmount, /* 72 = rmount */
|
||||
1, ibcs2_rumount, /* 73 = rumount */
|
||||
5, ibcs2_rfstart, /* 74 = rfstart */
|
||||
0, ibcs2_nosys, /* 75 = not used */
|
||||
1, ibcs2_rfdebug, /* 76 = rfdebug */
|
||||
0, ibcs2_rfstop, /* 77 = rfstop */
|
||||
6, ibcs2_rfsys, /* 78 = rfsys */
|
||||
1, ibcs2_rmdir, /* 79 = rmdir */
|
||||
2, ibcs2_mkdir, /* 80 = mkdir */
|
||||
4, ibcs2_getdents, /* 81 = getdents */
|
||||
3, ibcs2_libattach, /* 82 = libattach */
|
||||
1, ibcs2_libdetach, /* 83 = libdetach */
|
||||
3, ibcs2_sysfs, /* 84 = sysfs */
|
||||
4, ibcs2_getmsg, /* 85 = getmsg */
|
||||
4, ibcs2_putmsg, /* 86 = putmsg */
|
||||
3, ibcs2_poll, /* 87 = poll */
|
||||
0, ibcs2_nosys, /* 88 = not used */
|
||||
6, ibcs2_secure, /* 89 = secureware */
|
||||
2, ibcs2_symlink, /* 90 = symlink */
|
||||
2, ibcs2_lstat, /* 91 = lstat */
|
||||
3, ibcs2_readlink, /* 92 = readlink */
|
||||
0, ibcs2_nosys, /* 93 = not used */
|
||||
0, ibcs2_nosys, /* 94 = not used */
|
||||
0, ibcs2_nosys, /* 95 = not used */
|
||||
0, ibcs2_nosys, /* 96 = not used */
|
||||
0, ibcs2_nosys, /* 97 = not used */
|
||||
0, ibcs2_nosys, /* 98 = not used */
|
||||
0, ibcs2_nosys, /* 99 = not used */
|
||||
0, ibcs2_nosys, /* 100 = not used */
|
||||
0, ibcs2_nosys, /* 101 = not used */
|
||||
0, ibcs2_nosys, /* 102 = not used */
|
||||
1, sigreturn, /* 103 = BSD sigreturn XXX */
|
||||
0, ibcs2_nosys, /* 104 = not used */
|
||||
5, ibcs2_cisc, /* 105 = ISC special */
|
||||
0, ibcs2_nosys, /* 106 = not used */
|
||||
0, ibcs2_nosys, /* 107 = not used */
|
||||
0, ibcs2_nosys, /* 108 = not used */
|
||||
0, ibcs2_nosys, /* 109 = not used */
|
||||
0, ibcs2_nosys, /* 110 = not used */
|
||||
0, ibcs2_nosys, /* 111 = not used */
|
||||
0, ibcs2_nosys, /* 112 = not used */
|
||||
0, ibcs2_nosys, /* 113 = not used */
|
||||
0, ibcs2_nosys, /* 114 = not used */
|
||||
0, ibcs2_nosys, /* 115 = not used */
|
||||
0, ibcs2_nosys, /* 116 = not used */
|
||||
0, ibcs2_nosys, /* 117 = not used */
|
||||
0, ibcs2_nosys, /* 118 = not used */
|
||||
0, ibcs2_nosys, /* 119 = not used */
|
||||
0, ibcs2_nosys, /* 120 = not used */
|
||||
0, ibcs2_nosys, /* 121 = not used */
|
||||
0, ibcs2_nosys, /* 122 = not used */
|
||||
0, ibcs2_nosys, /* 123 = not used */
|
||||
0, ibcs2_nosys, /* 124 = not used */
|
||||
0, ibcs2_nosys, /* 125 = not used */
|
||||
1, ibcs2_traceemu, /* 126 = ibcs2 emulator trace cntl */
|
||||
5, ibcs2_clocal, /* 127 = local system calls */
|
||||
};
|
||||
|
||||
struct sysentvec ibcs2_svr3_sysvec = {
|
||||
sizeof (svr3_sysent) / sizeof (svr3_sysent[0]),
|
||||
svr3_sysent,
|
||||
0x7F,
|
||||
NSIG,
|
||||
bsd_to_ibcs2_signal,
|
||||
NERR,
|
||||
bsd_to_svr3_errno
|
||||
};
|
||||
|
||||
#if 0
|
||||
|
||||
int ibcs2_acancel();
|
||||
int ibcs2_adjtime();
|
||||
int ibcs2_context();
|
||||
int ibcs2_evsys();
|
||||
int ibcs2_evtrapret();
|
||||
int ibcs2_fchdir();
|
||||
int ibcs2_fchmod();
|
||||
int ibcs2_fchown();
|
||||
int ibcs2_fstatvfs();
|
||||
int ibcs2_fxstat();
|
||||
int ibcs2_getgroups();
|
||||
int ibcs2_getpmsg();
|
||||
int ibcs2_getrlimit();
|
||||
int ibcs2_hrtsys();
|
||||
int ibcs2_lchown();
|
||||
int ibcs2_lxstat();
|
||||
int ibcs2_memcntl();
|
||||
int ibcs2_mincore();
|
||||
int ibcs2_mmap();
|
||||
int ibcs2_mprotect();
|
||||
int ibcs2_munmap();
|
||||
int ibcs2_pathconf();
|
||||
int ibcs2_priocntlsys();
|
||||
int ibcs2_putgmsg();
|
||||
int ibcs2_readv();
|
||||
int ibcs2_rename();
|
||||
int ibcs2_setegid();
|
||||
int ibcs2_seteuid();
|
||||
int ibcs2_setgroups();
|
||||
int ibcs2_setrlimit();
|
||||
int ibcs2_sigaction();
|
||||
int ibcs2_sigaltstack();
|
||||
int ibcs2_sigpending();
|
||||
int ibcs2_sigprocmask();
|
||||
int ibcs2_sigsendsys();
|
||||
int ibcs2_sigsuspend();
|
||||
int ibcs2_statvfs();
|
||||
int ibcs2_sysconfig();
|
||||
int ibcs2_systeminfo();
|
||||
int ibcs2_vfork();
|
||||
int ibcs2_waitsys();
|
||||
int ibcs2_writev();
|
||||
int ibcs2_xmknod();
|
||||
int ibcs2_xstat();
|
||||
|
||||
int bsd_to_svr4_errno[NERR] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 45, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
||||
30, 31, 32, 33, 34, 11,150,149, 95, 96,
|
||||
97, 98, 99,120,121,122,123,124,125,126,
|
||||
127,128,129,130,131,132,133,134,143,144,
|
||||
145,146, 90, 78,147,148, 93, 11, 94, 11,
|
||||
0, 0, 0, 0, 0, 0, 0, 46, 89, 0,
|
||||
};
|
||||
|
||||
/* ibcs2 svr4 sysent table */
|
||||
struct sysent svr4_sysent[] =
|
||||
{
|
||||
0, ibcs2_nosys, /* 0 = indir */
|
||||
1, ibcs2_exit, /* 1 = exit */
|
||||
0, ibcs2_fork, /* 2 = fork */
|
||||
3, ibcs2_read, /* 3 = read */
|
||||
3, ibcs2_write, /* 4 = write */
|
||||
3, ibcs2_open, /* 5 = open */
|
||||
1, ibcs2_close, /* 6 = close */
|
||||
3, ibcs2_wait, /* 7 = wait */
|
||||
2, ibcs2_creat, /* 8 = creat */
|
||||
2, ibcs2_link, /* 9 = link */
|
||||
1, ibcs2_unlink, /* 10 = unlink */
|
||||
2, ibcs2_exec, /* 11 = exec */
|
||||
1, ibcs2_chdir, /* 12 = chdir */
|
||||
0, ibcs2_gtime, /* 13 = time */
|
||||
3, ibcs2_mknod, /* 14 = mknod */
|
||||
2, ibcs2_chmod, /* 15 = chmod */
|
||||
3, ibcs2_chown, /* 16 = chown */
|
||||
1, ibcs2_break, /* 17 = break */
|
||||
2, ibcs2_stat, /* 18 = stat */
|
||||
3, ibcs2_seek, /* 19 = seek */
|
||||
0, ibcs2_getpid, /* 20 = getpid */
|
||||
6, ibcs2_smount, /* 21 = mount */
|
||||
1, ibcs2_sumount, /* 22 = umount */
|
||||
1, ibcs2_setuid, /* 23 = setuid */
|
||||
0, ibcs2_getuid, /* 24 = getuid */
|
||||
1, ibcs2_stime, /* 25 = stime */
|
||||
4, ibcs2_ptrace, /* 26 = ptrace */
|
||||
1, ibcs2_alarm, /* 27 = alarm */
|
||||
2, ibcs2_fstat, /* 28 = fstat */
|
||||
0, ibcs2_pause, /* 29 = pause */
|
||||
2, ibcs2_utime, /* 30 = utime */
|
||||
2, ibcs2_stty, /* 31 = stty */
|
||||
2, ibcs2_gtty, /* 32 = gtty */
|
||||
2, ibcs2_access, /* 33 = access */
|
||||
1, ibcs2_nice, /* 34 = nice */
|
||||
4, ibcs2_statfs, /* 35 = statfs */
|
||||
0, ibcs2_sync, /* 36 = sync */
|
||||
2, ibcs2_kill, /* 37 = kill */
|
||||
4, ibcs2_fstatfs, /* 38 = fstatfs */
|
||||
1, ibcs2_procids, /* 39 = procids */
|
||||
5, ibcs2_cxenix, /* 40 = XENIX special system call */
|
||||
1, ibcs2_dup, /* 41 = dup */
|
||||
1, ibcs2_pipe, /* 42 = pipe */
|
||||
1, ibcs2_times, /* 43 = times */
|
||||
4, ibcs2_profil, /* 44 = prof */
|
||||
1, ibcs2_plock, /* 45 = proc lock */
|
||||
1, ibcs2_setgid, /* 46 = setgid */
|
||||
0, ibcs2_getgid, /* 47 = getgid */
|
||||
2, ibcs2_sigsys, /* 48 = signal */
|
||||
6, ibcs2_msgsys, /* 49 = IPC message */
|
||||
4, ibcs2_sysi86, /* 50 = i386-specific system call */
|
||||
1, ibcs2_sysacct, /* 51 = turn acct off/on */
|
||||
4, ibcs2_shmsys, /* 52 = shared memory */
|
||||
5, ibcs2_semsys, /* 53 = IPC semaphores */
|
||||
3, ibcs2_ioctl, /* 54 = ioctl */
|
||||
3, ibcs2_uadmin, /* 55 = uadmin */
|
||||
0, ibcs2_nosys, /* 56 = reserved for exch */
|
||||
3, ibcs2_utssys, /* 57 = utssys */
|
||||
1, ibcs2_fsync, /* 58 = fsync */
|
||||
3, ibcs2_exece, /* 59 = exece */
|
||||
1, ibcs2_umask, /* 60 = umask */
|
||||
1, ibcs2_chroot, /* 61 = chroot */
|
||||
3, ibcs2_fcntl, /* 62 = fcntl */
|
||||
2, ibcs2_ulimit, /* 63 = ulimit */
|
||||
0, ibcs2_nosys, /* 64 = nosys */
|
||||
0, ibcs2_nosys, /* 65 = nosys */
|
||||
0, ibcs2_nosys, /* 66 = nosys */
|
||||
0, ibcs2_nosys, /* 67 = file locking call */
|
||||
0, ibcs2_nosys, /* 68 = local system calls */
|
||||
0, ibcs2_nosys, /* 69 = inode open */
|
||||
4, ibcs2_advfs, /* 70 = advfs */
|
||||
1, ibcs2_unadvfs, /* 71 = unadvfs */
|
||||
4, ibcs2_rmount, /* 72 = rmount */
|
||||
1, ibcs2_rumount, /* 73 = rumount */
|
||||
5, ibcs2_rfstart, /* 74 = rfstart */
|
||||
0, ibcs2_nosys, /* 75 = not used */
|
||||
1, ibcs2_rfdebug, /* 76 = rfdebug */
|
||||
0, ibcs2_rfstop, /* 77 = rfstop */
|
||||
6, ibcs2_rfsys, /* 78 = rfsys */
|
||||
1, ibcs2_rmdir, /* 79 = rmdir */
|
||||
2, ibcs2_mkdir, /* 80 = mkdir */
|
||||
4, ibcs2_getdents, /* 81 = getdents */
|
||||
3, ibcs2_libattach, /* 82 = libattach */
|
||||
1, ibcs2_libdetach, /* 83 = libdetach */
|
||||
3, ibcs2_sysfs, /* 84 = sysfs */
|
||||
4, ibcs2_getmsg, /* 85 = getmsg */
|
||||
4, ibcs2_putmsg, /* 86 = putmsg */
|
||||
3, ibcs2_poll, /* 87 = poll */
|
||||
6, ibcs2_lstat, /* 88 = lstat */
|
||||
2, ibcs2_symlink, /* 89 = symlink */
|
||||
3, ibcs2_readlink, /* 90 = readlink */
|
||||
2, ibcs2_setgroups, /* 91 = setgroups */
|
||||
2, ibcs2_getgroups, /* 92 = getgroups */
|
||||
2, ibcs2_fchmod, /* 93 = fchmod */
|
||||
3, ibcs2_fchown, /* 94 = fchown */
|
||||
3, ibcs2_sigprocmask, /* 95 = sigprocmask */
|
||||
0, ibcs2_sigsuspend, /* 96 = sigsuspend */
|
||||
2, ibcs2_sigaltstack, /* 97 = sigaltstack */
|
||||
3, ibcs2_sigaction, /* 98 = sigaction */
|
||||
1, ibcs2_sigpending, /* 99 = sigpending */
|
||||
0, ibcs2_context, /* 100 = context */
|
||||
0, ibcs2_evsys, /* 101 = evsys */
|
||||
0, ibcs2_evtrapret, /* 102 = evtrapret */
|
||||
0, ibcs2_statvfs, /* 103 = statvfs */
|
||||
0, ibcs2_fstatvfs, /* 104 = fstatvfs */
|
||||
5, ibcs2_cisc, /* 105 = ISC special */
|
||||
0, ibcs2_nfssys, /* 106 = nfssys */
|
||||
0, ibcs2_waitsys, /* 107 = waitsys */
|
||||
0, ibcs2_sigsendsys, /* 108 = sigsendsys */
|
||||
0, ibcs2_hrtsys, /* 109 = hrtsys */
|
||||
0, ibcs2_acancel, /* 110 = acancel */
|
||||
0, ibcs2_async, /* 111 = async */
|
||||
0, ibcs2_priocntlsys, /* 112 = priocntlsys */
|
||||
0, ibcs2_pathconf, /* 113 = pathconf */
|
||||
0, ibcs2_mincore, /* 114 = mincore */
|
||||
6, ibcs2_mmap, /* 115 = mmap */
|
||||
3, ibcs2_mprotect, /* 116 = mprotect */
|
||||
2, ibcs2_munmap, /* 117 = munmap */
|
||||
0, ibcs2_pathconf, /* 118 = fpathconf */
|
||||
0, ibcs2_vfork, /* 119 = vfork */
|
||||
0, ibcs2_fchdir, /* 120 = fchdir */
|
||||
0, ibcs2_readv, /* 121 = readv */
|
||||
0, ibcs2_writev, /* 122 = writev */
|
||||
3, ibcs2_xstat, /* 123 = xstat */
|
||||
3, ibcs2_lxstat, /* 124 = lxstat */
|
||||
3, ibcs2_fxstat, /* 125 = fxstat */
|
||||
4, ibcs2_xmknod, /* 126 = xmknod */
|
||||
5, ibcs2_clocal, /* 127 = local system calls */
|
||||
0, ibcs2_setrlimit, /* 128 = setrlimit */
|
||||
0, ibcs2_getrlimit, /* 129 = getrlimit */
|
||||
0, ibcs2_lchown, /* 130 = lchown */
|
||||
0, ibcs2_memcntl, /* 131 = memcntl */
|
||||
0, ibcs2_getpmsg, /* 132 = getpmsg */
|
||||
0, ibcs2_putgmsg, /* 133 = putgmsg */
|
||||
2, ibcs2_rename, /* 134 = rename */
|
||||
1, ibcs2_uname, /* 135 = uname */
|
||||
0, ibcs2_setegid, /* 136 = setegid */
|
||||
0, ibcs2_sysconfig, /* 137 = sysconfig */
|
||||
0, ibcs2_adjtime, /* 138 = adjtime */
|
||||
0, ibcs2_systeminfo, /* 139 = systeminfo */
|
||||
0, ibcs2_nosys, /* 140 = not used */
|
||||
0, ibcs2_seteuid, /* 141 = seteuid */
|
||||
};
|
||||
|
||||
struct sysentvec ibcs2_svr4_sysvec = {
|
||||
sizeof (svr4_sysent) / sizeof (svr4_sysent[0]),
|
||||
svr4_sysent,
|
||||
0xFF,
|
||||
NSIG,
|
||||
bsd_to_ibcs2_signal,
|
||||
NERR,
|
||||
bsd_to_svr4_errno
|
||||
};
|
||||
|
||||
#ifdef COMPAT_43
|
||||
#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)
|
||||
#else
|
||||
#define compat(n, name) 0, (sy_call_t *)nosys
|
||||
#endif
|
||||
|
||||
/* The casts are bogus but will do for now. */
|
||||
struct sysent ibcs2_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys }, /* 0 = syscall */
|
||||
{ 1, (sy_call_t *)exit }, /* 1 = exit */
|
||||
{ 0, (sy_call_t *)fork }, /* 2 = fork */
|
||||
{ 3, (sy_call_t *)ibcs2_read }, /* 3 = ibcs2_read */
|
||||
{ 3, (sy_call_t *)write }, /* 4 = write */
|
||||
{ 3, (sy_call_t *)ibcs2_open }, /* 5 = ibcs2_open */
|
||||
{ 1, (sy_call_t *)close }, /* 6 = close */
|
||||
{ 3, (sy_call_t *)ibcs2_wait }, /* 7 = ibcs2_wait */
|
||||
{ 2, (sy_call_t *)ibcs2_creat }, /* 8 = ibcs2_creat */
|
||||
{ 2, (sy_call_t *)link }, /* 9 = link */
|
||||
{ 1, (sy_call_t *)ibcs2_unlink }, /* 10 = ibcs2_unlink */
|
||||
{ 2, (sy_call_t *)ibcs2_execv }, /* 11 = ibcs2_execv */
|
||||
{ 1, (sy_call_t *)ibcs2_chdir }, /* 12 = ibcs2_chdir */
|
||||
{ 1, (sy_call_t *)ibcs2_time }, /* 13 = ibcs2_time */
|
||||
{ 3, (sy_call_t *)ibcs2_mknod }, /* 14 = ibcs2_mknod */
|
||||
{ 2, (sy_call_t *)ibcs2_chmod }, /* 15 = ibcs2_chmod */
|
||||
{ 3, (sy_call_t *)ibcs2_chown }, /* 16 = ibcs2_chown */
|
||||
{ 1, (sy_call_t *)obreak }, /* 17 = obreak */
|
||||
{ 2, (sy_call_t *)ibcs2_stat }, /* 18 = ibcs2_stat */
|
||||
{ 3, (sy_call_t *)ibcs2_lseek }, /* 19 = ibcs2_lseek */
|
||||
{ 0, (sy_call_t *)getpid }, /* 20 = getpid */
|
||||
{ 6, (sy_call_t *)ibcs2_mount }, /* 21 = ibcs2_mount */
|
||||
{ 1, (sy_call_t *)ibcs2_umount }, /* 22 = ibcs2_umount */
|
||||
{ 1, (sy_call_t *)ibcs2_setuid }, /* 23 = ibcs2_setuid */
|
||||
{ 0, (sy_call_t *)getuid }, /* 24 = getuid */
|
||||
{ 1, (sy_call_t *)ibcs2_stime }, /* 25 = ibcs2_stime */
|
||||
{ 4, (sy_call_t *)ptrace }, /* 26 = ptrace */
|
||||
{ 1, (sy_call_t *)ibcs2_alarm }, /* 27 = ibcs2_alarm */
|
||||
{ 2, (sy_call_t *)ibcs2_fstat }, /* 28 = ibcs2_fstat */
|
||||
{ 0, (sy_call_t *)ibcs2_pause }, /* 29 = ibcs2_pause */
|
||||
{ 2, (sy_call_t *)ibcs2_utime }, /* 30 = ibcs2_utime */
|
||||
{ 2, (sy_call_t *)ibcs2_stty }, /* 31 = ibcs2_stty */
|
||||
{ 2, (sy_call_t *)ibcs2_gtty }, /* 32 = ibcs2_gtty */
|
||||
{ 2, (sy_call_t *)ibcs2_access }, /* 33 = ibcs2_access */
|
||||
{ 1, (sy_call_t *)ibcs2_nice }, /* 34 = ibcs2_nice */
|
||||
{ 4, (sy_call_t *)ibcs2_statfs }, /* 35 = ibcs2_statfs */
|
||||
{ 0, (sy_call_t *)sync }, /* 36 = sync */
|
||||
{ 2, (sy_call_t *)ibcs2_kill }, /* 37 = ibcs2_kill */
|
||||
{ 4, (sy_call_t *)ibcs2_fstatfs }, /* 38 = ibcs2_fstatfs */
|
||||
{ 4, (sy_call_t *)ibcs2_pgrpsys }, /* 39 = ibcs2_pgrpsys */
|
||||
{ 5, (sy_call_t *)ibcs2_xenix }, /* 40 = ibcs2_xenix */
|
||||
{ 1, (sy_call_t *)dup }, /* 41 = dup */
|
||||
{ 0, (sy_call_t *)pipe }, /* 42 = pipe */
|
||||
{ 1, (sy_call_t *)ibcs2_times }, /* 43 = ibcs2_times */
|
||||
{ 4, (sy_call_t *)profil }, /* 44 = profil */
|
||||
{ 1, (sy_call_t *)ibcs2_plock }, /* 45 = ibcs2_plock */
|
||||
{ 1, (sy_call_t *)ibcs2_setgid }, /* 46 = ibcs2_setgid */
|
||||
{ 0, (sy_call_t *)getgid }, /* 47 = getgid */
|
||||
{ 2, (sy_call_t *)ibcs2_sigsys }, /* 48 = ibcs2_sigsys */
|
||||
#ifdef SYSVMSG
|
||||
{ 6, (sy_call_t *)ibcs2_msgsys }, /* 49 = ibcs2_msgsys */
|
||||
#else
|
||||
{ 0, (sy_call_t *)nosys }, /* 49 = nosys */
|
||||
#endif
|
||||
{ 2, (sy_call_t *)ibcs2_sysi86 }, /* 50 = ibcs2_sysi86 */
|
||||
{ 0, (sy_call_t *)nosys }, /* 51 = ibcs2_acct */
|
||||
#ifdef SYSVSHM
|
||||
{ 4, (sy_call_t *)ibcs2_shmsys }, /* 52 = ibcs2_shmsys */
|
||||
#else
|
||||
{ 0, (sy_call_t *)nosys }, /* 52 = nosys */
|
||||
#endif
|
||||
#ifdef SYSVSEM
|
||||
{ 5, (sy_call_t *)ibcs2_semsys }, /* 53 = ibcs2_semsys */
|
||||
#else
|
||||
{ 0, (sy_call_t *)nosys }, /* 53 = nosys */
|
||||
#endif
|
||||
{ 3, (sy_call_t *)ibcs2_ioctl }, /* 54 = ibcs2_ioctl */
|
||||
{ 3, (sy_call_t *)ibcs2_uadmin }, /* 55 = ibcs2_uadmin */
|
||||
{ 0, (sy_call_t *)nosys }, /* 56 = nosys */
|
||||
{ 3, (sy_call_t *)ibcs2_utssys }, /* 57 = ibcs2_utssys */
|
||||
{ 1, (sy_call_t *)fsync }, /* 58 = fsync */
|
||||
{ 3, (sy_call_t *)ibcs2_execve }, /* 59 = ibcs2_execve */
|
||||
{ 1, (sy_call_t *)umask }, /* 60 = umask */
|
||||
{ 1, (sy_call_t *)chroot }, /* 61 = chroot */
|
||||
{ 3, (sy_call_t *)ibcs2_fcntl }, /* 62 = ibcs2_fcntl */
|
||||
{ 2, (sy_call_t *)ibcs2_ulimit }, /* 63 = ibcs2_ulimit */
|
||||
{ 0, (sy_call_t *)nosys }, /* 64 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 65 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 66 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 67 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 68 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 69 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 70 = obsolete rfs_advfs */
|
||||
{ 0, (sy_call_t *)nosys }, /* 71 = obsolete rfs_unadvfs */
|
||||
{ 0, (sy_call_t *)nosys }, /* 72 = obsolete rfs_rmount */
|
||||
{ 0, (sy_call_t *)nosys }, /* 73 = obsolete rfs_rumount */
|
||||
{ 0, (sy_call_t *)nosys }, /* 74 = obsolete rfs_rfstart */
|
||||
{ 0, (sy_call_t *)nosys }, /* 75 = obsolete rfs_sigret */
|
||||
{ 0, (sy_call_t *)nosys }, /* 76 = obsolete rfs_rdebug */
|
||||
{ 0, (sy_call_t *)nosys }, /* 77 = obsolete rfs_rfstop */
|
||||
{ 0, (sy_call_t *)nosys }, /* 78 = rfs_rfsys */
|
||||
{ 1, (sy_call_t *)ibcs2_rmdir }, /* 79 = ibcs2_rmdir */
|
||||
{ 2, (sy_call_t *)ibcs2_mkdir }, /* 80 = ibcs2_mkdir */
|
||||
{ 3, (sy_call_t *)ibcs2_getdents }, /* 81 = ibcs2_getdents */
|
||||
{ 0, (sy_call_t *)nosys }, /* 82 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 83 = nosys */
|
||||
{ 3, (sy_call_t *)ibcs2_sysfs }, /* 84 = ibcs2_sysfs */
|
||||
{ 4, (sy_call_t *)ibcs2_getmsg }, /* 85 = ibcs2_getmsg */
|
||||
{ 4, (sy_call_t *)ibcs2_putmsg }, /* 86 = ibcs2_putmsg */
|
||||
{ 3, (sy_call_t *)ibcs2_poll }, /* 87 = ibcs2_poll */
|
||||
{ 0, (sy_call_t *)nosys }, /* 88 = nosys */
|
||||
{ 6, (sy_call_t *)ibcs2_secure }, /* 89 = ibcs2_secure */
|
||||
{ 2, (sy_call_t *)ibcs2_symlink }, /* 90 = ibcs2_symlink */
|
||||
{ 2, (sy_call_t *)ibcs2_lstat }, /* 91 = ibcs2_lstat */
|
||||
{ 3, (sy_call_t *)ibcs2_readlink }, /* 92 = ibcs2_readlink */
|
||||
{ 0, (sy_call_t *)nosys }, /* 93 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 94 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 95 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 96 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 97 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 98 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 99 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 100 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 101 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 102 = nosys */
|
||||
{ 1, (sy_call_t *)sigreturn }, /* 103 = sigreturn */
|
||||
{ 0, (sy_call_t *)nosys }, /* 104 = nosys */
|
||||
{ 0, (sy_call_t *)ibcs2_isc }, /* 105 = ibcs2_isc */
|
||||
{ 0, (sy_call_t *)nosys }, /* 106 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 107 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 108 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 109 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 110 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 111 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 112 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 113 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 114 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 115 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 116 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 117 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 118 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 119 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 120 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 121 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 122 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 123 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 124 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 125 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 126 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 127 = nosys */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -25,44 +26,68 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ibcs2_sysi86.c,v 1.1 1994/10/14 08:53:11 sos Exp $
|
||||
* ibcs2_sysi86.c,v 1.1 1994/10/14 08:53:11 sos Exp
|
||||
*/
|
||||
|
||||
#include <i386/ibcs2/ibcs2.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
|
||||
#define IBCS2_FP_NO 0 /* no fp support */
|
||||
#define IBCS2_FP_SW 1 /* software emulator */
|
||||
#define IBCS2_FP_287 2 /* 80287 FPU */
|
||||
#define IBCS2_FP_387 3 /* 80387 FPU */
|
||||
|
||||
#define SI86_FPHW 40
|
||||
#define STIME 54
|
||||
#define SETNAME 56
|
||||
#define SI86_MEM 65
|
||||
|
||||
struct ibcs2_sysi86_args {
|
||||
int cmd;
|
||||
int *arg;
|
||||
};
|
||||
|
||||
int
|
||||
ibcs2_sysi86(struct proc *p, struct ibcs2_sysi86_args *args, int *retval)
|
||||
{
|
||||
switch (args->cmd) {
|
||||
case 0x28: { /* SI86_FPHW */
|
||||
switch (SCARG(args, cmd)) {
|
||||
case SI86_FPHW: { /* Floating Point information */
|
||||
int val, error;
|
||||
extern int hw_float;
|
||||
|
||||
if (hw_float) val = IBCS2_FP_387; /* FPU hardware */
|
||||
else val = IBCS2_FP_SW; /* FPU emulator */
|
||||
|
||||
if (error = copyout(&val, args->arg, sizeof(val)))
|
||||
|
||||
if (error = copyout(&val, SCARG(args, arg), sizeof(val)))
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
case 0x33: /* SI86_MEM */
|
||||
case STIME: /* set the system time given pointer to long */
|
||||
/* gettimeofday; time.tv_sec = *args->arg; settimeofday */
|
||||
return EINVAL;
|
||||
|
||||
case SETNAME: { /* set hostname given string w/ len <= 7 chars */
|
||||
int name;
|
||||
int error;
|
||||
|
||||
if ((error = suser(p->p_ucred, &p->p_acflag)))
|
||||
return (error);
|
||||
name = KERN_HOSTNAME;
|
||||
return (kern_sysctl(&name, 1, 0, 0, SCARG(args, arg), 7, p));
|
||||
}
|
||||
|
||||
case SI86_MEM: /* size of physical memory */
|
||||
*retval = ctob(physmem);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
printf("IBCS2: 'sysi86' function %d(0x%x) "
|
||||
"not implemented yet\n", args->cmd, args->cmd);
|
||||
"not implemented yet\n", SCARG(args, cmd), args->cmd);
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
|
50
sys/i386/ibcs2/ibcs2_sysvec.c
Normal file
50
sys/i386/ibcs2/ibcs2_sysvec.c
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* 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 Steven Wallace.
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <i386/ibcs2/ibcs2_syscall.h>
|
||||
|
||||
extern int bsd_to_ibcs2_sig[];
|
||||
extern int bsd_to_ibcs2_errno[];
|
||||
extern struct sysent ibcs2_sysent[IBCS2_SYS_MAXSYSCALL];
|
||||
|
||||
struct sysentvec ibcs2_svr3_sysvec = {
|
||||
sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]),
|
||||
ibcs2_sysent,
|
||||
0xFF,
|
||||
NSIG,
|
||||
bsd_to_ibcs2_sig,
|
||||
ELAST,
|
||||
bsd_to_ibcs2_errno,
|
||||
0
|
||||
};
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef _IBCS2_TERMIOS_H
|
||||
#define _IBCS2_TERMIOS_H 1
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define IBCS2_NCC 8
|
||||
#define IBCS2_NCCS 13
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef _IBCS2_TIME_H
|
||||
#define _IBCS2_TIME_H
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_tm {
|
||||
int tm_sec;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef _IBCS2_USTAT_H
|
||||
#define _IBCS2_USTAT_H 1
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_ustat {
|
||||
long f_tfree;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <sys/malloc.h>
|
||||
#include <sys/vnode.h>
|
||||
|
||||
#include <compat/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
const char ibcs2_emul_path[] = "/emul/ibcs2";
|
||||
|
||||
|
|
|
@ -39,16 +39,25 @@
|
|||
#ifndef _IBCS2_UTIL_H_
|
||||
#define _IBCS2_UTIL_H_
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_param.h>
|
||||
#include <machine/vmparam.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef SCARG
|
||||
#define SCARG(p, x) (p)->x
|
||||
#endif
|
||||
|
||||
static __inline caddr_t stackgap_init(void);
|
||||
static __inline void *stackgap_alloc(caddr_t *, size_t);
|
||||
|
||||
static __inline caddr_t
|
||||
stackgap_init()
|
||||
{
|
||||
extern char sigcode[], esigcode[];
|
||||
#define szsigcode ((caddr_t)(esigcode - sigcode))
|
||||
return STACKGAPBASE;
|
||||
return (caddr_t)(ALIGN(((caddr_t)PS_STRINGS)
|
||||
+ sizeof(struct ps_strings)));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef _IBCS2_UTIME_H
|
||||
#define _IBCS2_UTIME_H
|
||||
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_utimbuf {
|
||||
ibcs2_time_t actime;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*-
|
||||
* Copyright (c) 1994 Sean Eric Fagan
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* Copyright (c) 1995 Steven Wallace
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -26,119 +27,124 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ibcs2_xenix.c,v 1.4 1995/05/02 13:14:59 ache Exp $
|
||||
* $Id: ibcs2_xenix.c,v 1.2 1995/02/03 21:31:35 bde Exp $
|
||||
*/
|
||||
|
||||
#include <i386/ibcs2/ibcs2.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/syslimits.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/timeb.h>
|
||||
#include <sys/unistd.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/psl.h>
|
||||
#include <machine/reg.h>
|
||||
|
||||
struct ibcs2_sco_chsize_args {
|
||||
int fd;
|
||||
ibcs2_off_t size;
|
||||
};
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix_syscall.h>
|
||||
|
||||
static int
|
||||
sco_chsize(struct proc *p, struct ibcs2_sco_chsize_args *args, int *retval)
|
||||
extern struct sysent xenix_sysent[];
|
||||
|
||||
int
|
||||
ibcs2_xenix(struct proc *p, struct ibcs2_xenix_args *uap, int *retval)
|
||||
{
|
||||
struct ftruncate_args {
|
||||
int fd;
|
||||
int pad;
|
||||
off_t length;
|
||||
} tmp;
|
||||
struct trapframe *tf = (struct trapframe *)p->p_md.md_regs;
|
||||
struct sysent *callp;
|
||||
u_int code;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix chsize'\n");
|
||||
tmp.fd = args->fd;
|
||||
tmp.pad = 0;
|
||||
tmp.length = args->size;
|
||||
return ftruncate(p, &tmp, retval);
|
||||
code = (tf->tf_eax & 0xff00) >> 8;
|
||||
callp = &xenix_sysent[code];
|
||||
|
||||
if(code < IBCS2_XENIX_MAXSYSCALL)
|
||||
return((*callp->sy_call)(p, (void *)uap, retval));
|
||||
else
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
struct ibcs2_sco_ftime_args {
|
||||
struct timeb *tp;
|
||||
};
|
||||
|
||||
static int
|
||||
sco_ftime(struct proc *p, struct ibcs2_sco_ftime_args *args, int *retval)
|
||||
int
|
||||
xenix_rdchk(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct xenix_rdchk_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct timeval atv;
|
||||
extern struct timezone tz;
|
||||
struct timeb tb;
|
||||
int error;
|
||||
struct ioctl_args sa;
|
||||
caddr_t sg = stackgap_init();
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix ftime'\n");
|
||||
microtime(&atv);
|
||||
tb.time = atv.tv_sec;
|
||||
tb.millitm = atv.tv_usec / 1000;
|
||||
tb.timezone = tz.tz_minuteswest;
|
||||
tb.dstflag = tz.tz_dsttime != DST_NONE;
|
||||
|
||||
return copyout((caddr_t)&tb, (caddr_t)args->tp, sizeof(struct timeb));
|
||||
DPRINTF(("IBCS2: 'xenix rdchk'\n"));
|
||||
SCARG(&sa, fd) = SCARG(uap, fd);
|
||||
SCARG(&sa, com) = FIONREAD;
|
||||
SCARG(&sa, data) = stackgap_alloc(&sg, sizeof(int));
|
||||
if (error = ioctl(p, &sa, retval))
|
||||
return error;
|
||||
*retval = (*((int*)SCARG(&sa, data))) ? 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ibcs2_sco_nap_args {
|
||||
long time;
|
||||
};
|
||||
int
|
||||
xenix_chsize(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct xenix_chsize_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct ftruncate_args sa;
|
||||
|
||||
static int
|
||||
sco_nap(struct proc *p, struct ibcs2_sco_nap_args *args, int *retval)
|
||||
DPRINTF(("IBCS2: 'xenix chsize'\n"));
|
||||
SCARG(&sa, fd) = SCARG(uap, fd);
|
||||
SCARG(&sa, pad) = 0;
|
||||
SCARG(&sa, length) = SCARG(uap, size);
|
||||
return ftruncate(p, &sa, retval);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
xenix_ftime(p, uap, retval)
|
||||
struct proc *p;
|
||||
struct xenix_ftime_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timeb itb;
|
||||
|
||||
DPRINTF(("IBCS2: 'xenix ftime'\n"));
|
||||
microtime(&tv);
|
||||
itb.time = tv.tv_sec;
|
||||
itb.millitm = (tv.tv_usec / 1000);
|
||||
itb.timezone = tz.tz_minuteswest;
|
||||
itb.dstflag = tz.tz_dsttime != DST_NONE;
|
||||
|
||||
return copyout((caddr_t)&itb, (caddr_t)SCARG(uap, tp),
|
||||
sizeof(struct timeb));
|
||||
}
|
||||
|
||||
int
|
||||
xenix_nap(struct proc *p, struct xenix_nap_args *uap, int *retval)
|
||||
{
|
||||
long period;
|
||||
extern int hz;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix nap %d ms'\n", args->time);
|
||||
period = (long)args->time / (1000/hz);
|
||||
DPRINTF(("IBCS2: 'xenix nap %d ms'\n", SCARG(uap, millisec)));
|
||||
period = (long)SCARG(uap, millisec) / (1000/hz);
|
||||
if (period)
|
||||
while (tsleep(&period, PUSER, "nap", period)
|
||||
while (tsleep(&period, PUSER, "nap", period)
|
||||
!= EWOULDBLOCK) ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ibcs2_sco_rdchk_args {
|
||||
int fd;
|
||||
};
|
||||
|
||||
static int
|
||||
sco_rdchk(struct proc *p, struct ibcs2_sco_rdchk_args *args, int *retval)
|
||||
{
|
||||
struct ioctl_arg {
|
||||
int fd;
|
||||
int cmd;
|
||||
caddr_t arg;
|
||||
} tmp;
|
||||
int error;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix rdchk'\n");
|
||||
tmp.fd = args->fd;
|
||||
tmp.cmd = FIONREAD;
|
||||
tmp.arg = (caddr_t)UA_ALLOC();
|
||||
error = ioctl(p, &tmp, retval);
|
||||
if (!error)
|
||||
*retval = *retval <= 0 ? 0 : 1;
|
||||
return error;
|
||||
}
|
||||
|
||||
struct ibcs2_sco_utsname_args {
|
||||
long addr;
|
||||
};
|
||||
|
||||
static int
|
||||
sco_utsname(struct proc *p, struct ibcs2_sco_utsname_args *args, int *retval)
|
||||
int
|
||||
xenix_utsname(struct proc *p, struct xenix_utsname_args *args, int *retval)
|
||||
{
|
||||
struct ibcs2_sco_utsname {
|
||||
char sysname[9];
|
||||
|
@ -153,10 +159,8 @@ sco_utsname(struct proc *p, struct ibcs2_sco_utsname_args *args, int *retval)
|
|||
char numusers[9];
|
||||
unsigned short numcpu;
|
||||
} ibcs2_sco_uname;
|
||||
extern char ostype[], hostname[], osrelease[], version[], machine[];
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix sco_utsname'\n");
|
||||
DPRINTF(("IBCS2: 'xenix sco_utsname'\n"));
|
||||
bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname));
|
||||
strncpy(ibcs2_sco_uname.sysname, ostype, 8);
|
||||
strncpy(ibcs2_sco_uname.nodename, hostname, 8);
|
||||
|
@ -174,194 +178,9 @@ sco_utsname(struct proc *p, struct ibcs2_sco_utsname_args *args, int *retval)
|
|||
}
|
||||
|
||||
int
|
||||
ibcs2_cxenix(struct proc *p, void *args, int *retval)
|
||||
xenix_scoinfo(struct proc *p, struct xenix_scoinfo_args *uap, int *retval)
|
||||
{
|
||||
struct trapframe *tf = (struct trapframe *)p->p_md.md_regs;
|
||||
|
||||
switch ((tf->tf_eax & 0xff00) >> 8) {
|
||||
|
||||
case 0x07: /* rdchk */
|
||||
return sco_rdchk(p, args, retval);
|
||||
|
||||
case 0x0a: /* chsize */
|
||||
return sco_chsize(p, args, retval);
|
||||
|
||||
case 0x0b: /* ftime */
|
||||
return sco_ftime(p, args, retval);
|
||||
|
||||
case 0x0c: /* nap */
|
||||
return sco_nap(p, args, retval);
|
||||
|
||||
case 0x15: /* scoinfo (not documented) */
|
||||
*retval = 0;
|
||||
return 0;
|
||||
|
||||
case 0x24: /* select */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix select'\n");
|
||||
return select(p, args, retval);
|
||||
|
||||
case 0x25: /* eaccess */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix eaccess'\n");
|
||||
return ibcs2_access(p, args, retval);
|
||||
|
||||
case 0x27: /* sigaction */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix sigaction'\n");
|
||||
return ibcs2_sigaction (p, args, retval);
|
||||
|
||||
case 0x28: /* sigprocmask */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix sigprocmask'\n");
|
||||
return ibcs2_sigprocmask (p, args, retval);
|
||||
|
||||
case 0x29: /* sigpending */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix sigpending'\n");
|
||||
return ibcs2_sigpending (p, args, retval);
|
||||
|
||||
case 0x2a: /* sigsuspend */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix sigsuspend'\n");
|
||||
return ibcs2_sigsuspend (p, args, retval);
|
||||
|
||||
case 0x2b: /* getgroups */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix getgroups'\n");
|
||||
return ibcs2_getgroups(p, args, retval);
|
||||
|
||||
case 0x2c: /* setgroups */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix setgroups'\n");
|
||||
return ibcs2_setgroups(p, args, retval);
|
||||
|
||||
case 0x2d: { /* sysconf */
|
||||
struct ibcs2_sysconf_args {
|
||||
int num;
|
||||
} *sysconf_args = args;
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix sysconf'");
|
||||
switch (sysconf_args->num) {
|
||||
case 0: /* _SC_ARG_MAX */
|
||||
*retval = (ARG_MAX);
|
||||
break;
|
||||
case 1: /* _SC_CHILD_MAX */
|
||||
*retval = (CHILD_MAX);
|
||||
break;
|
||||
case 2: /* _SC_CLK_TCK */
|
||||
*retval = (_BSD_CLK_TCK_);
|
||||
break;
|
||||
case 3: /* _SC_NGROUPS_MAX */
|
||||
*retval = (NGROUPS_MAX);
|
||||
break;
|
||||
case 4: /* _SC_OPEN_MAX */
|
||||
*retval = (OPEN_MAX);
|
||||
break;
|
||||
case 5: /* _SC_JOB_CONTROL */
|
||||
#ifdef _POSIX_JOB_CONTROL
|
||||
*retval = (1);
|
||||
#else
|
||||
*retval = (-1);
|
||||
#endif
|
||||
break;
|
||||
case 6: /* _SC_SAVED_IDS */
|
||||
#ifdef _POSIX_SAVED_IDS
|
||||
*retval = (1);
|
||||
#else
|
||||
*retval = (-1);
|
||||
#endif
|
||||
break;
|
||||
case 7: /* _SC_VERSION */
|
||||
*retval = (_POSIX_VERSION);
|
||||
break;
|
||||
default:
|
||||
*retval = -1;
|
||||
return EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case 0x2e: /* pathconf */
|
||||
case 0x2f: /* fpathconf */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix (f)pathconf'\n");
|
||||
return ibcs2_pathconf(p, args, retval);
|
||||
|
||||
case 0x30: /* rename */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix rename'\n");
|
||||
return ibcs2_rename(p, args, retval);
|
||||
|
||||
case 0x32: /* sco_utsname */
|
||||
return sco_utsname(p, args, retval);
|
||||
|
||||
case 0x37: /* getitimer */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix getitimer'\n");
|
||||
return getitimer(p, args, retval);
|
||||
|
||||
case 0x38: /* setitimer */
|
||||
if (ibcs2_trace & IBCS2_TRACE_XENIX)
|
||||
printf("IBCS2: 'cxenix setitimer'\n");
|
||||
return setitimer(p, args, retval);
|
||||
|
||||
|
||||
/* Not implemented yet SORRY */
|
||||
case 0x01: /* xlocking */
|
||||
printf("IBCS2: 'cxenix xlocking'");
|
||||
break;
|
||||
case 0x02: /* creatsem */
|
||||
printf("IBCS2: 'cxenix creatsem'");
|
||||
break;
|
||||
case 0x03: /* opensem */
|
||||
printf("IBCS2: 'cxenix opensem'");
|
||||
break;
|
||||
case 0x04: /* sigsem */
|
||||
printf("IBCS2: 'cxenix sigsem'");
|
||||
break;
|
||||
case 0x05: /* waitsem */
|
||||
printf("IBCS2: 'cxenix waitsem'");
|
||||
break;
|
||||
case 0x06: /* nbwaitsem */
|
||||
printf("IBCS2: 'cxenix nbwaitsem'");
|
||||
break;
|
||||
case 0x0d: /* sdget */
|
||||
printf("IBCS2: 'cxenix sdget'");
|
||||
break;
|
||||
case 0x0e: /* sdfree */
|
||||
printf("IBCS2: 'cxenix sdfree'");
|
||||
break;
|
||||
case 0x0f: /* sdenter */
|
||||
printf("IBCS2: 'cxenix sdenter'");
|
||||
break;
|
||||
case 0x10: /* sdleave */
|
||||
printf("IBCS2: 'cxenix sdleave'");
|
||||
break;
|
||||
case 0x11: /* sdgetv */
|
||||
printf("IBCS2: 'cxenix sdgetv'");
|
||||
break;
|
||||
case 0x12: /* sdwaitv */
|
||||
printf("IBCS2: 'cxenix sdwaitv'");
|
||||
break;
|
||||
case 0x20: /* proctl */
|
||||
printf("IBCS2: 'cxenix proctl'");
|
||||
break;
|
||||
case 0x21: /* execseg */
|
||||
printf("IBCS2: 'cxenix execseg'");
|
||||
break;
|
||||
case 0x22: /* unexecseg */
|
||||
printf("IBCS2: 'cxenix unexecseg'");
|
||||
break;
|
||||
case 0x26: /* paccess */
|
||||
printf("IBCS2: 'cxenix paccess'");
|
||||
break;
|
||||
default:
|
||||
printf("IBCS2: 'cxenix' function %d(0x%x)",
|
||||
tf->tf_eax>>8, tf->tf_eax>>8);
|
||||
break;
|
||||
}
|
||||
printf(" not implemented yet\n");
|
||||
return EINVAL;
|
||||
/* scoinfo (not documented) */
|
||||
*retval = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
95
sys/i386/ibcs2/ibcs2_xenix.h
Normal file
95
sys/i386/ibcs2/ibcs2_xenix.h
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* System call prototypes.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.xenix,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_XENIX_H_
|
||||
#define _IBCS2_XENIX_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
struct xenix_rdchk_args {
|
||||
int fd;
|
||||
};
|
||||
struct xenix_chsize_args {
|
||||
int fd;
|
||||
long size;
|
||||
};
|
||||
struct xenix_ftime_args {
|
||||
struct timeb * tp;
|
||||
};
|
||||
struct xenix_nap_args {
|
||||
int millisec;
|
||||
};
|
||||
struct xenix_scoinfo_args {
|
||||
int dummy;
|
||||
};
|
||||
struct ibcs2_sigaction_args {
|
||||
int sig;
|
||||
struct ibcs2_sigaction * act;
|
||||
struct ibcs2_sigaction * oact;
|
||||
};
|
||||
struct ibcs2_sigprocmask_args {
|
||||
int how;
|
||||
ibcs2_sigset_t * set;
|
||||
ibcs2_sigset_t * oset;
|
||||
};
|
||||
struct ibcs2_sigpending_args {
|
||||
ibcs2_sigset_t * mask;
|
||||
};
|
||||
struct ibcs2_sigsuspend_args {
|
||||
ibcs2_sigset_t * mask;
|
||||
};
|
||||
struct ibcs2_getgroups_args {
|
||||
int gidsetsize;
|
||||
ibcs2_gid_t * gidset;
|
||||
};
|
||||
struct ibcs2_setgroups_args {
|
||||
int gidsetsize;
|
||||
ibcs2_gid_t * gidset;
|
||||
};
|
||||
struct ibcs2_sysconf_args {
|
||||
int name;
|
||||
};
|
||||
struct ibcs2_pathconf_args {
|
||||
char * path;
|
||||
int name;
|
||||
};
|
||||
struct ibcs2_fpathconf_args {
|
||||
int fd;
|
||||
int name;
|
||||
};
|
||||
struct ibcs2_rename_args {
|
||||
char * from;
|
||||
char * to;
|
||||
};
|
||||
struct xenix_utsname_args {
|
||||
long addr;
|
||||
};
|
||||
int xenix_rdchk __P((struct proc *, struct xenix_rdchk_args *, int []));
|
||||
int xenix_chsize __P((struct proc *, struct xenix_chsize_args *, int []));
|
||||
int xenix_ftime __P((struct proc *, struct xenix_ftime_args *, int []));
|
||||
int xenix_nap __P((struct proc *, struct xenix_nap_args *, int []));
|
||||
int xenix_scoinfo __P((struct proc *, struct xenix_scoinfo_args *, int []));
|
||||
int ibcs2_sigaction __P((struct proc *, struct ibcs2_sigaction_args *, int []));
|
||||
int ibcs2_sigprocmask __P((struct proc *, struct ibcs2_sigprocmask_args *, int []));
|
||||
int ibcs2_sigpending __P((struct proc *, struct ibcs2_sigpending_args *, int []));
|
||||
int ibcs2_sigsuspend __P((struct proc *, struct ibcs2_sigsuspend_args *, int []));
|
||||
int ibcs2_getgroups __P((struct proc *, struct ibcs2_getgroups_args *, int []));
|
||||
int ibcs2_setgroups __P((struct proc *, struct ibcs2_setgroups_args *, int []));
|
||||
int ibcs2_sysconf __P((struct proc *, struct ibcs2_sysconf_args *, int []));
|
||||
int ibcs2_pathconf __P((struct proc *, struct ibcs2_pathconf_args *, int []));
|
||||
int ibcs2_fpathconf __P((struct proc *, struct ibcs2_fpathconf_args *, int []));
|
||||
int ibcs2_rename __P((struct proc *, struct ibcs2_rename_args *, int []));
|
||||
int xenix_utsname __P((struct proc *, struct xenix_utsname_args *, int []));
|
||||
|
||||
#ifdef COMPAT_43
|
||||
|
||||
|
||||
#endif /* COMPAT_43 */
|
||||
|
||||
#endif /* !_IBCS2_XENIX_H_ */
|
27
sys/i386/ibcs2/ibcs2_xenix_syscall.h
Normal file
27
sys/i386/ibcs2/ibcs2_xenix_syscall.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* System call numbers.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.xenix,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#define IBCS2_XENIX_xenix_rdchk 7
|
||||
#define IBCS2_XENIX_xenix_chsize 10
|
||||
#define IBCS2_XENIX_xenix_ftime 11
|
||||
#define IBCS2_XENIX_xenix_nap 12
|
||||
#define IBCS2_XENIX_xenix_scoinfo 21
|
||||
#define IBCS2_XENIX_select 36
|
||||
#define IBCS2_XENIX_ibcs2_sigaction 39
|
||||
#define IBCS2_XENIX_ibcs2_sigprocmask 40
|
||||
#define IBCS2_XENIX_ibcs2_sigpending 41
|
||||
#define IBCS2_XENIX_ibcs2_sigsuspend 42
|
||||
#define IBCS2_XENIX_ibcs2_getgroups 43
|
||||
#define IBCS2_XENIX_ibcs2_setgroups 44
|
||||
#define IBCS2_XENIX_ibcs2_sysconf 45
|
||||
#define IBCS2_XENIX_ibcs2_pathconf 46
|
||||
#define IBCS2_XENIX_ibcs2_fpathconf 47
|
||||
#define IBCS2_XENIX_ibcs2_rename 48
|
||||
#define IBCS2_XENIX_xenix_utsname 50
|
||||
#define IBCS2_XENIX_getitimer 55
|
||||
#define IBCS2_XENIX_setitimer 56
|
||||
#define IBCS2_XENIX_MAXSYSCALL 57
|
84
sys/i386/ibcs2/ibcs2_xenix_sysent.c
Normal file
84
sys/i386/ibcs2/ibcs2_xenix_sysent.c
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* System call switch table.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* created from Id: syscalls.xenix,v 1.1 1995/10/06 15:12:52 swallace Exp
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
|
||||
#ifdef COMPAT_43
|
||||
#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)
|
||||
#else
|
||||
#define compat(n, name) 0, (sy_call_t *)nosys
|
||||
#endif
|
||||
|
||||
/* The casts are bogus but will do for now. */
|
||||
struct sysent xenix_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys }, /* 0 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 1 = xenix_xlocking */
|
||||
{ 0, (sy_call_t *)nosys }, /* 2 = xenix_creatsem */
|
||||
{ 0, (sy_call_t *)nosys }, /* 3 = xenix_opensem */
|
||||
{ 0, (sy_call_t *)nosys }, /* 4 = xenix_sigsem */
|
||||
{ 0, (sy_call_t *)nosys }, /* 5 = xenix_waitsem */
|
||||
{ 0, (sy_call_t *)nosys }, /* 6 = xenix_nbwaitsem */
|
||||
{ 1, (sy_call_t *)xenix_rdchk }, /* 7 = xenix_rdchk */
|
||||
{ 0, (sy_call_t *)nosys }, /* 8 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 9 = nosys */
|
||||
{ 2, (sy_call_t *)xenix_chsize }, /* 10 = xenix_chsize */
|
||||
{ 1, (sy_call_t *)xenix_ftime }, /* 11 = xenix_ftime */
|
||||
{ 1, (sy_call_t *)xenix_nap }, /* 12 = xenix_nap */
|
||||
{ 0, (sy_call_t *)nosys }, /* 13 = xenix_sdget */
|
||||
{ 0, (sy_call_t *)nosys }, /* 14 = xenix_sdfree */
|
||||
{ 0, (sy_call_t *)nosys }, /* 15 = xenix_sdenter */
|
||||
{ 0, (sy_call_t *)nosys }, /* 16 = xenix_sdleave */
|
||||
{ 0, (sy_call_t *)nosys }, /* 17 = xenix_sdgetv */
|
||||
{ 0, (sy_call_t *)nosys }, /* 18 = xenix_sdwaitv */
|
||||
{ 0, (sy_call_t *)nosys }, /* 19 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 20 = nosys */
|
||||
{ 0, (sy_call_t *)xenix_scoinfo }, /* 21 = xenix_scoinfo */
|
||||
{ 0, (sy_call_t *)nosys }, /* 22 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 23 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 24 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 25 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 26 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 27 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 28 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 29 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 30 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 31 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 32 = xenix_proctl */
|
||||
{ 0, (sy_call_t *)nosys }, /* 33 = xenix_execseg */
|
||||
{ 0, (sy_call_t *)nosys }, /* 34 = xenix_unexecseg */
|
||||
{ 0, (sy_call_t *)nosys }, /* 35 = nosys */
|
||||
{ 5, (sy_call_t *)select }, /* 36 = select */
|
||||
{ 0, (sy_call_t *)nosys }, /* 37 = xenix_eaccess */
|
||||
{ 0, (sy_call_t *)nosys }, /* 38 = xenix_paccess */
|
||||
{ 3, (sy_call_t *)ibcs2_sigaction }, /* 39 = ibcs2_sigaction */
|
||||
{ 3, (sy_call_t *)ibcs2_sigprocmask }, /* 40 = ibcs2_sigprocmask */
|
||||
{ 1, (sy_call_t *)ibcs2_sigpending }, /* 41 = ibcs2_sigpending */
|
||||
{ 1, (sy_call_t *)ibcs2_sigsuspend }, /* 42 = ibcs2_sigsuspend */
|
||||
{ 2, (sy_call_t *)ibcs2_getgroups }, /* 43 = ibcs2_getgroups */
|
||||
{ 2, (sy_call_t *)ibcs2_setgroups }, /* 44 = ibcs2_setgroups */
|
||||
{ 1, (sy_call_t *)ibcs2_sysconf }, /* 45 = ibcs2_sysconf */
|
||||
{ 2, (sy_call_t *)ibcs2_pathconf }, /* 46 = ibcs2_pathconf */
|
||||
{ 2, (sy_call_t *)ibcs2_fpathconf }, /* 47 = ibcs2_fpathconf */
|
||||
{ 2, (sy_call_t *)ibcs2_rename }, /* 48 = ibcs2_rename */
|
||||
{ 0, (sy_call_t *)nosys }, /* 49 = nosys */
|
||||
{ 1, (sy_call_t *)xenix_utsname }, /* 50 = xenix_utsname */
|
||||
{ 0, (sy_call_t *)nosys }, /* 51 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 52 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 53 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 54 = nosys */
|
||||
{ 2, (sy_call_t *)getitimer }, /* 55 = getitimer */
|
||||
{ 3, (sy_call_t *)setitimer }, /* 56 = setitimer */
|
||||
};
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: imgact_coff.c,v 1.6 1995/08/28 09:18:36 julian Exp $
|
||||
* $Id: imgact_coff.c,v 1.7 1995/09/13 02:12:51 sef Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -42,8 +42,17 @@
|
|||
#include <sys/sysent.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include "coff.h"
|
||||
#include "ibcs2.h"
|
||||
|
||||
#include <i386/ibcs2/coff.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
extern struct sysentvec ibcs2_svr3_sysvec;
|
||||
|
||||
extern int coff_load_file __P((struct proc *p, char *name));
|
||||
extern int exec_coff_imgact __P((struct image_params *iparams));
|
||||
|
||||
static int load_coff_section __P((struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot));
|
||||
|
||||
|
||||
static int
|
||||
load_coff_section(vmspace, vp, offset, vmaddr, memsz, filsz, prot)
|
||||
|
@ -80,11 +89,9 @@ load_coff_section(vmspace, vp, offset, vmaddr, memsz, filsz, prot)
|
|||
map_len = round_page(offset + filsz) - trunc_page(map_offset);
|
||||
}
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08lx, 0x%x, 0x%x, "
|
||||
"VM_PROT_ALL, MAP_FILE | MAP_PRIVATE | MAP_FIXED, vp, 0x%x)\n",
|
||||
__FILE__, __LINE__, map_addr, map_len, prot, map_offset);
|
||||
}
|
||||
DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08lx, 0x%x, 0x%x, "
|
||||
"VM_PROT_ALL, MAP_FILE | MAP_PRIVATE | MAP_FIXED, vp, 0x%x)\n",
|
||||
__FILE__, __LINE__, map_addr, map_len, prot, map_offset));
|
||||
|
||||
if (error = vm_mmap(&vmspace->vm_map,
|
||||
&map_addr,
|
||||
|
@ -113,10 +120,7 @@ printf("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08lx, 0x%x, 0x%x, "
|
|||
map_addr = trunc_page(vmaddr + filsz);
|
||||
map_len = round_page(memsz) - trunc_page(filsz);
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx, 0x%x, FALSE)\n",
|
||||
__FILE__, __LINE__, map_addr, map_len);
|
||||
}
|
||||
DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx,0x%x, FALSE)\n", __FILE__, __LINE__, map_addr, map_len));
|
||||
|
||||
if (map_len != 0) {
|
||||
error = vm_map_find(&vmspace->vm_map, NULL, 0, &map_addr,
|
||||
|
@ -292,7 +296,6 @@ exec_coff_imgact(iparams)
|
|||
unsigned long vmaddr;
|
||||
int nscns;
|
||||
int error, len;
|
||||
extern struct sysentvec ibcs2_svr3_sysvec;
|
||||
unsigned long text_offset = 0, text_address = 0, text_size = 0;
|
||||
unsigned long data_offset = 0, data_address = 0, data_size = 0;
|
||||
unsigned long bss_size = 0;
|
||||
|
@ -306,11 +309,8 @@ exec_coff_imgact(iparams)
|
|||
if (fhdr->f_magic != I386_COFF ||
|
||||
!(fhdr->f_flags & F_EXEC)) {
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): return -1\n", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
return -1;
|
||||
DPRINTF(("%s(%d): return -1\n", __FILE__, __LINE__));
|
||||
return -1;
|
||||
}
|
||||
|
||||
nscns = fhdr->f_nscns;
|
||||
|
@ -320,10 +320,8 @@ printf("%s(%d): return -1\n", __FILE__, __LINE__);
|
|||
* read in all of the section structures.
|
||||
*/
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): return -1\n", __FILE__, __LINE__);
|
||||
}
|
||||
return -1;
|
||||
DPRINTF(("%s(%d): return -1\n", __FILE__, __LINE__));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ahdr = (struct aouthdr*)((char*)(iparams->image_header) +
|
||||
|
@ -335,22 +333,17 @@ printf("%s(%d): return -1\n", __FILE__, __LINE__);
|
|||
sizeof(struct aouthdr));
|
||||
|
||||
if (error = exec_extract_strings(iparams)) {
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): return %d\n", __FILE__, __LINE__, error);
|
||||
}
|
||||
return error;
|
||||
DPRINTF(("%s(%d): return %d\n", __FILE__, __LINE__, error));
|
||||
return error;
|
||||
}
|
||||
|
||||
exec_new_vmspace(iparams);
|
||||
|
||||
for (i = 0; i < nscns; i++) {
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("i = %d, scns[i].s_name = %s, scns[i].s_vaddr = %08lx, "
|
||||
"scns[i].s_scnptr = %d\n", i, scns[i].s_name,
|
||||
scns[i].s_vaddr, scns[i].s_scnptr);
|
||||
}
|
||||
DPRINTF(("i = %d, scns[i].s_name = %s, scns[i].s_vaddr = %08lx, "
|
||||
"scns[i].s_scnptr = %d\n", i, scns[i].s_name,
|
||||
scns[i].s_vaddr, scns[i].s_scnptr));
|
||||
if (scns[i].s_flags & STYP_NOLOAD) {
|
||||
/*
|
||||
* A section that is not loaded, for whatever
|
||||
|
@ -389,15 +382,20 @@ printf("i = %d, scns[i].s_name = %s, scns[i].s_vaddr = %08lx, "
|
|||
}
|
||||
for (j = off; j < scns[i].s_size + off; j++) {
|
||||
char *libname;
|
||||
char libbuf[40];
|
||||
|
||||
libname = buf + j + 4 * *(long*)(buf + j + 4);
|
||||
j += 4* *(long*)(buf + j);
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): shared library %s\n", __FILE__, __LINE__, libname);
|
||||
}
|
||||
error = coff_load_file(iparams->proc, libname);
|
||||
DPRINTF(("%s(%d): shared library %s\n",
|
||||
__FILE__, __LINE__, libname));
|
||||
strcpy(libbuf, "/emul/ibcs2");
|
||||
strcpy(&libbuf[11], libname);
|
||||
error = coff_load_file(iparams->proc, libbuf);
|
||||
if (error)
|
||||
break;
|
||||
error = coff_load_file(iparams->proc, libname);
|
||||
if (error)
|
||||
break;
|
||||
}
|
||||
if (vm_map_remove(kernel_map,
|
||||
(vm_offset_t) buf,
|
||||
|
@ -411,20 +409,15 @@ printf("%s(%d): shared library %s\n", __FILE__, __LINE__, libname);
|
|||
* Map in .text now
|
||||
*/
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): load_coff_section(vmspace, "
|
||||
"iparams->vnodep, %08lx, %08lx, 0x%x, 0x%x, 0x%x)\n",
|
||||
__FILE__, __LINE__, text_offset, text_address,
|
||||
text_size, text_size, VM_PROT_READ | VM_PROT_EXECUTE);
|
||||
}
|
||||
DPRINTF(("%s(%d): load_coff_section(vmspace, "
|
||||
"iparams->vnodep, %08lx, %08lx, 0x%x, 0x%x, 0x%x)\n",
|
||||
__FILE__, __LINE__, text_offset, text_address,
|
||||
text_size, text_size, VM_PROT_READ | VM_PROT_EXECUTE));
|
||||
if (error = load_coff_section(vmspace, iparams->vnodep,
|
||||
text_offset, (caddr_t)text_address,
|
||||
text_size, text_size,
|
||||
VM_PROT_READ | VM_PROT_EXECUTE)) {
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
|
||||
}
|
||||
DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
|
||||
return error;
|
||||
}
|
||||
/*
|
||||
|
@ -432,20 +425,16 @@ printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
|
|||
*/
|
||||
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): load_coff_section(vmspace, "
|
||||
"iparams->vnodep, 0x%08lx, 0x%08lx, 0x%x, 0x%x, 0x%x)\n",
|
||||
__FILE__, __LINE__, data_offset, data_address,
|
||||
data_size + bss_size, data_size, VM_PROT_ALL);
|
||||
}
|
||||
DPRINTF(("%s(%d): load_coff_section(vmspace, "
|
||||
"iparams->vnodep, 0x%08lx, 0x%08lx, 0x%x, 0x%x, 0x%x)\n",
|
||||
__FILE__, __LINE__, data_offset, data_address,
|
||||
data_size + bss_size, data_size, VM_PROT_ALL));
|
||||
if (error = load_coff_section(vmspace, iparams->vnodep,
|
||||
data_offset, (caddr_t)data_address,
|
||||
data_size + bss_size, data_size,
|
||||
VM_PROT_ALL)) {
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
|
||||
}
|
||||
DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -460,20 +449,18 @@ printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
|
|||
hole = (caddr_t)trunc_page(vmspace->vm_daddr) + ctob(vmspace->vm_dsize);
|
||||
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx, PAGE_SIZE, FALSE)\n",
|
||||
__FILE__, __LINE__, hole);
|
||||
printf("imgact: error = %d\n", error);
|
||||
}
|
||||
DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx, PAGE_SIZE, FALSE)\n",
|
||||
__FILE__, __LINE__, hole));
|
||||
DPRINTF(("imgact: error = %d\n", error));
|
||||
|
||||
error = vm_map_find(&vmspace->vm_map, NULL, 0,
|
||||
(vm_offset_t *) &hole, PAGE_SIZE, FALSE);
|
||||
|
||||
if (ibcs2_trace & IBCS2_TRACE_COFF) {
|
||||
printf("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%x end = 0x%x\n",
|
||||
ctob(vmspace->vm_dsize), vmspace->vm_daddr,
|
||||
ctob(vmspace->vm_dsize) + vmspace->vm_daddr );
|
||||
printf("%s(%d): returning successfully!\n", __FILE__, __LINE__);
|
||||
}
|
||||
DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%x end = 0x%x\n",
|
||||
ctob(vmspace->vm_dsize), vmspace->vm_daddr,
|
||||
ctob(vmspace->vm_dsize) + vmspace->vm_daddr ));
|
||||
DPRINTF(("%s(%d): returning successfully!\n", __FILE__, __LINE__));
|
||||
|
||||
/* Indicate that this file should not be modified */
|
||||
iparams->vnodep->v_flag |= VTEXT;
|
||||
return 0;
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# syscalls.conf
|
||||
|
||||
sysnames="ibcs2_syscalls.c"
|
||||
sysnumhdr="ibcs2_syscall.h"
|
||||
# syscalls.conf $Id$
|
||||
sysnames="/dev/null"
|
||||
sysproto="ibcs2_proto.h"
|
||||
sysproto_h=_IBCS2_SYSPROTO_H_
|
||||
syshdr="ibcs2_syscall.h"
|
||||
syssw="ibcs2_sysent.c"
|
||||
sysarghdr="ibcs2_syscallargs.h"
|
||||
compatopts="compat_43 compat_09 compat_10"
|
||||
libcompatopts=""
|
||||
|
||||
syshide="/dev/null"
|
||||
syscallprefix="IBCS2_SYS_"
|
||||
switchname="ibcs2_sysent"
|
||||
namesname="ibcs2_syscallnames"
|
||||
constprefix="IBCS2_SYS_"
|
||||
sysvec="\n"
|
||||
|
|
36
sys/i386/ibcs2/syscalls.isc
Normal file
36
sys/i386/ibcs2/syscalls.isc
Normal file
|
@ -0,0 +1,36 @@
|
|||
$Id: syscalls.isc,v 1.1 1995/10/06 15:12:52 swallace Exp $
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
|
||||
0 UNIMPL ISC nosys
|
||||
1 UNIMPL ISC isc_setostype
|
||||
2 NOPROTO ISC { int ibcs2_rename(char *from, char *to); }
|
||||
3 NOPROTO ISC { int ibcs2_sigaction(int sig, \
|
||||
struct ibcs2_sigaction *act, \
|
||||
struct ibcs2_sigaction *oact); }
|
||||
4 NOPROTO ISC { int ibcs2_sigprocmask(int how, ibcs2_sigset_t *set, \
|
||||
ibcs2_sigset_t *oset); }
|
||||
5 NOPROTO ISC { int ibcs2_sigpending(ibcs2_sigset_t *mask); }
|
||||
6 NOPROTO POSIX { int getgroups(u_int gidsetsize, gid_t *gidset); }
|
||||
7 NOPROTO POSIX { int setgroups(u_int gidsetsize, gid_t *gidset); }
|
||||
8 NOPROTO ISC { int ibcs2_pathconf(char *path, int name); }
|
||||
9 NOPROTO ISC { int ibcs2_fpathconf(int fd, int name); }
|
||||
10 UNIMPL ISC nosys
|
||||
11 NOPROTO SVR3 { int ibcs2_wait(int a1, int a2, int a3); }
|
||||
12 NOPROTO POSIX { int setsid(void); }
|
||||
13 NOPROTO POSIX { pid_t getpid(void); }
|
||||
14 UNIMPL ISC isc_adduser
|
||||
15 UNIMPL ISC isc_setuser
|
||||
16 NOPROTO ISC { int ibcs2_sysconf(int name); }
|
||||
17 NOPROTO ISC { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); }
|
||||
18 NOPROTO SVR3 { int ibcs2_symlink(char *path, char *link); }
|
||||
19 NOPROTO SVR3 { int ibcs2_readlink(char *path, char *buf, int count); }
|
||||
20 UNIMPL ISC isc_getmajor
|
12
sys/i386/ibcs2/syscalls.isc.conf
Normal file
12
sys/i386/ibcs2/syscalls.isc.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
# syscalls.conf $Id$
|
||||
sysnames="/dev/null"
|
||||
#sysproto="ibcs2_isc.h"
|
||||
sysproto="/dev/null"
|
||||
sysproto_h=_IBCS2_ISC_H_
|
||||
syshdr="ibcs2_isc_syscall.h"
|
||||
syssw="ibcs2_isc_sysent.c"
|
||||
syshide="/dev/null"
|
||||
syscallprefix="IBCS2_ISC_"
|
||||
switchname="isc_sysent"
|
||||
namesname="isc_syscallnames"
|
||||
sysvec="\n"
|
|
@ -1,243 +1,193 @@
|
|||
$NetBSD: syscalls.master,v 1.4 1995/03/14 15:12:52 scottb Exp $
|
||||
$Id: syscalls.master,v 1.1 1995/10/06 15:12:52 swallace Exp $
|
||||
|
||||
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
|
||||
; System call name/number master file (or rather, slave, from IBCS2).
|
||||
; Processed to created ibcs2_sysent.c, ibcs2_syscalls.c and ibcs2_syscall.h.
|
||||
|
||||
; Columns: number type nargs name altname/comments
|
||||
; Columns: number type nargs namespc name alt{name,tag,rtyp}/comments
|
||||
; number system call number, must be in order
|
||||
; type one of STD, OBSOL, UNIMPL, STD
|
||||
; nargs number of arguments
|
||||
; name name of syscall routine
|
||||
; type one of STD, OBSOL, UNIMPL, COMPAT
|
||||
; namespc one of POSIX, BSD, SVR3, SCO, NOHIDE
|
||||
; 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
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <compat/ibcs2/ibcs2_types.h>
|
||||
#include <compat/ibcs2/ibcs2_signal.h>
|
||||
#include <compat/ibcs2/ibcs2_statfs.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/syscallargs.h>
|
||||
#include <compat/ibcs2/ibcs2_syscallargs.h>
|
||||
|
||||
; types:
|
||||
; STD always included
|
||||
; STD included on COMPAT #ifdef
|
||||
; LIBSTD included on COMPAT #ifdef, and placed in syscall.h
|
||||
; COMPAT included on COMPAT #ifdef
|
||||
; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h
|
||||
; OBSOL obsolete, not included in system, only specifies name
|
||||
; UNIMPL not implemented, placeholder only
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
|
||||
; #ifdef's, etc. may be included, and are copied to the output files.
|
||||
|
||||
0 NOARGS { int nosys(void); } syscall
|
||||
1 NOARGS { int exit(int rval); }
|
||||
2 NOARGS { int fork(void); }
|
||||
3 STD { int ibcs2_read(int fd, char *buf, u_int nbytes); }
|
||||
4 NOARGS { int write(int fd, char *buf, u_int nbytes); }
|
||||
5 STD { int ibcs2_open(char *path, int flags, int mode); }
|
||||
6 NOARGS { int close(int fd); }
|
||||
7 STD { int ibcs2_waitsys(int a1, int a2, int a3); }
|
||||
8 STD { int ibcs2_creat(char *path, int mode); }
|
||||
9 NOARGS { int link(char *path, char *link); }
|
||||
10 STD { int ibcs2_unlink(char *path); }
|
||||
11 STD { int ibcs2_execv(char *path, char **argp); }
|
||||
12 STD { int ibcs2_chdir(char *path); }
|
||||
13 STD { int ibcs2_time(ibcs2_time_t *tp); }
|
||||
14 STD { int ibcs2_mknod(char* path, int mode, int dev); }
|
||||
15 STD { int ibcs2_chmod(char *path, int mode); }
|
||||
16 STD { int ibcs2_chown(char *path, int uid, int gid); }
|
||||
17 NOARGS { int obreak(caddr_t nsize); }
|
||||
18 STD { int ibcs2_stat(char* path, struct ibcs2_stat *st); }
|
||||
19 NOARGS { long compat_43_lseek(int fd, long offset, \
|
||||
int whence); }
|
||||
20 NOARGS { pid_t getpid(void); }
|
||||
21 STD { int ibcs2_mount(char *special, char *dir, int flags, \
|
||||
0 NOPROTO NOHIDE { int nosys(void); } syscall nosys_args int
|
||||
1 NOPROTO NOHIDE { int exit(int rval); }
|
||||
2 NOPROTO POSIX { int fork(void); }
|
||||
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
|
||||
4 NOPROTO POSIX { int write(int fd, char *buf, u_int nbytes); }
|
||||
5 STD POSIX { int ibcs2_open(char *path, int flags, int mode); }
|
||||
6 NOPROTO POSIX { int close(int fd); }
|
||||
7 STD SVR3 { int ibcs2_wait(int a1, int a2, int a3); }
|
||||
8 STD SVR3 { int ibcs2_creat(char *path, int mode); }
|
||||
9 NOPROTO POSIX { int link(char *path, char *link); }
|
||||
10 STD POSIX { int ibcs2_unlink(char *path); }
|
||||
11 STD NOHIDE { int ibcs2_execv(char *path, char **argp); }
|
||||
12 STD POSIX { int ibcs2_chdir(char *path); }
|
||||
13 STD SVR3 { int ibcs2_time(ibcs2_time_t *tp); }
|
||||
14 STD SVR3 { int ibcs2_mknod(char* path, int mode, int dev); }
|
||||
15 STD SVR3 { int ibcs2_chmod(char *path, int mode); }
|
||||
16 STD SVR3 { int ibcs2_chown(char *path, int uid, int gid); }
|
||||
17 NOPROTO SVR3 { int obreak(caddr_t nsize); }
|
||||
18 STD SVR3 { int ibcs2_stat(char* path, struct ibcs2_stat *st); }
|
||||
19 STD POSIX { long ibcs2_lseek(int fd, long offset, int whence); }
|
||||
20 NOPROTO POSIX { pid_t getpid(void); }
|
||||
21 STD SVR3 { int ibcs2_mount(char *special, char *dir, int flags,\
|
||||
int fstype, char *data, int len); }
|
||||
22 STD { int ibcs2_umount(char *name); }
|
||||
23 STD { int ibcs2_setuid(int uid); }
|
||||
24 NOARGS { uid_t getuid(void); }
|
||||
25 STD { int ibcs2_stime(long *timep); }
|
||||
26 UNIMPL ibcs2_ptrace
|
||||
27 STD { int ibcs2_alarm(unsigned sec); }
|
||||
28 STD { int ibcs2_fstat(int fd, struct ibcs2_stat *st); }
|
||||
29 STD { int ibcs2_pause(void); }
|
||||
30 STD { int ibcs2_utime(char *path, \
|
||||
22 STD SVR3 { int ibcs2_umount(char *name); }
|
||||
23 STD POSIX { int ibcs2_setuid(int uid); }
|
||||
24 NOPROTO SVR3 { uid_t getuid(void); }
|
||||
25 STD SVR3 { int ibcs2_stime(long *timep); }
|
||||
26 NOPROTO SVR3 { int ptrace(int req, pid_t pid, caddr_t addr, \
|
||||
int data); }
|
||||
27 STD SVR3 { int ibcs2_alarm(unsigned sec); }
|
||||
28 STD SVR3 { int ibcs2_fstat(int fd, struct ibcs2_stat *st); }
|
||||
29 STD SVR3 { int ibcs2_pause(void); }
|
||||
30 STD SVR3 { int ibcs2_utime(char *path, \
|
||||
struct ibcs2_utimbuf *buf); }
|
||||
31 UNIMPL was stty
|
||||
32 UNIMPL was gtty
|
||||
33 STD { int ibcs2_access(char *path, int flags); }
|
||||
34 STD { int ibcs2_nice(int incr); }
|
||||
35 STD { int ibcs2_statfs(char *path, \
|
||||
31 STD SCO { int ibcs2_stty(int fd, struct sgttyb *buf); }
|
||||
32 STD SCO { int ibcs2_gtty(int fd, struct sgttyb *buf); }
|
||||
33 STD POSIX { int ibcs2_access(char *path, int flags); }
|
||||
34 STD SVR3 { int ibcs2_nice(int incr); }
|
||||
35 STD SVR3 { int ibcs2_statfs(char *path, \
|
||||
struct ibcs2_statfs *buf, \
|
||||
int len, int fstype); }
|
||||
36 NOARGS { int sync(void); }
|
||||
37 STD { int ibcs2_kill(int pid, int signo); }
|
||||
38 STD { int ibcs2_fstatfs(int fd, struct ibcs2_statfs *buf, \
|
||||
36 NOPROTO SVR3 { int sync(void); }
|
||||
37 STD POSIX { int ibcs2_kill(int pid, int signo); }
|
||||
38 STD SVR3 { int ibcs2_fstatfs(int fd, struct ibcs2_statfs *buf, \
|
||||
int len, int fstype); }
|
||||
39 STD { int ibcs2_pgrpsys(int type, caddr_t dummy, int pid, \
|
||||
39 STD SVR3 { int ibcs2_pgrpsys(int type, caddr_t dummy, int pid, \
|
||||
int pgid); }
|
||||
40 UNIMPL ibcs2_xenix
|
||||
41 NOARGS { int dup(u_int fd); }
|
||||
42 NOARGS { int pipe(void); }
|
||||
43 STD { int ibcs2_times(struct tms *tp); }
|
||||
44 UNIMPL profil
|
||||
45 STD { int ibcs2_plock(int cmd); }
|
||||
46 STD { int ibcs2_setgid(int gid); }
|
||||
47 NOARGS { gid_t getgid(void); }
|
||||
48 STD { int ibcs2_sigsys(int sig, ibcs2_sig_t fp); }
|
||||
40 STD SCO { int ibcs2_xenix(int a1, int a2, int a3, int a4, \
|
||||
int a5); }
|
||||
41 NOPROTO POSIX { int dup(u_int fd); }
|
||||
42 NOPROTO POSIX { int pipe(void); }
|
||||
43 STD SVR3 { int ibcs2_times(struct tms *tp); }
|
||||
44 NOPROTO SVR3 { int profil(caddr_t samples, u_int size, \
|
||||
u_int offset, u_int scale); }
|
||||
45 STD SVR3 { int ibcs2_plock(int cmd); }
|
||||
46 STD SVR3 { int ibcs2_setgid(int gid); }
|
||||
47 NOPROTO SVR3 { gid_t getgid(void); }
|
||||
48 STD SVR3 { int ibcs2_sigsys(int sig, ibcs2_sig_t fp); }
|
||||
#ifdef SYSVMSG
|
||||
49 STD { int ibcs2_msgsys(int which, int a2, int a3, int a4, \
|
||||
49 STD SVR3 { int ibcs2_msgsys(int which, int a2, int a3, int a4, \
|
||||
int a5, int a6); }
|
||||
#else
|
||||
49 UNIMPL nosys
|
||||
49 UNIMPL SVR3 nosys
|
||||
#endif
|
||||
50 UNIMPL ibcs2_sys3b
|
||||
51 UNIMPL ibcs2_acct
|
||||
50 STD SVR3 { int ibcs2_sysi86(int cmd, int *arg); }
|
||||
51 UNIMPL SVR3 ibcs2_acct
|
||||
#ifdef SYSVSHM
|
||||
52 STD { int ibcs2_shmsys(int which, int a2, int a3, int a4); }
|
||||
52 STD SVR3 { int ibcs2_shmsys(int which, int a2, int a3, int a4); }
|
||||
#else
|
||||
52 UNIMPL nosys
|
||||
52 UNIMPL SVR3 nosys
|
||||
#endif
|
||||
#ifdef SYSVSEM
|
||||
53 STD { int ibcs2_semsys(int which, int a2, int a3, int a4, \
|
||||
53 STD SVR3 { int ibcs2_semsys(int which, int a2, int a3, int a4, \
|
||||
int a5); }
|
||||
#else
|
||||
53 UNIMPL nosys
|
||||
53 UNIMPL SVR3 nosys
|
||||
#endif
|
||||
54 STD { int ibcs2_ioctl(int fd, int cmd, caddr_t data); }
|
||||
55 STD { int ibcs2_uadmin(int cmd, int func, caddr_t data); }
|
||||
56 UNIMPL nosys
|
||||
57 STD { int ibcs2_utssys(int a1, int a2, int flag); }
|
||||
58 UNIMPL nosys
|
||||
59 STD { int ibcs2_execve(char *path, char **argp, \
|
||||
54 STD SVR3 { int ibcs2_ioctl(int fd, int cmd, caddr_t data); }
|
||||
55 STD SVR3 { int ibcs2_uadmin(int cmd, int func, caddr_t data); }
|
||||
56 UNIMPL SVR3 nosys
|
||||
57 STD SVR3 { int ibcs2_utssys(int a1, int a2, int flag); }
|
||||
58 NOPROTO POSIX { int fsync(int fd); }
|
||||
59 STD SVR3 { int ibcs2_execve(char *path, char **argp, \
|
||||
char **envp); }
|
||||
60 NOARGS { int umask(int newmask); }
|
||||
61 NOARGS { int chroot(char *path); }
|
||||
62 STD { int ibcs2_fcntl(int fd, int cmd, char *arg); }
|
||||
63 STD { long ibcs2_ulimit(int cmd, int newlimit); }
|
||||
64 UNIMPL reserved for unix/pc
|
||||
65 UNIMPL reserved for unix/pc
|
||||
66 UNIMPL reserved for unix/pc
|
||||
67 UNIMPL reserved for unix/pc
|
||||
68 UNIMPL reserved for unix/pc
|
||||
69 UNIMPL reserved for unix/pc
|
||||
70 OBSOL rfs_advfs
|
||||
71 OBSOL rfs_unadvfs
|
||||
72 OBSOL rfs_rmount
|
||||
73 OBSOL rfs_rumount
|
||||
74 OBSOL rfs_rfstart
|
||||
75 OBSOL rfs_sigret
|
||||
76 OBSOL rfs_rdebug
|
||||
77 OBSOL rfs_rfstop
|
||||
78 UNIMPL rfs_rfsys
|
||||
79 STD { int ibcs2_rmdir(char *path); }
|
||||
80 STD { int ibcs2_mkdir(char *path, int mode); }
|
||||
81 STD { int ibcs2_getdents(int fd, char *buf, int nbytes); }
|
||||
82 UNIMPL nosys
|
||||
83 UNIMPL nosys
|
||||
84 STD { int ibcs2_sysfs(int cmd, caddr_t d1, char *buf); }
|
||||
85 STD { int ibcs2_getmsg(int fd, struct ibcs2_stropts *ctl, \
|
||||
60 NOPROTO SVR3 { int umask(int newmask); }
|
||||
61 NOPROTO SVR3 { int chroot(char *path); }
|
||||
62 STD SVR3 { int ibcs2_fcntl(int fd, int cmd, char *arg); }
|
||||
63 STD SVR3 { long ibcs2_ulimit(int cmd, int newlimit); }
|
||||
64 UNIMPL SVR3 reserved for unix/pc
|
||||
65 UNIMPL SVR3 reserved for unix/pc
|
||||
66 UNIMPL SVR3 reserved for unix/pc
|
||||
67 UNIMPL SVR3 reserved for unix/pc
|
||||
68 UNIMPL SVR3 reserved for unix/pc
|
||||
69 UNIMPL SVR3 reserved for unix/pc
|
||||
70 OBSOL SVR3 rfs_advfs
|
||||
71 OBSOL SVR3 rfs_unadvfs
|
||||
72 OBSOL SVR3 rfs_rmount
|
||||
73 OBSOL SVR3 rfs_rumount
|
||||
74 OBSOL SVR3 rfs_rfstart
|
||||
75 OBSOL SVR3 rfs_sigret
|
||||
76 OBSOL SVR3 rfs_rdebug
|
||||
77 OBSOL SVR3 rfs_rfstop
|
||||
78 UNIMPL SVR3 rfs_rfsys
|
||||
79 STD SVR3 { int ibcs2_rmdir(char *path); }
|
||||
80 STD SVR3 { int ibcs2_mkdir(char *path, int mode); }
|
||||
81 STD SVR3 { int ibcs2_getdents(int fd, char *buf, int nbytes); }
|
||||
82 UNIMPL SVR3 nosys
|
||||
83 UNIMPL SVR3 nosys
|
||||
84 STD SVR3 { int ibcs2_sysfs(int cmd, caddr_t d1, char *buf); }
|
||||
85 STD SVR3 { int ibcs2_getmsg(int fd, struct ibcs2_stropts *ctl, \
|
||||
struct ibcs2_stropts *dat, \
|
||||
int *flags); }
|
||||
86 STD { int ibcs2_putmsg(int fd, struct ibcs2_stropts *ctl, \
|
||||
86 STD SVR3 { int ibcs2_putmsg(int fd, struct ibcs2_stropts *ctl, \
|
||||
struct ibcs2_stropts *dat, \
|
||||
int flags); }
|
||||
87 STD { int ibcs2_poll(struct ibcs2_pollfd *fds, long nfds, \
|
||||
87 STD SVR3 { int ibcs2_poll(struct ibcs2_poll *fds, long nfds, \
|
||||
int timeout); }
|
||||
88 UNIMPL nosys
|
||||
89 UNIMPL nosys
|
||||
90 STD { int ibcs2_symlink(char *path, char *link); }
|
||||
91 STD { int ibcs2_lstat(char *path, struct ibcs2_stat *st); }
|
||||
92 STD { int ibcs2_readlink(char *path, char *buf, int count); }
|
||||
93 UNIMPL nosys
|
||||
94 UNIMPL nosys
|
||||
95 UNIMPL nosys
|
||||
96 UNIMPL nosys
|
||||
97 UNIMPL nosys
|
||||
98 UNIMPL nosys
|
||||
99 UNIMPL nosys
|
||||
100 UNIMPL nosys
|
||||
101 UNIMPL nosys
|
||||
102 UNIMPL nosys
|
||||
103 NOARGS { int sigreturn(struct sigcontext *sigcntxp); }
|
||||
104 UNIMPL nosys
|
||||
105 UNIMPL nosys
|
||||
106 UNIMPL nosys
|
||||
107 UNIMPL nosys
|
||||
108 UNIMPL nosys
|
||||
109 UNIMPL nosys
|
||||
110 UNIMPL nosys
|
||||
111 UNIMPL nosys
|
||||
112 UNIMPL nosys
|
||||
113 UNIMPL nosys
|
||||
114 UNIMPL nosys
|
||||
115 UNIMPL nosys
|
||||
116 UNIMPL nosys
|
||||
117 UNIMPL nosys
|
||||
118 UNIMPL nosys
|
||||
119 UNIMPL nosys
|
||||
120 UNIMPL nosys
|
||||
121 UNIMPL nosys
|
||||
122 UNIMPL nosys
|
||||
123 UNIMPL nosys
|
||||
124 UNIMPL nosys
|
||||
125 UNIMPL nosys
|
||||
126 UNIMPL nosys
|
||||
127 UNIMPL nosys
|
||||
128 UNIMPL nosys
|
||||
129 UNIMPL xenix_xlocking
|
||||
130 UNIMPL xenix_creatsem
|
||||
131 UNIMPL xenix_opensem
|
||||
132 UNIMPL xenix_sigsem
|
||||
133 UNIMPL xenix_waitsem
|
||||
134 UNIMPL xenix_nbwaitsem
|
||||
135 STD { int xenix_rdchk(int fd); }
|
||||
136 UNIMPL nosys
|
||||
137 UNIMPL nosys
|
||||
138 STD { int xenix_chsize(int fd, long size); }
|
||||
139 STD { int xenix_ftime(struct xenix_timeb *tp); }
|
||||
140 STD { int xenix_nap(int millisec); }
|
||||
141 UNIMPL xenix_sdget
|
||||
142 UNIMPL xenix_sdfree
|
||||
143 UNIMPL xenix_sdenter
|
||||
144 UNIMPL xenix_sdleave
|
||||
145 UNIMPL xenix_sdgetv
|
||||
146 UNIMPL xenix_sdwaitv
|
||||
147 UNIMPL nosys
|
||||
148 UNIMPL nosys
|
||||
149 UNIMPL nosys
|
||||
150 UNIMPL nosys
|
||||
151 UNIMPL nosys
|
||||
152 UNIMPL nosys
|
||||
153 UNIMPL nosys
|
||||
154 UNIMPL nosys
|
||||
155 UNIMPL nosys
|
||||
156 UNIMPL nosys
|
||||
157 UNIMPL nosys
|
||||
158 UNIMPL nosys
|
||||
159 UNIMPL nosys
|
||||
160 UNIMPL xenix_proctl
|
||||
161 UNIMPL xenix_execseg
|
||||
162 UNIMPL xenix_unexecseg
|
||||
163 UNIMPL nosys
|
||||
164 NOARGS { int select(u_int nd, fd_set *in, fd_set *ou, \
|
||||
fd_set *ex, struct timeval *tv); }
|
||||
165 UNIMPL xenix_eaccess
|
||||
166 UNIMPL xenix_paccess
|
||||
167 STD { int ibcs2_sigaction(int sig, \
|
||||
struct ibcs2_sigaction *act, \
|
||||
struct ibcs2_sigaction *oact); }
|
||||
168 STD { int ibcs2_sigprocmask(int how, ibcs2_sigset_t *set, \
|
||||
ibcs2_sigset_t *oset); }
|
||||
169 STD { int ibcs2_sigpending(ibcs2_sigset_t *mask); }
|
||||
170 STD { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); }
|
||||
171 STD { int ibcs2_getgroups(int gidsetsize, \
|
||||
ibcs2_gid_t *gidset); }
|
||||
172 STD { int ibcs2_setgroups(int gidsetsize, \
|
||||
ibcs2_gid_t *gidset); }
|
||||
173 STD { int ibcs2_sysconf(int name); }
|
||||
174 STD { int ibcs2_pathconf(char *path, int name); }
|
||||
175 STD { int ibcs2_fpathconf(int fd, int name); }
|
||||
176 STD { int ibcs2_rename(char *from, char *to); }
|
||||
88 UNIMPL SVR3 nosys
|
||||
89 STD SVR3 { int ibcs2_secure(int cmd, int a1, int a2, int a3, \
|
||||
int a4, int a5); }
|
||||
90 STD SVR3 { int ibcs2_symlink(char *path, char *link); }
|
||||
91 STD SVR3 { int ibcs2_lstat(char *path, struct ibcs2_stat *st); }
|
||||
92 STD SVR3 { int ibcs2_readlink(char *path, char *buf, int count); }
|
||||
93 UNIMPL NOHIDE nosys
|
||||
94 UNIMPL NOHIDE nosys
|
||||
95 UNIMPL NOHIDE nosys
|
||||
96 UNIMPL NOHIDE nosys
|
||||
97 UNIMPL NOHIDE nosys
|
||||
98 UNIMPL NOHIDE nosys
|
||||
99 UNIMPL NOHIDE nosys
|
||||
100 UNIMPL NOHIDE nosys
|
||||
101 UNIMPL NOHIDE nosys
|
||||
102 UNIMPL NOHIDE nosys
|
||||
103 NOPROTO POSIX { int sigreturn(struct sigcontext *sigcntxp); }
|
||||
104 UNIMPL NOHIDE nosys
|
||||
105 STD SCO { int ibcs2_isc(void); }
|
||||
106 UNIMPL NOHIDE nosys
|
||||
107 UNIMPL NOHIDE nosys
|
||||
108 UNIMPL NOHIDE nosys
|
||||
109 UNIMPL NOHIDE nosys
|
||||
110 UNIMPL NOHIDE nosys
|
||||
111 UNIMPL NOHIDE nosys
|
||||
112 UNIMPL NOHIDE nosys
|
||||
113 UNIMPL NOHIDE nosys
|
||||
114 UNIMPL NOHIDE nosys
|
||||
115 UNIMPL NOHIDE nosys
|
||||
116 UNIMPL NOHIDE nosys
|
||||
117 UNIMPL NOHIDE nosys
|
||||
118 UNIMPL NOHIDE nosys
|
||||
119 UNIMPL NOHIDE nosys
|
||||
120 UNIMPL NOHIDE nosys
|
||||
121 UNIMPL NOHIDE nosys
|
||||
122 UNIMPL NOHIDE nosys
|
||||
123 UNIMPL NOHIDE nosys
|
||||
124 UNIMPL NOHIDE nosys
|
||||
125 UNIMPL NOHIDE nosys
|
||||
126 UNIMPL NOHIDE nosys
|
||||
127 UNIMPL NOHIDE nosys
|
||||
|
|
75
sys/i386/ibcs2/syscalls.xenix
Normal file
75
sys/i386/ibcs2/syscalls.xenix
Normal file
|
@ -0,0 +1,75 @@
|
|||
$Id: syscalls.xenix,v 1.1 1995/10/06 15:12:52 swallace Exp $
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_statfs.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
|
||||
0 UNIMPL XENIX nosys
|
||||
1 UNIMPL XENIX xenix_xlocking
|
||||
2 UNIMPL XENIX xenix_creatsem
|
||||
3 UNIMPL XENIX xenix_opensem
|
||||
4 UNIMPL XENIX xenix_sigsem
|
||||
5 UNIMPL XENIX xenix_waitsem
|
||||
6 UNIMPL XENIX xenix_nbwaitsem
|
||||
7 STD XENIX { int xenix_rdchk(int fd); }
|
||||
8 UNIMPL XENIX nosys
|
||||
9 UNIMPL XENIX nosys
|
||||
10 STD XENIX { int xenix_chsize(int fd, long size); }
|
||||
11 STD XENIX { int xenix_ftime(struct timeb *tp); }
|
||||
12 STD XENIX { int xenix_nap(int millisec); }
|
||||
13 UNIMPL XENIX xenix_sdget
|
||||
14 UNIMPL XENIX xenix_sdfree
|
||||
15 UNIMPL XENIX xenix_sdenter
|
||||
16 UNIMPL XENIX xenix_sdleave
|
||||
17 UNIMPL XENIX xenix_sdgetv
|
||||
18 UNIMPL XENIX xenix_sdwaitv
|
||||
19 UNIMPL XENIX nosys
|
||||
20 UNIMPL XENIX nosys
|
||||
21 STD XENIX { int xenix_scoinfo(void); }
|
||||
22 UNIMPL XENIX nosys
|
||||
23 UNIMPL XENIX nosys
|
||||
24 UNIMPL XENIX nosys
|
||||
25 UNIMPL XENIX nosys
|
||||
26 UNIMPL XENIX nosys
|
||||
27 UNIMPL XENIX nosys
|
||||
28 UNIMPL XENIX nosys
|
||||
29 UNIMPL XENIX nosys
|
||||
30 UNIMPL XENIX nosys
|
||||
31 UNIMPL XENIX nosys
|
||||
32 UNIMPL XENIX xenix_proctl
|
||||
33 UNIMPL XENIX xenix_execseg
|
||||
34 UNIMPL XENIX xenix_unexecseg
|
||||
35 UNIMPL XENIX nosys
|
||||
36 NOPROTO XENIX { int select(u_int nd, fd_set *in, fd_set *ou, \
|
||||
fd_set *ex, struct timeval *tv); }
|
||||
37 UNIMPL XENIX xenix_eaccess
|
||||
38 UNIMPL XENIX xenix_paccess
|
||||
39 STD XENIX { int ibcs2_sigaction(int sig, \
|
||||
struct ibcs2_sigaction *act, \
|
||||
struct ibcs2_sigaction *oact); }
|
||||
40 STD XENIX { int ibcs2_sigprocmask(int how, ibcs2_sigset_t *set, \
|
||||
ibcs2_sigset_t *oset); }
|
||||
41 STD XENIX { int ibcs2_sigpending(ibcs2_sigset_t *mask); }
|
||||
42 STD XENIX { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); }
|
||||
43 STD XENIX { int ibcs2_getgroups(int gidsetsize, \
|
||||
ibcs2_gid_t *gidset); }
|
||||
44 STD XENIX { int ibcs2_setgroups(int gidsetsize, \
|
||||
ibcs2_gid_t *gidset); }
|
||||
45 STD XENIX { int ibcs2_sysconf(int name); }
|
||||
46 STD XENIX { int ibcs2_pathconf(char *path, int name); }
|
||||
47 STD XENIX { int ibcs2_fpathconf(int fd, int name); }
|
||||
48 STD XENIX { int ibcs2_rename(char *from, char *to); }
|
||||
49 UNIMPL XENIX nosys
|
||||
50 STD XENIX { int xenix_utsname(long addr); }
|
||||
51 UNIMPL XENIX nosys
|
||||
52 UNIMPL XENIX nosys
|
||||
53 UNIMPL XENIX nosys
|
||||
54 UNIMPL XENIX nosys
|
||||
55 NOPROTO XENIX { int getitimer(u_int which, struct itimerval *itv); }
|
||||
56 NOPROTO XENIX { int setitimer(u_int which, struct itimerval *itv, \
|
||||
struct itimerval *otv); }
|
11
sys/i386/ibcs2/syscalls.xenix.conf
Normal file
11
sys/i386/ibcs2/syscalls.xenix.conf
Normal file
|
@ -0,0 +1,11 @@
|
|||
# syscalls.conf $Id$
|
||||
sysnames="/dev/null"
|
||||
sysproto="ibcs2_xenix.h"
|
||||
sysproto_h=_IBCS2_XENIX_H_
|
||||
syshdr="ibcs2_xenix_syscall.h"
|
||||
syssw="ibcs2_xenix_sysent.c"
|
||||
syshide="/dev/null"
|
||||
syscallprefix="IBCS2_XENIX_"
|
||||
switchname="xenix_sysent"
|
||||
namesname="xenix_syscallnames"
|
||||
sysvec="\n"
|
Loading…
Reference in a new issue