Remove iBCS2, part3: the implementation
Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
c39e5a0486
commit
51d134d072
@ -1,27 +0,0 @@
|
||||
# Makefile for syscall tables
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
# Don't use an OBJDIR
|
||||
.OBJDIR: ${.CURDIR}
|
||||
|
||||
all:
|
||||
@echo "make sysent, isc_sysent or xenix_sysent only"
|
||||
|
||||
sysent: ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h
|
||||
|
||||
ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h: ../../kern/makesyscalls.sh \
|
||||
syscalls.master syscalls.conf
|
||||
sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf
|
||||
|
||||
isc_sysent: ibcs2_isc_sysent.c ibcs2_isc_syscall.h
|
||||
|
||||
ibcs2_isc_sysent.c ibcs2_isc_syscall.h : ../../kern/makesyscalls.sh \
|
||||
syscalls.isc syscalls.isc.conf
|
||||
sh ../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf
|
||||
|
||||
xenix_sysent: ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h
|
||||
|
||||
ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h: \
|
||||
../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf
|
||||
sh ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf
|
@ -1,108 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1994 Sean Eric Fagan
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _COFF_H
|
||||
#define _COFF_H
|
||||
|
||||
struct filehdr {
|
||||
unsigned short f_magic; /* magic number */
|
||||
unsigned short f_nscns; /* # of sections */
|
||||
long f_timdat; /* time stamp */
|
||||
long f_symptr; /* symbol table offset */
|
||||
long f_nsyms; /* # of symbols */
|
||||
unsigned short f_opthdr; /* size of system header */
|
||||
unsigned short f_flags; /* flags, see below */
|
||||
};
|
||||
|
||||
enum filehdr_flags {
|
||||
F_RELFLG = 0x01, /* relocs have been stripped */
|
||||
F_EXEC = 0x02, /* executable file (or shlib) */
|
||||
F_LNNO = 0x04, /* line numbers have been stripped */
|
||||
F_LSYMS = 0x08, /* symbols have been stripped */
|
||||
F_SWABD = 0x40, /* swabbed byte names */
|
||||
F_AR16WR = 0x80, /* 16-bit, byte reversed words */
|
||||
F_AR32WR = 0x100 /* 32-bit, byte reversed words */
|
||||
};
|
||||
|
||||
struct aouthdr {
|
||||
short magic; /* magic number -- see below */
|
||||
short vstamp; /* artifacts from a by-gone day */
|
||||
long tsize; /* */
|
||||
long dsize; /* */
|
||||
long bsize; /* */
|
||||
long entry; /* Entry point -- offset into file */
|
||||
long tstart; /* artifacts from a by-gone day */
|
||||
long dstart; /* */
|
||||
};
|
||||
|
||||
#define I386_COFF 0x14c
|
||||
|
||||
#define COFF_OMAGIC 0407 /* impure format */
|
||||
#define COFF_NMAGIC 0410 /* read-only text */
|
||||
#define COFF_ZMAGIC 0413 /* pagable from disk */
|
||||
#define COFF_SHLIB 0443 /* a shared library */
|
||||
|
||||
struct scnhdr {
|
||||
char s_name[8]; /* name of section (e.g., ".text") */
|
||||
long s_paddr; /* physical addr, used for standalone */
|
||||
long s_vaddr; /* virtual address */
|
||||
long s_size; /* size of section */
|
||||
long s_scnptr; /* file offset of section */
|
||||
long s_relptr; /* points to relocs for section */
|
||||
long s_lnnoptr; /* points to line numbers for section */
|
||||
unsigned short s_nreloc; /* # of relocs */
|
||||
unsigned short s_nlnno; /* # of line no's */
|
||||
long s_flags; /* section flags -- see below */
|
||||
};
|
||||
|
||||
enum scnhdr_flags {
|
||||
STYP_REG = 0x00, /* regular (alloc'ed, reloc'ed, loaded) */
|
||||
STYP_DSECT = 0x01, /* dummy (reloc'd) */
|
||||
STYP_NOLOAD = 0x02, /* no-load (reloc'd) */
|
||||
STYP_GROUP = 0x04, /* grouped */
|
||||
STYP_PAD = 0x08, /* padding (loaded) */
|
||||
STYP_COPY = 0x10, /* ??? */
|
||||
STYP_TEXT = 0x20, /* text */
|
||||
STYP_DATA = 0x40, /* data */
|
||||
STYP_BSS = 0x80, /* bss */
|
||||
STYP_INFO = 0x200, /* comment (!loaded, !alloc'ed, !reloc'd) */
|
||||
STYP_OVER = 0x400, /* overlay (!allocated, reloc'd, !loaded) */
|
||||
STYP_LIB = 0x800 /* lists shared library files */
|
||||
};
|
||||
|
||||
struct slhdr {
|
||||
long entry_length;
|
||||
long path_index;
|
||||
char *shlib_name;
|
||||
};
|
||||
#endif /* _COFF_H */
|
@ -1,60 +0,0 @@
|
||||
/* $NetBSD: ibcs2_dirent.h,v 1.2 1994/10/26 02:52:51 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _IBCS2_DIRENT_H
|
||||
#define _IBCS2_DIRENT_H 1
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define IBCS2_MAXNAMLEN 512
|
||||
#define IBCS2_DIRBUF 1048
|
||||
|
||||
typedef struct {
|
||||
int dd_fd;
|
||||
int dd_loc;
|
||||
int dd_size;
|
||||
char *dd_buf;
|
||||
} IBCS2_DIR;
|
||||
|
||||
struct ibcs2_dirent {
|
||||
ibcs2_ino_t d_ino;
|
||||
short d_pad;
|
||||
ibcs2_off_t d_off;
|
||||
u_short d_reclen;
|
||||
char d_name[1];
|
||||
};
|
||||
|
||||
#endif /* _IBCS2_DIRENT_H */
|
@ -1,129 +0,0 @@
|
||||
/*-
|
||||
* ibcs2_errno.c
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* 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.
|
||||
* 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 Scott Bartram.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/errno.h>
|
||||
#include <i386/ibcs2/ibcs2_errno.h>
|
||||
|
||||
int bsd_to_ibcs2_errno[ELAST + 1] = {
|
||||
0, /* 0 */
|
||||
IBCS2_EPERM, /* 1 */
|
||||
IBCS2_ENOENT, /* 2 */
|
||||
IBCS2_ESRCH, /* 3 */
|
||||
IBCS2_EINTR, /* 4 */
|
||||
IBCS2_EIO, /* 5 */
|
||||
IBCS2_ENXIO, /* 6 */
|
||||
IBCS2_E2BIG, /* 7 */
|
||||
IBCS2_ENOEXEC, /* 8 */
|
||||
IBCS2_EBADF, /* 9 */
|
||||
IBCS2_ECHILD, /* 10 */
|
||||
IBCS2_EDEADLK, /* 11 */
|
||||
IBCS2_ENOMEM, /* 12 */
|
||||
IBCS2_EACCES, /* 13 */
|
||||
IBCS2_EFAULT, /* 14 */
|
||||
IBCS2_ENOTBLK, /* 15 */
|
||||
IBCS2_EBUSY, /* 16 */
|
||||
IBCS2_EEXIST, /* 17 */
|
||||
IBCS2_EXDEV, /* 18 */
|
||||
IBCS2_ENODEV, /* 19 */
|
||||
IBCS2_ENOTDIR, /* 20 */
|
||||
IBCS2_EISDIR, /* 21 */
|
||||
IBCS2_EINVAL, /* 22 */
|
||||
IBCS2_ENFILE, /* 23 */
|
||||
IBCS2_EMFILE, /* 24 */
|
||||
IBCS2_ENOTTY, /* 25 */
|
||||
IBCS2_ETXTBSY, /* 26 */
|
||||
IBCS2_EFBIG, /* 27 */
|
||||
IBCS2_ENOSPC, /* 28 */
|
||||
IBCS2_ESPIPE, /* 29 */
|
||||
IBCS2_EROFS, /* 30 */
|
||||
IBCS2_EMLINK, /* 31 */
|
||||
IBCS2_EPIPE, /* 32 */
|
||||
IBCS2_EDOM, /* 33 */
|
||||
IBCS2_ERANGE, /* 34 */
|
||||
IBCS2_EAGAIN, /* 35 */
|
||||
IBCS2_EINPROGRESS, /* 36 */
|
||||
IBCS2_EALREADY, /* 37 */
|
||||
IBCS2_ENOTSOCK, /* 38 */
|
||||
IBCS2_EDESTADDRREQ, /* 39 */
|
||||
IBCS2_EMSGSIZE, /* 40 */
|
||||
IBCS2_EPROTOTYPE, /* 41 */
|
||||
IBCS2_ENOPROTOOPT, /* 42 */
|
||||
IBCS2_EPROTONOSUPPORT, /* 43 */
|
||||
IBCS2_ESOCKTNOSUPPORT, /* 44 */
|
||||
IBCS2_EOPNOTSUPP, /* 45 */
|
||||
IBCS2_EPFNOSUPPORT, /* 46 */
|
||||
IBCS2_EAFNOSUPPORT, /* 47 */
|
||||
IBCS2_EADDRINUSE, /* 48 */
|
||||
IBCS2_EADDRNOTAVAIL, /* 49 */
|
||||
IBCS2_ENETDOWN, /* 50 */
|
||||
IBCS2_ENETUNREACH, /* 51 */
|
||||
IBCS2_ENETRESET, /* 52 */
|
||||
IBCS2_ECONNABORTED, /* 53 */
|
||||
IBCS2_ECONNRESET, /* 54 */
|
||||
IBCS2_ENOBUFS, /* 55 */
|
||||
IBCS2_EISCONN, /* 56 */
|
||||
IBCS2_ENOTCONN, /* 57 */
|
||||
IBCS2_ESHUTDOWN, /* 58 */
|
||||
IBCS2_ETOOMANYREFS, /* 59 */
|
||||
IBCS2_ETIMEDOUT, /* 60 */
|
||||
IBCS2_ECONNREFUSED, /* 61 */
|
||||
IBCS2_ELOOP, /* 62 */
|
||||
IBCS2_ENAMETOOLONG, /* 63 */
|
||||
IBCS2_EHOSTDOWN, /* 64 */
|
||||
IBCS2_EHOSTUNREACH, /* 65 */
|
||||
IBCS2_ENOTEMPTY, /* 66 */
|
||||
0, /* 67 */
|
||||
0, /* 68 */
|
||||
0, /* 69 */
|
||||
IBCS2_ESTALE, /* 70 */
|
||||
IBCS2_EREMOTE, /* 71 */
|
||||
0, /* 72 */
|
||||
0, /* 73 */
|
||||
0, /* 74 */
|
||||
0, /* 75 */
|
||||
0, /* 76 */
|
||||
IBCS2_ENOLCK, /* 77 */
|
||||
IBCS2_ENOSYS, /* 78 */
|
||||
0, /* 79 */
|
||||
0, /* 80 */
|
||||
0, /* 81 */
|
||||
IBCS2_EIDRM, /* 82 */
|
||||
IBCS2_ENOMSG, /* 83 */
|
||||
IBCS2_EOVERFLOW, /* 84 */
|
||||
0, /* 85 */
|
||||
IBCS2_EILSEQ, /* 86 */
|
||||
};
|
||||
|
@ -1,157 +0,0 @@
|
||||
/*-
|
||||
* ibcs2_errno.h
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* 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.
|
||||
* 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 Scott Bartram.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_ERRNO_H
|
||||
#define _IBCS2_ERRNO_H
|
||||
|
||||
#define _SCO_NET 1
|
||||
|
||||
#define IBCS2_EPERM 1
|
||||
#define IBCS2_ENOENT 2
|
||||
#define IBCS2_ESRCH 3
|
||||
#define IBCS2_EINTR 4
|
||||
#define IBCS2_EIO 5
|
||||
#define IBCS2_ENXIO 6
|
||||
#define IBCS2_E2BIG 7
|
||||
#define IBCS2_ENOEXEC 8
|
||||
#define IBCS2_EBADF 9
|
||||
#define IBCS2_ECHILD 10
|
||||
#define IBCS2_EAGAIN 11
|
||||
#define IBCS2_ENOMEM 12
|
||||
#define IBCS2_EACCES 13
|
||||
#define IBCS2_EFAULT 14
|
||||
#define IBCS2_ENOTBLK 15
|
||||
#define IBCS2_EBUSY 16
|
||||
#define IBCS2_EEXIST 17
|
||||
#define IBCS2_EXDEV 18
|
||||
#define IBCS2_ENODEV 19
|
||||
#define IBCS2_ENOTDIR 20
|
||||
#define IBCS2_EISDIR 21
|
||||
#define IBCS2_EINVAL 22
|
||||
#define IBCS2_ENFILE 23
|
||||
#define IBCS2_EMFILE 24
|
||||
#define IBCS2_ENOTTY 25
|
||||
#define IBCS2_ETXTBSY 26
|
||||
#define IBCS2_EFBIG 27
|
||||
#define IBCS2_ENOSPC 28
|
||||
#define IBCS2_ESPIPE 29
|
||||
#define IBCS2_EROFS 30
|
||||
#define IBCS2_EMLINK 31
|
||||
#define IBCS2_EPIPE 32
|
||||
#define IBCS2_EDOM 33
|
||||
#define IBCS2_ERANGE 34
|
||||
#define IBCS2_ENOMSG 35
|
||||
#define IBCS2_EIDRM 36
|
||||
#define IBCS2_ECHRNG 37
|
||||
#define IBCS2_EL2NSYNC 38
|
||||
#define IBCS2_EL3HLT 39
|
||||
#define IBCS2_EL3RST 40
|
||||
#define IBCS2_ELNRNG 41
|
||||
#define IBCS2_EUNATCH 42
|
||||
#define IBCS2_ENOCSI 43
|
||||
#define IBCS2_EL2HLT 44
|
||||
#define IBCS2_EDEADLK 45
|
||||
#define IBCS2_ENOLCK 46
|
||||
#define IBCS2_ENOSTR 60
|
||||
#define IBCS2_ENODATA 61
|
||||
#define IBCS2_ETIME 62
|
||||
#define IBCS2_ENOSR 63
|
||||
#define IBCS2_ENONET 64
|
||||
#define IBCS2_ENOPKG 65
|
||||
#define IBCS2_EREMOTE 66
|
||||
#define IBCS2_ENOLINK 67
|
||||
#define IBCS2_EADV 68
|
||||
#define IBCS2_ESRMNT 69
|
||||
#define IBCS2_ECOMM 70
|
||||
#define IBCS2_EPROTO 71
|
||||
#define IBCS2_EMULTIHOP 74
|
||||
#define IBCS2_ELBIN 75
|
||||
#define IBCS2_EDOTDOT 76
|
||||
#define IBCS2_EBADMSG 77
|
||||
#define IBCS2_ENAMETOOLONG 78
|
||||
#define IBCS2_EOVERFLOW 79
|
||||
#define IBCS2_ENOTUNIQ 80
|
||||
#define IBCS2_EBADFD 81
|
||||
#define IBCS2_EREMCHG 82
|
||||
#define IBCS2_EILSEQ 88
|
||||
#define IBCS2_ENOSYS 89
|
||||
|
||||
#if defined(_SCO_NET) /* not strict iBCS2 */
|
||||
#define IBCS2_EWOULDBLOCK 90
|
||||
#define IBCS2_EINPROGRESS 91
|
||||
#define IBCS2_EALREADY 92
|
||||
#define IBCS2_ENOTSOCK 93
|
||||
#define IBCS2_EDESTADDRREQ 94
|
||||
#define IBCS2_EMSGSIZE 95
|
||||
#define IBCS2_EPROTOTYPE 96
|
||||
#define IBCS2_EPROTONOSUPPORT 97
|
||||
#define IBCS2_ESOCKTNOSUPPORT 98
|
||||
#define IBCS2_EOPNOTSUPP 99
|
||||
#define IBCS2_EPFNOSUPPORT 100
|
||||
#define IBCS2_EAFNOSUPPORT 101
|
||||
#define IBCS2_EADDRINUSE 102
|
||||
#define IBCS2_EADDRNOTAVAIL 103
|
||||
#define IBCS2_ENETDOWN 104
|
||||
#define IBCS2_ENETUNREACH 105
|
||||
#define IBCS2_ENETRESET 106
|
||||
#define IBCS2_ECONNABORTED 107
|
||||
#define IBCS2_ECONNRESET 108
|
||||
#define IBCS2_ENOBUFS IBCS2_ENOSR
|
||||
#define IBCS2_EISCONN 110
|
||||
#define IBCS2_ENOTCONN 111
|
||||
#define IBCS2_ESHUTDOWN 112
|
||||
#define IBCS2_ETOOMANYREFS 113
|
||||
#define IBCS2_ETIMEDOUT 114
|
||||
#define IBCS2_ECONNREFUSED 115
|
||||
#define IBCS2_EHOSTDOWN 116
|
||||
#define IBCS2_EHOSTUNREACH 117
|
||||
#define IBCS2_ENOPROTOOPT 118
|
||||
#define IBCS2_ENOTEMPTY 145
|
||||
#define IBCS2_ELOOP 150
|
||||
#else
|
||||
#define IBCS2_ELOOP 90
|
||||
#define IBCS2_EWOULDBLOCK 90
|
||||
#define IBCS2_ERESTART 91
|
||||
#define IBCS2_ESTRPIPE 92
|
||||
#define IBCS2_ENOTEMPTY 93
|
||||
#define IBCS2_EUSERS 94
|
||||
#endif
|
||||
|
||||
#define IBCS2_ESTALE 151
|
||||
#define IBCS2_EIORESID 500
|
||||
|
||||
extern int bsd2ibcs_errno[];
|
||||
|
||||
#endif /* _IBCS2_ERRNO_H */
|
@ -1,319 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* 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.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_spx_hack.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/capsicum.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/ttycom.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(struct ibcs2_flock *, struct flock *);
|
||||
static void cvt_flock2iflock(struct flock *, struct ibcs2_flock *);
|
||||
static int cvt_o_flags(int);
|
||||
static int oflags2ioflags(int);
|
||||
static int ioflags2oflags(int);
|
||||
|
||||
static int
|
||||
cvt_o_flags(flags)
|
||||
int flags;
|
||||
{
|
||||
int r = 0;
|
||||
|
||||
/* 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_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 /* | 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;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_flock2iflock(flp, iflp)
|
||||
struct flock *flp;
|
||||
struct ibcs2_flock *iflp;
|
||||
{
|
||||
switch (flp->l_type) {
|
||||
case F_RDLCK:
|
||||
iflp->l_type = IBCS2_F_RDLCK;
|
||||
break;
|
||||
case F_WRLCK:
|
||||
iflp->l_type = IBCS2_F_WRLCK;
|
||||
break;
|
||||
case F_UNLCK:
|
||||
iflp->l_type = IBCS2_F_UNLCK;
|
||||
break;
|
||||
}
|
||||
iflp->l_whence = (short)flp->l_whence;
|
||||
iflp->l_start = (ibcs2_off_t)flp->l_start;
|
||||
iflp->l_len = (ibcs2_off_t)flp->l_len;
|
||||
iflp->l_sysid = flp->l_sysid;
|
||||
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;
|
||||
struct flock *flp;
|
||||
{
|
||||
flp->l_start = (off_t)iflp->l_start;
|
||||
flp->l_len = (off_t)iflp->l_len;
|
||||
flp->l_pid = (pid_t)iflp->l_pid;
|
||||
switch (iflp->l_type) {
|
||||
case IBCS2_F_RDLCK:
|
||||
flp->l_type = F_RDLCK;
|
||||
break;
|
||||
case IBCS2_F_WRLCK:
|
||||
flp->l_type = F_WRLCK;
|
||||
break;
|
||||
case IBCS2_F_UNLCK:
|
||||
flp->l_type = F_UNLCK;
|
||||
break;
|
||||
}
|
||||
flp->l_whence = iflp->l_whence;
|
||||
flp->l_sysid = iflp->l_sysid;
|
||||
}
|
||||
|
||||
/* convert iBCS2 mode into NetBSD mode */
|
||||
static int
|
||||
ioflags2oflags(flags)
|
||||
int flags;
|
||||
{
|
||||
int r = 0;
|
||||
|
||||
if (flags & IBCS2_O_RDONLY) r |= O_RDONLY;
|
||||
if (flags & IBCS2_O_WRONLY) r |= O_WRONLY;
|
||||
if (flags & IBCS2_O_RDWR) r |= O_RDWR;
|
||||
if (flags & IBCS2_O_NDELAY) r |= O_NONBLOCK;
|
||||
if (flags & IBCS2_O_APPEND) r |= O_APPEND;
|
||||
if (flags & IBCS2_O_SYNC) r |= O_FSYNC;
|
||||
if (flags & IBCS2_O_NONBLOCK) r |= O_NONBLOCK;
|
||||
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_NOCTTY) r |= O_NOCTTY;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* convert NetBSD mode into iBCS2 mode */
|
||||
static int
|
||||
oflags2ioflags(flags)
|
||||
int flags;
|
||||
{
|
||||
int r = 0;
|
||||
|
||||
if (flags & O_RDONLY) r |= IBCS2_O_RDONLY;
|
||||
if (flags & O_WRONLY) r |= IBCS2_O_WRONLY;
|
||||
if (flags & O_RDWR) r |= IBCS2_O_RDWR;
|
||||
if (flags & O_NDELAY) r |= IBCS2_O_NONBLOCK;
|
||||
if (flags & O_APPEND) r |= IBCS2_O_APPEND;
|
||||
if (flags & O_FSYNC) r |= IBCS2_O_SYNC;
|
||||
if (flags & O_NONBLOCK) r |= IBCS2_O_NONBLOCK;
|
||||
if (flags & O_CREAT) r |= IBCS2_O_CREAT;
|
||||
if (flags & O_TRUNC) r |= IBCS2_O_TRUNC;
|
||||
if (flags & O_EXCL) r |= IBCS2_O_EXCL;
|
||||
if (flags & O_NOCTTY) r |= IBCS2_O_NOCTTY;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_open(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_open_args *uap;
|
||||
{
|
||||
struct proc *p;
|
||||
char *path;
|
||||
int flags, noctty, ret;
|
||||
|
||||
p = td->td_proc;
|
||||
noctty = uap->flags & IBCS2_O_NOCTTY;
|
||||
flags = cvt_o_flags(uap->flags);
|
||||
if (uap->flags & O_CREAT)
|
||||
CHECKALTCREAT(td, uap->path, &path);
|
||||
else
|
||||
CHECKALTEXIST(td, uap->path, &path);
|
||||
ret = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, flags, uap->mode);
|
||||
|
||||
#ifdef SPX_HACK
|
||||
if (ret == ENXIO) {
|
||||
if (!strcmp(path, "/compat/ibcs2/dev/spx"))
|
||||
ret = spx_open(td);
|
||||
free(path, M_TEMP);
|
||||
} else
|
||||
#endif /* SPX_HACK */
|
||||
free(path, M_TEMP);
|
||||
PROC_LOCK(p);
|
||||
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
|
||||
cap_rights_t rights;
|
||||
struct file *fp;
|
||||
int error;
|
||||
|
||||
error = fget(td, td->td_retval[0],
|
||||
cap_rights_init(&rights, CAP_IOCTL), &fp);
|
||||
PROC_UNLOCK(p);
|
||||
if (error)
|
||||
return (EBADF);
|
||||
|
||||
/* ignore any error, just give it a try */
|
||||
if (fp->f_type == DTYPE_VNODE)
|
||||
fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td->td_ucred,
|
||||
td);
|
||||
fdrop(fp, td);
|
||||
} else
|
||||
PROC_UNLOCK(p);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_creat(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_creat_args *uap;
|
||||
{
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
CHECKALTCREAT(td, uap->path, &path);
|
||||
error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE,
|
||||
O_WRONLY | O_CREAT | O_TRUNC, uap->mode);
|
||||
free(path, M_TEMP);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_access(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_access_args *uap;
|
||||
{
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
CHECKALTEXIST(td, uap->path, &path);
|
||||
error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0, uap->amode);
|
||||
free(path, M_TEMP);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_fcntl(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_fcntl_args *uap;
|
||||
{
|
||||
intptr_t arg;
|
||||
int error;
|
||||
struct flock fl;
|
||||
struct ibcs2_flock ifl;
|
||||
|
||||
arg = (intptr_t)uap->arg;
|
||||
switch(uap->cmd) {
|
||||
case IBCS2_F_DUPFD:
|
||||
return (kern_fcntl(td, uap->fd, F_DUPFD, arg));
|
||||
case IBCS2_F_GETFD:
|
||||
return (kern_fcntl(td, uap->fd, F_GETFD, arg));
|
||||
case IBCS2_F_SETFD:
|
||||
return (kern_fcntl(td, uap->fd, F_SETFD, arg));
|
||||
case IBCS2_F_GETFL:
|
||||
error = kern_fcntl(td, uap->fd, F_GETFL, arg);
|
||||
if (error)
|
||||
return error;
|
||||
td->td_retval[0] = oflags2ioflags(td->td_retval[0]);
|
||||
return error;
|
||||
case IBCS2_F_SETFL:
|
||||
return (kern_fcntl(td, uap->fd, F_SETFL,
|
||||
ioflags2oflags(arg)));
|
||||
|
||||
case IBCS2_F_GETLK:
|
||||
{
|
||||
error = copyin((caddr_t)uap->arg, (caddr_t)&ifl,
|
||||
ibcs2_flock_len);
|
||||
if (error)
|
||||
return error;
|
||||
cvt_iflock2flock(&ifl, &fl);
|
||||
error = kern_fcntl(td, uap->fd, F_GETLK, (intptr_t)&fl);
|
||||
if (error)
|
||||
return error;
|
||||
cvt_flock2iflock(&fl, &ifl);
|
||||
return copyout((caddr_t)&ifl, (caddr_t)uap->arg,
|
||||
ibcs2_flock_len);
|
||||
}
|
||||
|
||||
case IBCS2_F_SETLK:
|
||||
{
|
||||
error = copyin((caddr_t)uap->arg, (caddr_t)&ifl,
|
||||
ibcs2_flock_len);
|
||||
if (error)
|
||||
return error;
|
||||
cvt_iflock2flock(&ifl, &fl);
|
||||
return (kern_fcntl(td, uap->fd, F_SETLK, (intptr_t)&fl));
|
||||
}
|
||||
|
||||
case IBCS2_F_SETLKW:
|
||||
{
|
||||
error = copyin((caddr_t)uap->arg, (caddr_t)&ifl,
|
||||
ibcs2_flock_len);
|
||||
if (error)
|
||||
return error;
|
||||
cvt_iflock2flock(&ifl, &fl);
|
||||
return (kern_fcntl(td, uap->fd, F_SETLKW, (intptr_t)&fl));
|
||||
}
|
||||
}
|
||||
return ENOSYS;
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
/* $NetBSD: ibcs2_fcntl.h,v 1.2 1994/10/26 02:52:54 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_FCNTL_H
|
||||
#define _IBCS2_FCNTL_H 1
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define IBCS2_O_RDONLY 0x0000
|
||||
#define IBCS2_O_WRONLY 0x0001
|
||||
#define IBCS2_O_RDWR 0x0002
|
||||
#define IBCS2_O_NDELAY 0x0004
|
||||
#define IBCS2_O_APPEND 0x0008
|
||||
#define IBCS2_O_SYNC 0x0010
|
||||
#define IBCS2_O_NONBLOCK 0x0080
|
||||
#define IBCS2_O_CREAT 0x0100
|
||||
#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
|
||||
#define IBCS2_F_SETFD 2
|
||||
#define IBCS2_F_GETFL 3
|
||||
#define IBCS2_F_SETFL 4
|
||||
#define IBCS2_F_GETLK 5
|
||||
#define IBCS2_F_SETLK 6
|
||||
#define IBCS2_F_SETLKW 7
|
||||
|
||||
struct ibcs2_flock {
|
||||
short l_type;
|
||||
short l_whence;
|
||||
ibcs2_off_t l_start;
|
||||
ibcs2_off_t l_len;
|
||||
short l_sysid;
|
||||
ibcs2_pid_t l_pid;
|
||||
};
|
||||
#define ibcs2_flock_len (sizeof(struct ibcs2_flock))
|
||||
|
||||
#define IBCS2_F_RDLCK 1
|
||||
#define IBCS2_F_WRLCK 2
|
||||
#define IBCS2_F_UNLCK 3
|
||||
|
||||
#define IBCS2_O_ACCMODE 3
|
||||
#define IBCS2_FD_CLOEXEC 1
|
||||
|
||||
#endif /* _IBCS2_FCNTL_H */
|
@ -1,691 +0,0 @@
|
||||
/* $NetBSD: ibcs2_ioctl.c,v 1.6 1995/03/14 15:12:28 scottb Exp $ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 1994, 1995 Scott Bartram
|
||||
* All rights reserved.
|
||||
*
|
||||
* based on compat/sunos/sun_ioctl.c
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/capsicum.h>
|
||||
#include <sys/consio.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/filio.h>
|
||||
#include <sys/kbio.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/tty.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_socksys.h>
|
||||
#include <i386/ibcs2/ibcs2_stropts.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_termios.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
#include <i386/ibcs2/ibcs2_ioctl.h>
|
||||
|
||||
static void stios2btios(struct ibcs2_termios *, struct termios *);
|
||||
static void btios2stios(struct termios *, struct ibcs2_termios *);
|
||||
static void stios2stio(struct ibcs2_termios *, struct ibcs2_termio *);
|
||||
static void stio2stios(struct ibcs2_termio *, struct ibcs2_termios *);
|
||||
|
||||
/*
|
||||
* iBCS2 ioctl calls.
|
||||
*/
|
||||
|
||||
struct speedtab {
|
||||
int sp_speed; /* Speed. */
|
||||
int sp_code; /* Code. */
|
||||
};
|
||||
|
||||
static struct speedtab sptab[] = {
|
||||
{ 0, 0 },
|
||||
{ 50, 1 },
|
||||
{ 75, 2 },
|
||||
{ 110, 3 },
|
||||
{ 134, 4 },
|
||||
{ 135, 4 },
|
||||
{ 150, 5 },
|
||||
{ 200, 6 },
|
||||
{ 300, 7 },
|
||||
{ 600, 8 },
|
||||
{ 1200, 9 },
|
||||
{ 1800, 10 },
|
||||
{ 2400, 11 },
|
||||
{ 4800, 12 },
|
||||
{ 9600, 13 },
|
||||
{ 19200, 14 },
|
||||
{ 38400, 15 },
|
||||
{ -1, -1 }
|
||||
};
|
||||
|
||||
static u_long s2btab[] = {
|
||||
0,
|
||||
50,
|
||||
75,
|
||||
110,
|
||||
134,
|
||||
150,
|
||||
200,
|
||||
300,
|
||||
600,
|
||||
1200,
|
||||
1800,
|
||||
2400,
|
||||
4800,
|
||||
9600,
|
||||
19200,
|
||||
38400,
|
||||
};
|
||||
|
||||
static int
|
||||
ttspeedtab(int speed, struct speedtab *table)
|
||||
{
|
||||
|
||||
for ( ; table->sp_speed != -1; table++)
|
||||
if (table->sp_speed == speed)
|
||||
return (table->sp_code);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
static void
|
||||
stios2btios(st, bt)
|
||||
struct ibcs2_termios *st;
|
||||
struct termios *bt;
|
||||
{
|
||||
register u_long l, r;
|
||||
|
||||
l = st->c_iflag; r = 0;
|
||||
if (l & IBCS2_IGNBRK) r |= IGNBRK;
|
||||
if (l & IBCS2_BRKINT) r |= BRKINT;
|
||||
if (l & IBCS2_IGNPAR) r |= IGNPAR;
|
||||
if (l & IBCS2_PARMRK) r |= PARMRK;
|
||||
if (l & IBCS2_INPCK) r |= INPCK;
|
||||
if (l & IBCS2_ISTRIP) r |= ISTRIP;
|
||||
if (l & IBCS2_INLCR) r |= INLCR;
|
||||
if (l & IBCS2_IGNCR) r |= IGNCR;
|
||||
if (l & IBCS2_ICRNL) r |= ICRNL;
|
||||
if (l & IBCS2_IXON) r |= IXON;
|
||||
if (l & IBCS2_IXANY) r |= IXANY;
|
||||
if (l & IBCS2_IXOFF) r |= IXOFF;
|
||||
if (l & IBCS2_IMAXBEL) r |= IMAXBEL;
|
||||
bt->c_iflag = r;
|
||||
|
||||
l = st->c_oflag; r = 0;
|
||||
if (l & IBCS2_OPOST) r |= OPOST;
|
||||
if (l & IBCS2_ONLCR) r |= ONLCR;
|
||||
if (l & IBCS2_TAB3) r |= TAB3;
|
||||
bt->c_oflag = r;
|
||||
|
||||
l = st->c_cflag; r = 0;
|
||||
switch (l & IBCS2_CSIZE) {
|
||||
case IBCS2_CS5: r |= CS5; break;
|
||||
case IBCS2_CS6: r |= CS6; break;
|
||||
case IBCS2_CS7: r |= CS7; break;
|
||||
case IBCS2_CS8: r |= CS8; break;
|
||||
}
|
||||
if (l & IBCS2_CSTOPB) r |= CSTOPB;
|
||||
if (l & IBCS2_CREAD) r |= CREAD;
|
||||
if (l & IBCS2_PARENB) r |= PARENB;
|
||||
if (l & IBCS2_PARODD) r |= PARODD;
|
||||
if (l & IBCS2_HUPCL) r |= HUPCL;
|
||||
if (l & IBCS2_CLOCAL) r |= CLOCAL;
|
||||
bt->c_cflag = r;
|
||||
|
||||
bt->c_ispeed = bt->c_ospeed = s2btab[l & 0x0000000f];
|
||||
|
||||
l = st->c_lflag; r = 0;
|
||||
if (l & IBCS2_ISIG) r |= ISIG;
|
||||
if (l & IBCS2_ICANON) r |= ICANON;
|
||||
if (l & IBCS2_ECHO) r |= ECHO;
|
||||
if (l & IBCS2_ECHOE) r |= ECHOE;
|
||||
if (l & IBCS2_ECHOK) r |= ECHOK;
|
||||
if (l & IBCS2_ECHONL) r |= ECHONL;
|
||||
if (l & IBCS2_NOFLSH) r |= NOFLSH;
|
||||
if (l & IBCS2_TOSTOP) r |= TOSTOP;
|
||||
bt->c_lflag = r;
|
||||
|
||||
bt->c_cc[VINTR] =
|
||||
st->c_cc[IBCS2_VINTR] ? st->c_cc[IBCS2_VINTR] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VQUIT] =
|
||||
st->c_cc[IBCS2_VQUIT] ? st->c_cc[IBCS2_VQUIT] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VERASE] =
|
||||
st->c_cc[IBCS2_VERASE] ? st->c_cc[IBCS2_VERASE] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VKILL] =
|
||||
st->c_cc[IBCS2_VKILL] ? st->c_cc[IBCS2_VKILL] : _POSIX_VDISABLE;
|
||||
if (bt->c_lflag & ICANON) {
|
||||
bt->c_cc[VEOF] =
|
||||
st->c_cc[IBCS2_VEOF] ? st->c_cc[IBCS2_VEOF] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VEOL] =
|
||||
st->c_cc[IBCS2_VEOL] ? st->c_cc[IBCS2_VEOL] : _POSIX_VDISABLE;
|
||||
} else {
|
||||
bt->c_cc[VMIN] = st->c_cc[IBCS2_VMIN];
|
||||
bt->c_cc[VTIME] = st->c_cc[IBCS2_VTIME];
|
||||
}
|
||||
bt->c_cc[VEOL2] =
|
||||
st->c_cc[IBCS2_VEOL2] ? st->c_cc[IBCS2_VEOL2] : _POSIX_VDISABLE;
|
||||
#if 0
|
||||
bt->c_cc[VSWTCH] =
|
||||
st->c_cc[IBCS2_VSWTCH] ? st->c_cc[IBCS2_VSWTCH] : _POSIX_VDISABLE;
|
||||
#endif
|
||||
bt->c_cc[VSTART] =
|
||||
st->c_cc[IBCS2_VSTART] ? st->c_cc[IBCS2_VSTART] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VSTOP] =
|
||||
st->c_cc[IBCS2_VSTOP] ? st->c_cc[IBCS2_VSTOP] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VSUSP] =
|
||||
st->c_cc[IBCS2_VSUSP] ? st->c_cc[IBCS2_VSUSP] : _POSIX_VDISABLE;
|
||||
bt->c_cc[VDSUSP] = _POSIX_VDISABLE;
|
||||
bt->c_cc[VREPRINT] = _POSIX_VDISABLE;
|
||||
bt->c_cc[VDISCARD] = _POSIX_VDISABLE;
|
||||
bt->c_cc[VWERASE] = _POSIX_VDISABLE;
|
||||
bt->c_cc[VLNEXT] = _POSIX_VDISABLE;
|
||||
bt->c_cc[VSTATUS] = _POSIX_VDISABLE;
|
||||
}
|
||||
|
||||
static void
|
||||
btios2stios(bt, st)
|
||||
struct termios *bt;
|
||||
struct ibcs2_termios *st;
|
||||
{
|
||||
register u_long l, r;
|
||||
|
||||
l = bt->c_iflag; r = 0;
|
||||
if (l & IGNBRK) r |= IBCS2_IGNBRK;
|
||||
if (l & BRKINT) r |= IBCS2_BRKINT;
|
||||
if (l & IGNPAR) r |= IBCS2_IGNPAR;
|
||||
if (l & PARMRK) r |= IBCS2_PARMRK;
|
||||
if (l & INPCK) r |= IBCS2_INPCK;
|
||||
if (l & ISTRIP) r |= IBCS2_ISTRIP;
|
||||
if (l & INLCR) r |= IBCS2_INLCR;
|
||||
if (l & IGNCR) r |= IBCS2_IGNCR;
|
||||
if (l & ICRNL) r |= IBCS2_ICRNL;
|
||||
if (l & IXON) r |= IBCS2_IXON;
|
||||
if (l & IXANY) r |= IBCS2_IXANY;
|
||||
if (l & IXOFF) r |= IBCS2_IXOFF;
|
||||
if (l & IMAXBEL) r |= IBCS2_IMAXBEL;
|
||||
st->c_iflag = r;
|
||||
|
||||
l = bt->c_oflag; r = 0;
|
||||
if (l & OPOST) r |= IBCS2_OPOST;
|
||||
if (l & ONLCR) r |= IBCS2_ONLCR;
|
||||
if (l & TAB3) r |= IBCS2_TAB3;
|
||||
st->c_oflag = r;
|
||||
|
||||
l = bt->c_cflag; r = 0;
|
||||
switch (l & CSIZE) {
|
||||
case CS5: r |= IBCS2_CS5; break;
|
||||
case CS6: r |= IBCS2_CS6; break;
|
||||
case CS7: r |= IBCS2_CS7; break;
|
||||
case CS8: r |= IBCS2_CS8; break;
|
||||
}
|
||||
if (l & CSTOPB) r |= IBCS2_CSTOPB;
|
||||
if (l & CREAD) r |= IBCS2_CREAD;
|
||||
if (l & PARENB) r |= IBCS2_PARENB;
|
||||
if (l & PARODD) r |= IBCS2_PARODD;
|
||||
if (l & HUPCL) r |= IBCS2_HUPCL;
|
||||
if (l & CLOCAL) r |= IBCS2_CLOCAL;
|
||||
st->c_cflag = r;
|
||||
|
||||
l = bt->c_lflag; r = 0;
|
||||
if (l & ISIG) r |= IBCS2_ISIG;
|
||||
if (l & ICANON) r |= IBCS2_ICANON;
|
||||
if (l & ECHO) r |= IBCS2_ECHO;
|
||||
if (l & ECHOE) r |= IBCS2_ECHOE;
|
||||
if (l & ECHOK) r |= IBCS2_ECHOK;
|
||||
if (l & ECHONL) r |= IBCS2_ECHONL;
|
||||
if (l & NOFLSH) r |= IBCS2_NOFLSH;
|
||||
if (l & TOSTOP) r |= IBCS2_TOSTOP;
|
||||
st->c_lflag = r;
|
||||
|
||||
l = ttspeedtab(bt->c_ospeed, sptab);
|
||||
if ((int)l >= 0)
|
||||
st->c_cflag |= l;
|
||||
|
||||
st->c_cc[IBCS2_VINTR] =
|
||||
bt->c_cc[VINTR] != _POSIX_VDISABLE ? bt->c_cc[VINTR] : 0;
|
||||
st->c_cc[IBCS2_VQUIT] =
|
||||
bt->c_cc[VQUIT] != _POSIX_VDISABLE ? bt->c_cc[VQUIT] : 0;
|
||||
st->c_cc[IBCS2_VERASE] =
|
||||
bt->c_cc[VERASE] != _POSIX_VDISABLE ? bt->c_cc[VERASE] : 0;
|
||||
st->c_cc[IBCS2_VKILL] =
|
||||
bt->c_cc[VKILL] != _POSIX_VDISABLE ? bt->c_cc[VKILL] : 0;
|
||||
if (bt->c_lflag & ICANON) {
|
||||
st->c_cc[IBCS2_VEOF] =
|
||||
bt->c_cc[VEOF] != _POSIX_VDISABLE ? bt->c_cc[VEOF] : 0;
|
||||
st->c_cc[IBCS2_VEOL] =
|
||||
bt->c_cc[VEOL] != _POSIX_VDISABLE ? bt->c_cc[VEOL] : 0;
|
||||
} else {
|
||||
st->c_cc[IBCS2_VMIN] = bt->c_cc[VMIN];
|
||||
st->c_cc[IBCS2_VTIME] = bt->c_cc[VTIME];
|
||||
}
|
||||
st->c_cc[IBCS2_VEOL2] =
|
||||
bt->c_cc[VEOL2] != _POSIX_VDISABLE ? bt->c_cc[VEOL2] : 0;
|
||||
st->c_cc[IBCS2_VSWTCH] =
|
||||
0;
|
||||
st->c_cc[IBCS2_VSUSP] =
|
||||
bt->c_cc[VSUSP] != _POSIX_VDISABLE ? bt->c_cc[VSUSP] : 0;
|
||||
st->c_cc[IBCS2_VSTART] =
|
||||
bt->c_cc[VSTART] != _POSIX_VDISABLE ? bt->c_cc[VSTART] : 0;
|
||||
st->c_cc[IBCS2_VSTOP] =
|
||||
bt->c_cc[VSTOP] != _POSIX_VDISABLE ? bt->c_cc[VSTOP] : 0;
|
||||
|
||||
st->c_line = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
stios2stio(ts, t)
|
||||
struct ibcs2_termios *ts;
|
||||
struct ibcs2_termio *t;
|
||||
{
|
||||
t->c_iflag = ts->c_iflag;
|
||||
t->c_oflag = ts->c_oflag;
|
||||
t->c_cflag = ts->c_cflag;
|
||||
t->c_lflag = ts->c_lflag;
|
||||
t->c_line = ts->c_line;
|
||||
bcopy(ts->c_cc, t->c_cc, IBCS2_NCC);
|
||||
}
|
||||
|
||||
static void
|
||||
stio2stios(t, ts)
|
||||
struct ibcs2_termio *t;
|
||||
struct ibcs2_termios *ts;
|
||||
{
|
||||
ts->c_iflag = t->c_iflag;
|
||||
ts->c_oflag = t->c_oflag;
|
||||
ts->c_cflag = t->c_cflag;
|
||||
ts->c_lflag = t->c_lflag;
|
||||
ts->c_line = t->c_line;
|
||||
bcopy(t->c_cc, ts->c_cc, IBCS2_NCC);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_ioctl(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_ioctl_args *uap;
|
||||
{
|
||||
struct proc *p = td->td_proc;
|
||||
cap_rights_t rights;
|
||||
struct file *fp;
|
||||
int error;
|
||||
|
||||
error = fget(td, uap->fd, cap_rights_init(&rights, CAP_IOCTL), &fp);
|
||||
if (error != 0) {
|
||||
DPRINTF(("ibcs2_ioctl(%d): bad fd %d ", p->p_pid,
|
||||
uap->fd));
|
||||
return EBADF;
|
||||
}
|
||||
|
||||
if ((fp->f_flag & (FREAD|FWRITE)) == 0) {
|
||||
fdrop(fp, td);
|
||||
DPRINTF(("ibcs2_ioctl(%d): bad fp flag ", p->p_pid));
|
||||
return EBADF;
|
||||
}
|
||||
|
||||
switch (uap->cmd) {
|
||||
case IBCS2_TCGETA:
|
||||
case IBCS2_XCGETA:
|
||||
case IBCS2_OXCGETA:
|
||||
{
|
||||
struct termios bts;
|
||||
struct ibcs2_termios sts;
|
||||
struct ibcs2_termio st;
|
||||
|
||||
if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts,
|
||||
td->td_ucred, td)) != 0)
|
||||
break;
|
||||
|
||||
btios2stios (&bts, &sts);
|
||||
if (uap->cmd == IBCS2_TCGETA) {
|
||||
stios2stio (&sts, &st);
|
||||
error = copyout((caddr_t)&st, uap->data,
|
||||
sizeof (st));
|
||||
#ifdef DEBUG_IBCS2
|
||||
if (error)
|
||||
DPRINTF(("ibcs2_ioctl(%d): copyout failed ",
|
||||
p->p_pid));
|
||||
#endif
|
||||
break;
|
||||
} else {
|
||||
error = copyout((caddr_t)&sts, uap->data,
|
||||
sizeof (sts));
|
||||
break;
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
case IBCS2_TCSETA:
|
||||
case IBCS2_TCSETAW:
|
||||
case IBCS2_TCSETAF:
|
||||
{
|
||||
struct termios bts;
|
||||
struct ibcs2_termios sts;
|
||||
struct ibcs2_termio st;
|
||||
|
||||
if ((error = copyin(uap->data, (caddr_t)&st,
|
||||
sizeof(st))) != 0) {
|
||||
DPRINTF(("ibcs2_ioctl(%d): TCSET copyin failed ",
|
||||
p->p_pid));
|
||||
break;
|
||||
}
|
||||
|
||||
/* get full BSD termios so we don't lose information */
|
||||
if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts,
|
||||
td->td_ucred, td)) != 0) {
|
||||
DPRINTF(("ibcs2_ioctl(%d): TCSET ctl failed fd %d ",
|
||||
p->p_pid, uap->fd));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* convert to iBCS2 termios, copy in information from
|
||||
* termio, and convert back, then set new values.
|
||||
*/
|
||||
btios2stios(&bts, &sts);
|
||||
stio2stios(&st, &sts);
|
||||
stios2btios(&sts, &bts);
|
||||
|
||||
error = fo_ioctl(fp, uap->cmd - IBCS2_TCSETA + TIOCSETA,
|
||||
(caddr_t)&bts, td->td_ucred, td);
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_XCSETA:
|
||||
case IBCS2_XCSETAW:
|
||||
case IBCS2_XCSETAF:
|
||||
{
|
||||
struct termios bts;
|
||||
struct ibcs2_termios sts;
|
||||
|
||||
if ((error = copyin(uap->data, (caddr_t)&sts,
|
||||
sizeof (sts))) != 0)
|
||||
break;
|
||||
stios2btios (&sts, &bts);
|
||||
error = fo_ioctl(fp, uap->cmd - IBCS2_XCSETA + TIOCSETA,
|
||||
(caddr_t)&bts, td->td_ucred, td);
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_OXCSETA:
|
||||
case IBCS2_OXCSETAW:
|
||||
case IBCS2_OXCSETAF:
|
||||
{
|
||||
struct termios bts;
|
||||
struct ibcs2_termios sts;
|
||||
|
||||
if ((error = copyin(uap->data, (caddr_t)&sts,
|
||||
sizeof (sts))) != 0)
|
||||
break;
|
||||
stios2btios (&sts, &bts);
|
||||
error = fo_ioctl(fp, uap->cmd - IBCS2_OXCSETA + TIOCSETA,
|
||||
(caddr_t)&bts, td->td_ucred, td);
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_TCSBRK:
|
||||
DPRINTF(("ibcs2_ioctl(%d): TCSBRK ", p->p_pid));
|
||||
error = ENOSYS;
|
||||
break;
|
||||
|
||||
case IBCS2_TCXONC:
|
||||
{
|
||||
switch ((int)uap->data) {
|
||||
case 0:
|
||||
case 1:
|
||||
DPRINTF(("ibcs2_ioctl(%d): TCXONC ", p->p_pid));
|
||||
error = ENOSYS;
|
||||
break;
|
||||
case 2:
|
||||
error = fo_ioctl(fp, TIOCSTOP, (caddr_t)0,
|
||||
td->td_ucred, td);
|
||||
break;
|
||||
case 3:
|
||||
error = fo_ioctl(fp, TIOCSTART, (caddr_t)1,
|
||||
td->td_ucred, td);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_TCFLSH:
|
||||
{
|
||||
int arg;
|
||||
|
||||
switch ((int)uap->data) {
|
||||
case 0:
|
||||
arg = FREAD;
|
||||
break;
|
||||
case 1:
|
||||
arg = FWRITE;
|
||||
break;
|
||||
case 2:
|
||||
arg = FREAD | FWRITE;
|
||||
break;
|
||||
default:
|
||||
fdrop(fp, td);
|
||||
return EINVAL;
|
||||
}
|
||||
error = fo_ioctl(fp, TIOCFLUSH, (caddr_t)&arg, td->td_ucred,
|
||||
td);
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_TIOCGWINSZ:
|
||||
uap->cmd = TIOCGWINSZ;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_TIOCSWINSZ:
|
||||
uap->cmd = TIOCSWINSZ;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_TIOCGPGRP:
|
||||
{
|
||||
pid_t pg_id;
|
||||
|
||||
PROC_LOCK(p);
|
||||
pg_id = p->p_pgrp->pg_id;
|
||||
PROC_UNLOCK(p);
|
||||
error = copyout((caddr_t)&pg_id, uap->data,
|
||||
sizeof(pg_id));
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_TIOCSPGRP: /* XXX - is uap->data a pointer to pgid? */
|
||||
{
|
||||
struct setpgid_args sa;
|
||||
|
||||
sa.pid = 0;
|
||||
sa.pgid = (int)uap->data;
|
||||
error = sys_setpgid(td, &sa);
|
||||
break;
|
||||
}
|
||||
|
||||
case IBCS2_TCGETSC: /* SCO console - get scancode flags */
|
||||
error = EINTR; /* ENOSYS; */
|
||||
break;
|
||||
|
||||
case IBCS2_TCSETSC: /* SCO console - set scancode flags */
|
||||
error = 0; /* ENOSYS; */
|
||||
break;
|
||||
|
||||
case IBCS2_JWINSIZE: /* Unix to Jerq I/O control */
|
||||
{
|
||||
struct ibcs2_jwinsize {
|
||||
char bytex, bytey;
|
||||
short bitx, bity;
|
||||
} ibcs2_jwinsize;
|
||||
|
||||
PROC_LOCK(p);
|
||||
SESS_LOCK(p->p_session);
|
||||
ibcs2_jwinsize.bytex = 80;
|
||||
/* p->p_session->s_ttyp->t_winsize.ws_col; XXX */
|
||||
ibcs2_jwinsize.bytey = 25;
|
||||
/* p->p_session->s_ttyp->t_winsize.ws_row; XXX */
|
||||
ibcs2_jwinsize.bitx =
|
||||
p->p_session->s_ttyp->t_winsize.ws_xpixel;
|
||||
ibcs2_jwinsize.bity =
|
||||
p->p_session->s_ttyp->t_winsize.ws_ypixel;
|
||||
SESS_UNLOCK(p->p_session);
|
||||
PROC_UNLOCK(p);
|
||||
error = copyout((caddr_t)&ibcs2_jwinsize, uap->data,
|
||||
sizeof(ibcs2_jwinsize));
|
||||
break;
|
||||
}
|
||||
|
||||
/* keyboard and display ioctl's -- type 'K' */
|
||||
case IBCS2_KDGKBMODE: /* get keyboard translation mode */
|
||||
uap->cmd = KDGKBMODE;
|
||||
/* printf("ioctl KDGKBMODE = %x\n", uap->cmd);*/
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDSKBMODE: /* set keyboard translation mode */
|
||||
uap->cmd = KDSKBMODE;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDMKTONE: /* sound tone */
|
||||
uap->cmd = KDMKTONE;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDGETMODE: /* get text/graphics mode */
|
||||
uap->cmd = KDGETMODE;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDSETMODE: /* set text/graphics mode */
|
||||
uap->cmd = KDSETMODE;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDSBORDER: /* set ega color border */
|
||||
uap->cmd = KDSBORDER;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDGKBSTATE:
|
||||
uap->cmd = KDGKBSTATE;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDSETRAD:
|
||||
uap->cmd = KDSETRAD;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDENABIO: /* enable direct I/O to ports */
|
||||
uap->cmd = KDENABIO;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDDISABIO: /* disable direct I/O to ports */
|
||||
uap->cmd = KDDISABIO;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KIOCSOUND: /* start sound generation */
|
||||
uap->cmd = KIOCSOUND;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDGKBTYPE: /* get keyboard type */
|
||||
uap->cmd = KDGKBTYPE;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDGETLED: /* get keyboard LED status */
|
||||
uap->cmd = KDGETLED;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_KDSETLED: /* set keyboard LED status */
|
||||
uap->cmd = KDSETLED;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
/* Xenix keyboard and display ioctl's from sys/kd.h -- type 'k' */
|
||||
case IBCS2_GETFKEY: /* Get function key */
|
||||
uap->cmd = GETFKEY;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_SETFKEY: /* Set function key */
|
||||
uap->cmd = SETFKEY;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_GIO_SCRNMAP: /* Get screen output map table */
|
||||
uap->cmd = GIO_SCRNMAP;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_PIO_SCRNMAP: /* Set screen output map table */
|
||||
uap->cmd = PIO_SCRNMAP;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_GIO_KEYMAP: /* Get keyboard map table */
|
||||
uap->cmd = OGIO_KEYMAP;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_PIO_KEYMAP: /* Set keyboard map table */
|
||||
uap->cmd = OPIO_KEYMAP;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
/* socksys */
|
||||
case IBCS2_SIOCSOCKSYS:
|
||||
error = ibcs2_socksys(td, (struct ibcs2_socksys_args *)uap);
|
||||
break;
|
||||
|
||||
case IBCS2_FIONREAD:
|
||||
case IBCS2_I_NREAD: /* STREAMS */
|
||||
uap->cmd = FIONREAD;
|
||||
error = sys_ioctl(td, (struct ioctl_args *)uap);
|
||||
break;
|
||||
|
||||
default:
|
||||
DPRINTF(("ibcs2_ioctl(%d): unknown cmd 0x%lx ",
|
||||
td->proc->p_pid, uap->cmd));
|
||||
error = ENOSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
fdrop(fp, td);
|
||||
return error;
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
/* 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,562 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/limits.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/sem.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/syscallsubr.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_util.h>
|
||||
#include <i386/ibcs2/ibcs2_ipc.h>
|
||||
|
||||
#define IBCS2_IPC_RMID 0
|
||||
#define IBCS2_IPC_SET 1
|
||||
#define IBCS2_IPC_STAT 2
|
||||
#define IBCS2_SETVAL 8
|
||||
|
||||
|
||||
|
||||
static void cvt_msqid2imsqid(struct msqid_ds *, struct ibcs2_msqid_ds *);
|
||||
static void cvt_imsqid2msqid(struct ibcs2_msqid_ds *, struct msqid_ds *);
|
||||
#ifdef unused
|
||||
static void cvt_sem2isem(struct sem *, struct ibcs2_sem *);
|
||||
static void cvt_isem2sem(struct ibcs2_sem *, struct sem *);
|
||||
#endif
|
||||
static void cvt_semid2isemid(struct semid_ds *, struct ibcs2_semid_ds *);
|
||||
static void cvt_isemid2semid(struct ibcs2_semid_ds *, struct semid_ds *);
|
||||
static void cvt_shmid2ishmid(struct shmid_ds *, struct ibcs2_shmid_ds *);
|
||||
static void cvt_ishmid2shmid(struct ibcs2_shmid_ds *, struct shmid_ds *);
|
||||
static void cvt_perm2iperm(struct ipc_perm *, struct ibcs2_ipc_perm *);
|
||||
static void cvt_iperm2perm(struct ibcs2_ipc_perm *, struct ipc_perm *);
|
||||
|
||||
|
||||
/*
|
||||
* iBCS2 msgsys call
|
||||
*/
|
||||
|
||||
static void
|
||||
cvt_msqid2imsqid(bp, ibp)
|
||||
struct msqid_ds *bp;
|
||||
struct ibcs2_msqid_ds *ibp;
|
||||
{
|
||||
memset(ibp, 0, sizeof(*ibp));
|
||||
cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm);
|
||||
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;
|
||||
{
|
||||
cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm);
|
||||
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;
|
||||
}
|
||||
|
||||
struct ibcs2_msgget_args {
|
||||
int what;
|
||||
ibcs2_key_t key;
|
||||
int msgflg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_msgget(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_msgget_args *uap = v;
|
||||
struct msgget_args ap;
|
||||
|
||||
ap.key = uap->key;
|
||||
ap.msgflg = uap->msgflg;
|
||||
return sys_msgget(td, &ap);
|
||||
}
|
||||
|
||||
struct ibcs2_msgctl_args {
|
||||
int what;
|
||||
int msqid;
|
||||
int cmd;
|
||||
struct ibcs2_msqid_ds *buf;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_msgctl(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_msgctl_args *uap = v;
|
||||
struct ibcs2_msqid_ds is;
|
||||
struct msqid_ds bs;
|
||||
int error;
|
||||
|
||||
memset(&is, 0, sizeof(is));
|
||||
|
||||
switch (uap->cmd) {
|
||||
case IBCS2_IPC_STAT:
|
||||
error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs);
|
||||
if (!error) {
|
||||
cvt_msqid2imsqid(&bs, &is);
|
||||
error = copyout(&is, uap->buf, sizeof(is));
|
||||
}
|
||||
return (error);
|
||||
case IBCS2_IPC_SET:
|
||||
error = copyin(uap->buf, &is, sizeof(is));
|
||||
if (error)
|
||||
return (error);
|
||||
cvt_imsqid2msqid(&is, &bs);
|
||||
return (kern_msgctl(td, uap->msqid, IPC_SET, &bs));
|
||||
case IBCS2_IPC_RMID:
|
||||
return (kern_msgctl(td, uap->msqid, IPC_RMID, NULL));
|
||||
}
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
struct ibcs2_msgrcv_args {
|
||||
int what;
|
||||
int msqid;
|
||||
void *msgp;
|
||||
size_t msgsz;
|
||||
long msgtyp;
|
||||
int msgflg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_msgrcv(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_msgrcv_args *uap = v;
|
||||
struct msgrcv_args ap;
|
||||
|
||||
ap.msqid = uap->msqid;
|
||||
ap.msgp = uap->msgp;
|
||||
ap.msgsz = uap->msgsz;
|
||||
ap.msgtyp = uap->msgtyp;
|
||||
ap.msgflg = uap->msgflg;
|
||||
return (sys_msgrcv(td, &ap));
|
||||
}
|
||||
|
||||
struct ibcs2_msgsnd_args {
|
||||
int what;
|
||||
int msqid;
|
||||
void *msgp;
|
||||
size_t msgsz;
|
||||
int msgflg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_msgsnd(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_msgsnd_args *uap = v;
|
||||
struct msgsnd_args ap;
|
||||
|
||||
ap.msqid = uap->msqid;
|
||||
ap.msgp = uap->msgp;
|
||||
ap.msgsz = uap->msgsz;
|
||||
ap.msgflg = uap->msgflg;
|
||||
return (sys_msgsnd(td, &ap));
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_msgsys(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_msgsys_args *uap;
|
||||
{
|
||||
switch (uap->which) {
|
||||
case 0:
|
||||
return (ibcs2_msgget(td, uap));
|
||||
case 1:
|
||||
return (ibcs2_msgctl(td, uap));
|
||||
case 2:
|
||||
return (ibcs2_msgrcv(td, uap));
|
||||
case 3:
|
||||
return (ibcs2_msgsnd(td, uap));
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* iBCS2 semsys call
|
||||
*/
|
||||
#ifdef unused
|
||||
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;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_isem2sem(ibp, bp)
|
||||
struct ibcs2_sem *ibp;
|
||||
struct sem *bp;
|
||||
{
|
||||
bp->semval = ibp->semval;
|
||||
bp->sempid = ibp->sempid;
|
||||
bp->semncnt = ibp->semncnt;
|
||||
bp->semzcnt = ibp->semzcnt;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
cvt_iperm2perm(ipp, pp)
|
||||
struct ibcs2_ipc_perm *ipp;
|
||||
struct ipc_perm *pp;
|
||||
{
|
||||
pp->uid = ipp->uid;
|
||||
pp->gid = ipp->gid;
|
||||
pp->cuid = ipp->cuid;
|
||||
pp->cgid = ipp->cgid;
|
||||
pp->mode = ipp->mode;
|
||||
pp->seq = ipp->seq;
|
||||
pp->key = ipp->key;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_perm2iperm(pp, ipp)
|
||||
struct ipc_perm *pp;
|
||||
struct ibcs2_ipc_perm *ipp;
|
||||
{
|
||||
ipp->uid = pp->uid;
|
||||
ipp->gid = pp->gid;
|
||||
ipp->cuid = pp->cuid;
|
||||
ipp->cgid = pp->cgid;
|
||||
ipp->mode = pp->mode;
|
||||
ipp->seq = pp->seq;
|
||||
ipp->key = pp->key;
|
||||
}
|
||||
|
||||
static void
|
||||
cvt_semid2isemid(bp, ibp)
|
||||
struct semid_ds *bp;
|
||||
struct ibcs2_semid_ds *ibp;
|
||||
{
|
||||
memset(ibp, 0, sizeof(*ibp));
|
||||
cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm);
|
||||
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;
|
||||
{
|
||||
cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm);
|
||||
bp->sem_nsems = ibp->sem_nsems;
|
||||
bp->sem_otime = ibp->sem_otime;
|
||||
bp->sem_ctime = ibp->sem_ctime;
|
||||
return;
|
||||
}
|
||||
|
||||
struct ibcs2_semctl_args {
|
||||
int what;
|
||||
int semid;
|
||||
int semnum;
|
||||
int cmd;
|
||||
union semun arg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_semctl(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_semctl_args *uap = v;
|
||||
struct ibcs2_semid_ds is;
|
||||
struct semid_ds bs;
|
||||
union semun semun;
|
||||
register_t rval;
|
||||
int error;
|
||||
|
||||
memset(&is, 0, sizeof(is));
|
||||
|
||||
switch(uap->cmd) {
|
||||
case IBCS2_IPC_STAT:
|
||||
semun.buf = &bs;
|
||||
error = kern_semctl(td, uap->semid, uap->semnum, IPC_STAT,
|
||||
&semun, &rval);
|
||||
if (error)
|
||||
return (error);
|
||||
cvt_semid2isemid(&bs, &is);
|
||||
error = copyout(&is, uap->arg.buf, sizeof(is));
|
||||
if (error == 0)
|
||||
td->td_retval[0] = rval;
|
||||
return (error);
|
||||
|
||||
case IBCS2_IPC_SET:
|
||||
error = copyin(uap->arg.buf, &is, sizeof(is));
|
||||
if (error)
|
||||
return (error);
|
||||
cvt_isemid2semid(&is, &bs);
|
||||
semun.buf = &bs;
|
||||
return (kern_semctl(td, uap->semid, uap->semnum, IPC_SET,
|
||||
&semun, td->td_retval));
|
||||
}
|
||||
|
||||
return (kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &uap->arg,
|
||||
td->td_retval));
|
||||
}
|
||||
|
||||
struct ibcs2_semget_args {
|
||||
int what;
|
||||
ibcs2_key_t key;
|
||||
int nsems;
|
||||
int semflg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_semget(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_semget_args *uap = v;
|
||||
struct semget_args ap;
|
||||
|
||||
ap.key = uap->key;
|
||||
ap.nsems = uap->nsems;
|
||||
ap.semflg = uap->semflg;
|
||||
return (sys_semget(td, &ap));
|
||||
}
|
||||
|
||||
struct ibcs2_semop_args {
|
||||
int what;
|
||||
int semid;
|
||||
struct sembuf *sops;
|
||||
size_t nsops;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_semop(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_semop_args *uap = v;
|
||||
struct semop_args ap;
|
||||
|
||||
ap.semid = uap->semid;
|
||||
ap.sops = uap->sops;
|
||||
ap.nsops = uap->nsops;
|
||||
return (sys_semop(td, &ap));
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_semsys(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_semsys_args *uap;
|
||||
{
|
||||
|
||||
switch (uap->which) {
|
||||
case 0:
|
||||
return (ibcs2_semctl(td, uap));
|
||||
case 1:
|
||||
return (ibcs2_semget(td, uap));
|
||||
case 2:
|
||||
return (ibcs2_semop(td, uap));
|
||||
}
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* iBCS2 shmsys call
|
||||
*/
|
||||
|
||||
static void
|
||||
cvt_shmid2ishmid(bp, ibp)
|
||||
struct shmid_ds *bp;
|
||||
struct ibcs2_shmid_ds *ibp;
|
||||
{
|
||||
cvt_perm2iperm(&bp->shm_perm, &ibp->shm_perm);
|
||||
ibp->shm_segsz = bp->shm_segsz;
|
||||
ibp->shm_lpid = bp->shm_lpid;
|
||||
ibp->shm_cpid = bp->shm_cpid;
|
||||
if (bp->shm_nattch > SHRT_MAX)
|
||||
ibp->shm_nattch = SHRT_MAX;
|
||||
else
|
||||
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;
|
||||
{
|
||||
cvt_iperm2perm(&ibp->shm_perm, &bp->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;
|
||||
return;
|
||||
}
|
||||
|
||||
struct ibcs2_shmat_args {
|
||||
int what;
|
||||
int shmid;
|
||||
const void *shmaddr;
|
||||
int shmflg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_shmat(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_shmat_args *uap = v;
|
||||
struct shmat_args ap;
|
||||
|
||||
ap.shmid = uap->shmid;
|
||||
ap.shmaddr = uap->shmaddr;
|
||||
ap.shmflg = uap->shmflg;
|
||||
return (sys_shmat(td, &ap));
|
||||
}
|
||||
|
||||
struct ibcs2_shmctl_args {
|
||||
int what;
|
||||
int shmid;
|
||||
int cmd;
|
||||
struct ibcs2_shmid_ds *buf;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_shmctl(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_shmctl_args *uap = v;
|
||||
struct ibcs2_shmid_ds is;
|
||||
struct shmid_ds bs;
|
||||
int error;
|
||||
|
||||
switch(uap->cmd) {
|
||||
case IBCS2_IPC_STAT:
|
||||
error = kern_shmctl(td, uap->shmid, IPC_STAT, &bs, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
cvt_shmid2ishmid(&bs, &is);
|
||||
return (copyout(&is, uap->buf, sizeof(is)));
|
||||
|
||||
case IBCS2_IPC_SET:
|
||||
error = copyin(uap->buf, &is, sizeof(is));
|
||||
if (error)
|
||||
return (error);
|
||||
cvt_ishmid2shmid(&is, &bs);
|
||||
return (kern_shmctl(td, uap->shmid, IPC_SET, &bs, NULL));
|
||||
|
||||
case IPC_INFO:
|
||||
case SHM_INFO:
|
||||
case SHM_STAT:
|
||||
/* XXX: */
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
return (kern_shmctl(td, uap->shmid, uap->cmd, NULL, NULL));
|
||||
}
|
||||
|
||||
struct ibcs2_shmdt_args {
|
||||
int what;
|
||||
const void *shmaddr;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_shmdt(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_shmdt_args *uap = v;
|
||||
struct shmdt_args ap;
|
||||
|
||||
ap.shmaddr = uap->shmaddr;
|
||||
return (sys_shmdt(td, &ap));
|
||||
}
|
||||
|
||||
struct ibcs2_shmget_args {
|
||||
int what;
|
||||
ibcs2_key_t key;
|
||||
size_t size;
|
||||
int shmflg;
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_shmget(struct thread *td, void *v)
|
||||
{
|
||||
struct ibcs2_shmget_args *uap = v;
|
||||
struct shmget_args ap;
|
||||
|
||||
ap.key = uap->key;
|
||||
ap.size = uap->size;
|
||||
ap.shmflg = uap->shmflg;
|
||||
return (sys_shmget(td, &ap));
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_shmsys(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_shmsys_args *uap;
|
||||
{
|
||||
|
||||
switch (uap->which) {
|
||||
case 0:
|
||||
return (ibcs2_shmat(td, uap));
|
||||
case 1:
|
||||
return (ibcs2_shmctl(td, uap));
|
||||
case 2:
|
||||
return (ibcs2_shmdt(td, uap));
|
||||
case 3:
|
||||
return (ibcs2_shmget(td, uap));
|
||||
}
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
MODULE_DEPEND(ibcs2, sysvmsg, 1, 1, 1);
|
||||
MODULE_DEPEND(ibcs2, sysvsem, 1, 1, 1);
|
||||
MODULE_DEPEND(ibcs2, sysvshm, 1, 1, 1);
|
@ -1,87 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
|
||||
struct ibcs2_ipc_perm {
|
||||
u_short uid; /* user id */
|
||||
u_short gid; /* group id */
|
||||
u_short cuid; /* creator user id */
|
||||
u_short cgid; /* creator group id */
|
||||
u_short mode; /* r/w permission */
|
||||
u_short seq; /* sequence # (to generate unique msg/sem/shm id) */
|
||||
ibcs2_key_t key; /* user specified msg/sem/shm key */
|
||||
};
|
||||
|
||||
struct ibcs2_msqid_ds {
|
||||
struct ibcs2_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 ibcs2_ipc_perm sem_perm;
|
||||
struct ibcs2_sem *sem_base;
|
||||
u_short sem_nsems;
|
||||
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 ibcs2_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,68 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* 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
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
#include <i386/ibcs2/ibcs2_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_isc_syscall.h>
|
||||
|
||||
extern struct sysent isc_sysent[];
|
||||
|
||||
int
|
||||
ibcs2_isc(struct thread *td, struct ibcs2_isc_args *uap)
|
||||
{
|
||||
struct trapframe *tf = td->td_frame;
|
||||
struct sysent *callp;
|
||||
u_int code;
|
||||
int error;
|
||||
|
||||
code = (tf->tf_eax & 0xffffff00) >> 8;
|
||||
callp = &isc_sysent[code];
|
||||
|
||||
if (code < IBCS2_ISC_MAXSYSCALL)
|
||||
error = (*callp->sy_call)(td, (void *)uap);
|
||||
else
|
||||
error = ENOSYS;
|
||||
return (error);
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* System call numbers.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb
|
||||
*/
|
||||
|
||||
#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
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* System call switch table.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb
|
||||
*/
|
||||
|
||||
#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_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
|
||||
#define AS(name) (sizeof(struct name) / sizeof(register_t))
|
||||
|
||||
/* The casts are bogus but will do for now. */
|
||||
struct sysent isc_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 1 = isc_setostype */
|
||||
{ AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = ibcs2_rename */
|
||||
{ AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = ibcs2_sigaction */
|
||||
{ AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = ibcs2_sigprocmask */
|
||||
{ AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = ibcs2_sigpending */
|
||||
{ AS(getgroups_args), (sy_call_t *)sys_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = getgroups */
|
||||
{ AS(setgroups_args), (sy_call_t *)sys_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = setgroups */
|
||||
{ AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = ibcs2_pathconf */
|
||||
{ AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = ibcs2_fpathconf */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 10 = nosys */
|
||||
{ AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = ibcs2_wait */
|
||||
{ 0, (sy_call_t *)sys_setsid, AUE_SETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = setsid */
|
||||
{ 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = getpid */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 14 = isc_adduser */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 15 = isc_setuser */
|
||||
{ AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = ibcs2_sysconf */
|
||||
{ AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = ibcs2_sigsuspend */
|
||||
{ AS(ibcs2_symlink_args), (sy_call_t *)ibcs2_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = ibcs2_symlink */
|
||||
{ AS(ibcs2_readlink_args), (sy_call_t *)ibcs2_readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = ibcs2_readlink */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 20 = isc_getmajor */
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,44 +0,0 @@
|
||||
/* $NetBSD: ibcs2_mount.h,v 1.2 1994/10/26 02:53:00 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_MOUNT_H
|
||||
#define _IBCS2_MOUNT_H
|
||||
|
||||
#define IBCS2_MS_RDONLY 0x01
|
||||
#define IBCS2_MS_FSS 0x02
|
||||
#define IBCS2_MS_DATA 0x04
|
||||
#define IBCS2_MS_CACHE 0x08
|
||||
|
||||
#endif /* _IBCS2_MOUNT_H */
|
@ -1,60 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* IBCS2 message compatibility module.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/sysproto.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>
|
||||
|
||||
|
||||
int
|
||||
ibcs2_getmsg(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_getmsg_args *uap;
|
||||
{
|
||||
return 0; /* fake */
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_putmsg(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_putmsg_args *uap;
|
||||
{
|
||||
return 0; /* fake */
|
||||
}
|
@ -1,121 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* IBCS2 compatibility module.
|
||||
*/
|
||||
|
||||
#include "opt_spx_hack.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/un.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 thread *td, struct ibcs2_secure_args *uap)
|
||||
{
|
||||
switch (uap->cmd) {
|
||||
|
||||
case IBCS2_SECURE_GETLUID: /* get login uid */
|
||||
td->td_retval[0] = td->td_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 thread *td, struct ibcs2_lseek_args *uap)
|
||||
{
|
||||
struct lseek_args largs;
|
||||
int error;
|
||||
|
||||
largs.fd = uap->fd;
|
||||
largs.offset = uap->offset;
|
||||
largs.whence = uap->whence;
|
||||
error = sys_lseek(td, &largs);
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifdef SPX_HACK
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
int
|
||||
spx_open(struct thread *td)
|
||||
{
|
||||
struct socket_args sock;
|
||||
struct sockaddr_un sun;
|
||||
int fd, error;
|
||||
|
||||
/* obtain a socket. */
|
||||
DPRINTF(("SPX: open socket\n"));
|
||||
sock.domain = AF_UNIX;
|
||||
sock.type = SOCK_STREAM;
|
||||
sock.protocol = 0;
|
||||
error = sys_socket(td, &sock);
|
||||
if (error)
|
||||
return error;
|
||||
fd = td->td_retval[0];
|
||||
|
||||
/* connect the socket to standard X socket */
|
||||
DPRINTF(("SPX: connect to /tmp/X11-unix/X0\n"));
|
||||
sun.sun_family = AF_UNIX;
|
||||
strcpy(sun.sun_path, "/tmp/.X11-unix/X0");
|
||||
sun.sun_len = sizeof(struct sockaddr_un) - sizeof(sun.sun_path) +
|
||||
strlen(sun.sun_path) + 1;
|
||||
|
||||
error = kern_connectat(td, AT_FDCWD, fd, (struct sockaddr *)&sun);
|
||||
if (error) {
|
||||
kern_close(td, fd);
|
||||
return error;
|
||||
}
|
||||
td->td_retval[0] = fd;
|
||||
return 0;
|
||||
}
|
||||
#endif /* SPX_HACK */
|
@ -1,426 +0,0 @@
|
||||
/*
|
||||
* System call prototypes.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_SYSPROTO_H_
|
||||
#define _IBCS2_SYSPROTO_H_
|
||||
|
||||
#include <sys/signal.h>
|
||||
#include <sys/acl.h>
|
||||
#include <sys/cpuset.h>
|
||||
#include <sys/domainset.h>
|
||||
#include <sys/_ffcounter.h>
|
||||
#include <sys/_semaphore.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <bsm/audit_kevents.h>
|
||||
|
||||
struct proc;
|
||||
|
||||
struct thread;
|
||||
|
||||
#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
|
||||
0 : sizeof(register_t) - sizeof(t))
|
||||
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
#define PADL_(t) 0
|
||||
#define PADR_(t) PAD_(t)
|
||||
#else
|
||||
#define PADL_(t) PAD_(t)
|
||||
#define PADR_(t) 0
|
||||
#endif
|
||||
|
||||
struct ibcs2_read_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
|
||||
char nbytes_l_[PADL_(u_int)]; u_int nbytes; char nbytes_r_[PADR_(u_int)];
|
||||
};
|
||||
struct ibcs2_open_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
|
||||
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_wait_args {
|
||||
char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_creat_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_unlink_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_execv_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
|
||||
};
|
||||
struct ibcs2_chdir_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_time_args {
|
||||
char tp_l_[PADL_(ibcs2_time_t *)]; ibcs2_time_t * tp; char tp_r_[PADR_(ibcs2_time_t *)];
|
||||
};
|
||||
struct ibcs2_mknod_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
|
||||
char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_chmod_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_chown_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)];
|
||||
char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_stat_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char st_l_[PADL_(struct ibcs2_stat *)]; struct ibcs2_stat * st; char st_r_[PADR_(struct ibcs2_stat *)];
|
||||
};
|
||||
struct ibcs2_lseek_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char offset_l_[PADL_(long)]; long offset; char offset_r_[PADR_(long)];
|
||||
char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_mount_args {
|
||||
char special_l_[PADL_(char *)]; char * special; char special_r_[PADR_(char *)];
|
||||
char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)];
|
||||
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
|
||||
char fstype_l_[PADL_(int)]; int fstype; char fstype_r_[PADR_(int)];
|
||||
char data_l_[PADL_(char *)]; char * data; char data_r_[PADR_(char *)];
|
||||
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_umount_args {
|
||||
char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_setuid_args {
|
||||
char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_stime_args {
|
||||
char timep_l_[PADL_(long *)]; long * timep; char timep_r_[PADR_(long *)];
|
||||
};
|
||||
struct ibcs2_alarm_args {
|
||||
char sec_l_[PADL_(unsigned)]; unsigned sec; char sec_r_[PADR_(unsigned)];
|
||||
};
|
||||
struct ibcs2_fstat_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char st_l_[PADL_(struct ibcs2_stat *)]; struct ibcs2_stat * st; char st_r_[PADR_(struct ibcs2_stat *)];
|
||||
};
|
||||
struct ibcs2_pause_args {
|
||||
register_t dummy;
|
||||
};
|
||||
struct ibcs2_utime_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char buf_l_[PADL_(struct ibcs2_utimbuf *)]; struct ibcs2_utimbuf * buf; char buf_r_[PADR_(struct ibcs2_utimbuf *)];
|
||||
};
|
||||
struct ibcs2_access_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_nice_args {
|
||||
char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_statfs_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char buf_l_[PADL_(struct ibcs2_statfs *)]; struct ibcs2_statfs * buf; char buf_r_[PADR_(struct ibcs2_statfs *)];
|
||||
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
|
||||
char fstype_l_[PADL_(int)]; int fstype; char fstype_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_kill_args {
|
||||
char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
|
||||
char signo_l_[PADL_(int)]; int signo; char signo_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_fstatfs_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char buf_l_[PADL_(struct ibcs2_statfs *)]; struct ibcs2_statfs * buf; char buf_r_[PADR_(struct ibcs2_statfs *)];
|
||||
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
|
||||
char fstype_l_[PADL_(int)]; int fstype; char fstype_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_pgrpsys_args {
|
||||
char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)];
|
||||
char dummy_l_[PADL_(caddr_t)]; caddr_t dummy; char dummy_r_[PADR_(caddr_t)];
|
||||
char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
|
||||
char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_xenix_args {
|
||||
char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
|
||||
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
|
||||
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_times_args {
|
||||
char tp_l_[PADL_(struct tms *)]; struct tms * tp; char tp_r_[PADR_(struct tms *)];
|
||||
};
|
||||
struct ibcs2_plock_args {
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_setgid_args {
|
||||
char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_sigsys_args {
|
||||
char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
|
||||
char fp_l_[PADL_(ibcs2_sig_t)]; ibcs2_sig_t fp; char fp_r_[PADR_(ibcs2_sig_t)];
|
||||
};
|
||||
struct ibcs2_msgsys_args {
|
||||
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
|
||||
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
|
||||
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
|
||||
char a6_l_[PADL_(int)]; int a6; char a6_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_sysi86_args {
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char arg_l_[PADL_(int *)]; int * arg; char arg_r_[PADR_(int *)];
|
||||
};
|
||||
struct ibcs2_shmsys_args {
|
||||
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
|
||||
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_semsys_args {
|
||||
char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
|
||||
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
|
||||
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_ioctl_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)];
|
||||
};
|
||||
struct ibcs2_uadmin_args {
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char func_l_[PADL_(int)]; int func; char func_r_[PADR_(int)];
|
||||
char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)];
|
||||
};
|
||||
struct ibcs2_utssys_args {
|
||||
char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_execve_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
|
||||
char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)];
|
||||
};
|
||||
struct ibcs2_fcntl_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char arg_l_[PADL_(char *)]; char * arg; char arg_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_ulimit_args {
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char newlimit_l_[PADL_(int)]; int newlimit; char newlimit_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_rmdir_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_mkdir_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_getdents_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
|
||||
char nbytes_l_[PADL_(int)]; int nbytes; char nbytes_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_sysfs_args {
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char d1_l_[PADL_(caddr_t)]; caddr_t d1; char d1_r_[PADR_(caddr_t)];
|
||||
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_getmsg_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char ctl_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * ctl; char ctl_r_[PADR_(struct ibcs2_stropts *)];
|
||||
char dat_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * dat; char dat_r_[PADR_(struct ibcs2_stropts *)];
|
||||
char flags_l_[PADL_(int *)]; int * flags; char flags_r_[PADR_(int *)];
|
||||
};
|
||||
struct ibcs2_putmsg_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char ctl_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * ctl; char ctl_r_[PADR_(struct ibcs2_stropts *)];
|
||||
char dat_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * dat; char dat_r_[PADR_(struct ibcs2_stropts *)];
|
||||
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_secure_args {
|
||||
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
|
||||
char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)];
|
||||
char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)];
|
||||
char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)];
|
||||
char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)];
|
||||
char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_symlink_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char link_l_[PADL_(char *)]; char * link; char link_r_[PADR_(char *)];
|
||||
};
|
||||
struct ibcs2_lstat_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char st_l_[PADL_(struct ibcs2_stat *)]; struct ibcs2_stat * st; char st_r_[PADR_(struct ibcs2_stat *)];
|
||||
};
|
||||
struct ibcs2_readlink_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
|
||||
char count_l_[PADL_(int)]; int count; char count_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_isc_args {
|
||||
register_t dummy;
|
||||
};
|
||||
int ibcs2_read(struct thread *, struct ibcs2_read_args *);
|
||||
int ibcs2_open(struct thread *, struct ibcs2_open_args *);
|
||||
int ibcs2_wait(struct thread *, struct ibcs2_wait_args *);
|
||||
int ibcs2_creat(struct thread *, struct ibcs2_creat_args *);
|
||||
int ibcs2_unlink(struct thread *, struct ibcs2_unlink_args *);
|
||||
int ibcs2_execv(struct thread *, struct ibcs2_execv_args *);
|
||||
int ibcs2_chdir(struct thread *, struct ibcs2_chdir_args *);
|
||||
int ibcs2_time(struct thread *, struct ibcs2_time_args *);
|
||||
int ibcs2_mknod(struct thread *, struct ibcs2_mknod_args *);
|
||||
int ibcs2_chmod(struct thread *, struct ibcs2_chmod_args *);
|
||||
int ibcs2_chown(struct thread *, struct ibcs2_chown_args *);
|
||||
int ibcs2_stat(struct thread *, struct ibcs2_stat_args *);
|
||||
int ibcs2_lseek(struct thread *, struct ibcs2_lseek_args *);
|
||||
int ibcs2_mount(struct thread *, struct ibcs2_mount_args *);
|
||||
int ibcs2_umount(struct thread *, struct ibcs2_umount_args *);
|
||||
int ibcs2_setuid(struct thread *, struct ibcs2_setuid_args *);
|
||||
int ibcs2_stime(struct thread *, struct ibcs2_stime_args *);
|
||||
int ibcs2_alarm(struct thread *, struct ibcs2_alarm_args *);
|
||||
int ibcs2_fstat(struct thread *, struct ibcs2_fstat_args *);
|
||||
int ibcs2_pause(struct thread *, struct ibcs2_pause_args *);
|
||||
int ibcs2_utime(struct thread *, struct ibcs2_utime_args *);
|
||||
int ibcs2_access(struct thread *, struct ibcs2_access_args *);
|
||||
int ibcs2_nice(struct thread *, struct ibcs2_nice_args *);
|
||||
int ibcs2_statfs(struct thread *, struct ibcs2_statfs_args *);
|
||||
int ibcs2_kill(struct thread *, struct ibcs2_kill_args *);
|
||||
int ibcs2_fstatfs(struct thread *, struct ibcs2_fstatfs_args *);
|
||||
int ibcs2_pgrpsys(struct thread *, struct ibcs2_pgrpsys_args *);
|
||||
int ibcs2_xenix(struct thread *, struct ibcs2_xenix_args *);
|
||||
int ibcs2_times(struct thread *, struct ibcs2_times_args *);
|
||||
int ibcs2_plock(struct thread *, struct ibcs2_plock_args *);
|
||||
int ibcs2_setgid(struct thread *, struct ibcs2_setgid_args *);
|
||||
int ibcs2_sigsys(struct thread *, struct ibcs2_sigsys_args *);
|
||||
int ibcs2_msgsys(struct thread *, struct ibcs2_msgsys_args *);
|
||||
int ibcs2_sysi86(struct thread *, struct ibcs2_sysi86_args *);
|
||||
int ibcs2_shmsys(struct thread *, struct ibcs2_shmsys_args *);
|
||||
int ibcs2_semsys(struct thread *, struct ibcs2_semsys_args *);
|
||||
int ibcs2_ioctl(struct thread *, struct ibcs2_ioctl_args *);
|
||||
int ibcs2_uadmin(struct thread *, struct ibcs2_uadmin_args *);
|
||||
int ibcs2_utssys(struct thread *, struct ibcs2_utssys_args *);
|
||||
int ibcs2_execve(struct thread *, struct ibcs2_execve_args *);
|
||||
int ibcs2_fcntl(struct thread *, struct ibcs2_fcntl_args *);
|
||||
int ibcs2_ulimit(struct thread *, struct ibcs2_ulimit_args *);
|
||||
int ibcs2_rmdir(struct thread *, struct ibcs2_rmdir_args *);
|
||||
int ibcs2_mkdir(struct thread *, struct ibcs2_mkdir_args *);
|
||||
int ibcs2_getdents(struct thread *, struct ibcs2_getdents_args *);
|
||||
int ibcs2_sysfs(struct thread *, struct ibcs2_sysfs_args *);
|
||||
int ibcs2_getmsg(struct thread *, struct ibcs2_getmsg_args *);
|
||||
int ibcs2_putmsg(struct thread *, struct ibcs2_putmsg_args *);
|
||||
int ibcs2_secure(struct thread *, struct ibcs2_secure_args *);
|
||||
int ibcs2_symlink(struct thread *, struct ibcs2_symlink_args *);
|
||||
int ibcs2_lstat(struct thread *, struct ibcs2_lstat_args *);
|
||||
int ibcs2_readlink(struct thread *, struct ibcs2_readlink_args *);
|
||||
int ibcs2_isc(struct thread *, struct ibcs2_isc_args *);
|
||||
|
||||
#ifdef COMPAT_43
|
||||
|
||||
|
||||
#endif /* COMPAT_43 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD4
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD4 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD6
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD6 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD7
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD7 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD10
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD10 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD11
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD11 */
|
||||
|
||||
#define IBCS2_SYS_AUE_ibcs2_read AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_open AUE_OPEN_RWTC
|
||||
#define IBCS2_SYS_AUE_ibcs2_wait AUE_WAIT4
|
||||
#define IBCS2_SYS_AUE_ibcs2_creat AUE_CREAT
|
||||
#define IBCS2_SYS_AUE_ibcs2_unlink AUE_UNLINK
|
||||
#define IBCS2_SYS_AUE_ibcs2_execv AUE_EXECVE
|
||||
#define IBCS2_SYS_AUE_ibcs2_chdir AUE_CHDIR
|
||||
#define IBCS2_SYS_AUE_ibcs2_time AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_mknod AUE_MKNOD
|
||||
#define IBCS2_SYS_AUE_ibcs2_chmod AUE_CHMOD
|
||||
#define IBCS2_SYS_AUE_ibcs2_chown AUE_CHOWN
|
||||
#define IBCS2_SYS_AUE_ibcs2_stat AUE_STAT
|
||||
#define IBCS2_SYS_AUE_ibcs2_lseek AUE_LSEEK
|
||||
#define IBCS2_SYS_AUE_ibcs2_mount AUE_MOUNT
|
||||
#define IBCS2_SYS_AUE_ibcs2_umount AUE_UMOUNT
|
||||
#define IBCS2_SYS_AUE_ibcs2_setuid AUE_SETUID
|
||||
#define IBCS2_SYS_AUE_ibcs2_stime AUE_SETTIMEOFDAY
|
||||
#define IBCS2_SYS_AUE_ibcs2_alarm AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_fstat AUE_FSTAT
|
||||
#define IBCS2_SYS_AUE_ibcs2_pause AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_utime AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_access AUE_ACCESS
|
||||
#define IBCS2_SYS_AUE_ibcs2_nice AUE_NICE
|
||||
#define IBCS2_SYS_AUE_ibcs2_statfs AUE_STATFS
|
||||
#define IBCS2_SYS_AUE_ibcs2_kill AUE_KILL
|
||||
#define IBCS2_SYS_AUE_ibcs2_fstatfs AUE_FSTATFS
|
||||
#define IBCS2_SYS_AUE_ibcs2_pgrpsys AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_xenix AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_times AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_plock AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_setgid AUE_SETGID
|
||||
#define IBCS2_SYS_AUE_ibcs2_sigsys AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_msgsys AUE_MSGSYS
|
||||
#define IBCS2_SYS_AUE_ibcs2_sysi86 AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_shmsys AUE_SHMSYS
|
||||
#define IBCS2_SYS_AUE_ibcs2_semsys AUE_SEMSYS
|
||||
#define IBCS2_SYS_AUE_ibcs2_ioctl AUE_IOCTL
|
||||
#define IBCS2_SYS_AUE_ibcs2_uadmin AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_utssys AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_execve AUE_EXECVE
|
||||
#define IBCS2_SYS_AUE_ibcs2_fcntl AUE_FCNTL
|
||||
#define IBCS2_SYS_AUE_ibcs2_ulimit AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_rmdir AUE_RMDIR
|
||||
#define IBCS2_SYS_AUE_ibcs2_mkdir AUE_MKDIR
|
||||
#define IBCS2_SYS_AUE_ibcs2_getdents AUE_GETDIRENTRIES
|
||||
#define IBCS2_SYS_AUE_ibcs2_sysfs AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_getmsg AUE_GETMSG
|
||||
#define IBCS2_SYS_AUE_ibcs2_putmsg AUE_PUTMSG
|
||||
#define IBCS2_SYS_AUE_ibcs2_secure AUE_NULL
|
||||
#define IBCS2_SYS_AUE_ibcs2_symlink AUE_SYMLINK
|
||||
#define IBCS2_SYS_AUE_ibcs2_lstat AUE_LSTAT
|
||||
#define IBCS2_SYS_AUE_ibcs2_readlink AUE_READLINK
|
||||
#define IBCS2_SYS_AUE_ibcs2_isc AUE_NULL
|
||||
|
||||
#undef PAD_
|
||||
#undef PADL_
|
||||
#undef PADR_
|
||||
|
||||
#endif /* !_IBCS2_SYSPROTO_H_ */
|
@ -1,429 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* 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.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/syscallsubr.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 sigemptyset(s) SIGEMPTYSET(*(s))
|
||||
#define sigismember(s, n) SIGISMEMBER(*(s), n)
|
||||
#define sigaddset(s, n) SIGADDSET(*(s), n)
|
||||
|
||||
#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(const ibcs2_sigset_t *, sigset_t *);
|
||||
static void bsd_to_ibcs2_sigset(const sigset_t *, ibcs2_sigset_t *);
|
||||
static void ibcs2_to_bsd_sigaction(struct ibcs2_sigaction *,
|
||||
struct sigaction *);
|
||||
static void bsd_to_ibcs2_sigaction(struct sigaction *,
|
||||
struct ibcs2_sigaction *);
|
||||
|
||||
int bsd_to_ibcs2_sig[IBCS2_SIGTBLSZ] = {
|
||||
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 */
|
||||
0 /* 32 */
|
||||
};
|
||||
|
||||
static int ibcs2_to_bsd_sig[IBCS2_SIGTBLSZ] = {
|
||||
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 */
|
||||
0 /* 32 */
|
||||
};
|
||||
|
||||
void
|
||||
ibcs2_to_bsd_sigset(iss, bss)
|
||||
const ibcs2_sigset_t *iss;
|
||||
sigset_t *bss;
|
||||
{
|
||||
int i, newsig;
|
||||
|
||||
sigemptyset(bss);
|
||||
for (i = 1; i <= IBCS2_SIGTBLSZ; i++) {
|
||||
if (ibcs2_sigismember(iss, i)) {
|
||||
newsig = ibcs2_to_bsd_sig[_SIG_IDX(i)];
|
||||
if (newsig)
|
||||
sigaddset(bss, newsig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 <= IBCS2_SIGTBLSZ; i++) {
|
||||
if (sigismember(bss, i)) {
|
||||
newsig = bsd_to_ibcs2_sig[_SIG_IDX(i)];
|
||||
if (newsig)
|
||||
ibcs2_sigaddset(iss, newsig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ibcs2_to_bsd_sigaction(isa, bsa)
|
||||
struct ibcs2_sigaction *isa;
|
||||
struct sigaction *bsa;
|
||||
{
|
||||
|
||||
bsa->sa_handler = isa->isa_handler;
|
||||
ibcs2_to_bsd_sigset(&isa->isa_mask, &bsa->sa_mask);
|
||||
bsa->sa_flags = 0; /* ??? SA_NODEFER */
|
||||
if ((isa->isa_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->isa_handler = bsa->sa_handler;
|
||||
bsd_to_ibcs2_sigset(&bsa->sa_mask, &isa->isa_mask);
|
||||
isa->isa_flags = 0;
|
||||
if ((bsa->sa_flags & SA_NOCLDSTOP) != 0)
|
||||
isa->isa_flags |= IBCS2_SA_NOCLDSTOP;
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigaction(struct thread *td, struct ibcs2_sigaction_args *uap)
|
||||
{
|
||||
struct ibcs2_sigaction isa;
|
||||
struct sigaction nbsa, obsa;
|
||||
struct sigaction *nbsap;
|
||||
int error;
|
||||
|
||||
if (uap->act != NULL) {
|
||||
if ((error = copyin(uap->act, &isa, sizeof(isa))) != 0)
|
||||
return (error);
|
||||
ibcs2_to_bsd_sigaction(&isa, &nbsa);
|
||||
nbsap = &nbsa;
|
||||
} else
|
||||
nbsap = NULL;
|
||||
if (uap->sig <= 0 || uap->sig > IBCS2_NSIG)
|
||||
return (EINVAL);
|
||||
error = kern_sigaction(td, ibcs2_to_bsd_sig[_SIG_IDX(uap->sig)], &nbsa,
|
||||
&obsa, 0);
|
||||
if (error == 0 && uap->oact != NULL) {
|
||||
bsd_to_ibcs2_sigaction(&obsa, &isa);
|
||||
error = copyout(&isa, uap->oact, sizeof(isa));
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigsys(struct thread *td, struct ibcs2_sigsys_args *uap)
|
||||
{
|
||||
struct proc *p = td->td_proc;
|
||||
struct sigaction sa;
|
||||
int signum = IBCS2_SIGNO(uap->sig);
|
||||
int error;
|
||||
|
||||
if (signum <= 0 || signum > IBCS2_NSIG) {
|
||||
if (IBCS2_SIGCALL(uap->sig) == IBCS2_SIGNAL_MASK ||
|
||||
IBCS2_SIGCALL(uap->sig) == IBCS2_SIGSET_MASK)
|
||||
td->td_retval[0] = (int)IBCS2_SIG_ERR;
|
||||
return EINVAL;
|
||||
}
|
||||
signum = ibcs2_to_bsd_sig[_SIG_IDX(signum)];
|
||||
|
||||
switch (IBCS2_SIGCALL(uap->sig)) {
|
||||
case IBCS2_SIGSET_MASK:
|
||||
/*
|
||||
* Check for SIG_HOLD action.
|
||||
* Otherwise, perform signal() except with different sa_flags.
|
||||
*/
|
||||
if (uap->fp != IBCS2_SIG_HOLD) {
|
||||
/* add sig to mask before exececuting signal handler */
|
||||
sa.sa_flags = 0;
|
||||
goto ibcs2_sigset;
|
||||
}
|
||||
/* else FALLTHROUGH to sighold */
|
||||
|
||||
case IBCS2_SIGHOLD_MASK:
|
||||
{
|
||||
sigset_t mask;
|
||||
|
||||
SIGEMPTYSET(mask);
|
||||
SIGADDSET(mask, signum);
|
||||
return (kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
|
||||
0));
|
||||
}
|
||||
|
||||
case IBCS2_SIGNAL_MASK:
|
||||
{
|
||||
struct sigaction osa;
|
||||
|
||||
/* do not automatically block signal */
|
||||
sa.sa_flags = SA_NODEFER;
|
||||
#ifdef SA_RESETHAND
|
||||
if((signum != IBCS2_SIGILL) &&
|
||||
(signum != IBCS2_SIGTRAP) &&
|
||||
(signum != IBCS2_SIGPWR))
|
||||
/* set to SIG_DFL before executing handler */
|
||||
sa.sa_flags |= SA_RESETHAND;
|
||||
#endif
|
||||
ibcs2_sigset:
|
||||
sa.sa_handler = uap->fp;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
#if 0
|
||||
if (signum != SIGALRM)
|
||||
sa.sa_flags |= SA_RESTART;
|
||||
#endif
|
||||
error = kern_sigaction(td, signum, &sa, &osa, 0);
|
||||
if (error != 0) {
|
||||
DPRINTF(("signal: sigaction failed: %d\n",
|
||||
error));
|
||||
td->td_retval[0] = (int)IBCS2_SIG_ERR;
|
||||
return (error);
|
||||
}
|
||||
td->td_retval[0] = (int)osa.sa_handler;
|
||||
|
||||
/* special sigset() check */
|
||||
if(IBCS2_SIGCALL(uap->sig) == IBCS2_SIGSET_MASK) {
|
||||
PROC_LOCK(p);
|
||||
/* check to make sure signal is not blocked */
|
||||
if(sigismember(&td->td_sigmask, signum)) {
|
||||
/* return SIG_HOLD and unblock signal*/
|
||||
td->td_retval[0] = (int)IBCS2_SIG_HOLD;
|
||||
SIGDELSET(td->td_sigmask, signum);
|
||||
signotify(td);
|
||||
}
|
||||
PROC_UNLOCK(p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
case IBCS2_SIGRELSE_MASK:
|
||||
{
|
||||
sigset_t mask;
|
||||
|
||||
SIGEMPTYSET(mask);
|
||||
SIGADDSET(mask, signum);
|
||||
return (kern_sigprocmask(td, SIG_UNBLOCK, &mask, NULL,
|
||||
0));
|
||||
}
|
||||
|
||||
case IBCS2_SIGIGNORE_MASK:
|
||||
{
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
error = kern_sigaction(td, signum, &sa, NULL, 0);
|
||||
if (error != 0)
|
||||
DPRINTF(("sigignore: sigaction failed\n"));
|
||||
return (error);
|
||||
}
|
||||
|
||||
case IBCS2_SIGPAUSE_MASK:
|
||||
{
|
||||
sigset_t mask;
|
||||
|
||||
PROC_LOCK(p);
|
||||
mask = td->td_sigmask;
|
||||
PROC_UNLOCK(p);
|
||||
SIGDELSET(mask, signum);
|
||||
return kern_sigsuspend(td, mask);
|
||||
}
|
||||
|
||||
default:
|
||||
return ENOSYS;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigprocmask(struct thread *td, struct ibcs2_sigprocmask_args *uap)
|
||||
{
|
||||
ibcs2_sigset_t iss;
|
||||
sigset_t oss, nss;
|
||||
sigset_t *nssp;
|
||||
int error, how;
|
||||
|
||||
switch (uap->how) {
|
||||
case IBCS2_SIG_BLOCK:
|
||||
how = SIG_BLOCK;
|
||||
break;
|
||||
case IBCS2_SIG_UNBLOCK:
|
||||
how = SIG_UNBLOCK;
|
||||
break;
|
||||
case IBCS2_SIG_SETMASK:
|
||||
how = SIG_SETMASK;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
if (uap->set != NULL) {
|
||||
if ((error = copyin(uap->set, &iss, sizeof(iss))) != 0)
|
||||
return error;
|
||||
ibcs2_to_bsd_sigset(&iss, &nss);
|
||||
nssp = &nss;
|
||||
} else
|
||||
nssp = NULL;
|
||||
error = kern_sigprocmask(td, how, nssp, &oss, 0);
|
||||
if (error == 0 && uap->oset != NULL) {
|
||||
bsd_to_ibcs2_sigset(&oss, &iss);
|
||||
error = copyout(&iss, uap->oset, sizeof(iss));
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigpending(struct thread *td, struct ibcs2_sigpending_args *uap)
|
||||
{
|
||||
struct proc *p = td->td_proc;
|
||||
sigset_t bss;
|
||||
ibcs2_sigset_t iss;
|
||||
|
||||
PROC_LOCK(p);
|
||||
bss = td->td_siglist;
|
||||
SIGSETOR(bss, p->p_siglist);
|
||||
SIGSETAND(bss, td->td_sigmask);
|
||||
PROC_UNLOCK(p);
|
||||
bsd_to_ibcs2_sigset(&bss, &iss);
|
||||
|
||||
return copyout(&iss, uap->mask, sizeof(iss));
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_sigsuspend(struct thread *td, struct ibcs2_sigsuspend_args *uap)
|
||||
{
|
||||
ibcs2_sigset_t sss;
|
||||
sigset_t bss;
|
||||
int error;
|
||||
|
||||
if ((error = copyin(uap->mask, &sss, sizeof(sss))) != 0)
|
||||
return error;
|
||||
|
||||
ibcs2_to_bsd_sigset(&sss, &bss);
|
||||
return kern_sigsuspend(td, bss);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_pause(struct thread *td, struct ibcs2_pause_args *uap)
|
||||
{
|
||||
sigset_t mask;
|
||||
|
||||
PROC_LOCK(td->td_proc);
|
||||
mask = td->td_sigmask;
|
||||
PROC_UNLOCK(td->td_proc);
|
||||
return kern_sigsuspend(td, mask);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_kill(struct thread *td, struct ibcs2_kill_args *uap)
|
||||
{
|
||||
struct kill_args ka;
|
||||
|
||||
if (uap->signo <= 0 || uap->signo > IBCS2_NSIG)
|
||||
return (EINVAL);
|
||||
ka.pid = uap->pid;
|
||||
ka.signum = ibcs2_to_bsd_sig[_SIG_IDX(uap->signo)];
|
||||
return sys_kill(td, &ka);
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
/* $NetBSD: ibcs2_signal.h,v 1.7 1995/08/14 02:26:01 mycroft Exp $ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994, 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.
|
||||
* 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 Scott Bartram.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_SIGNAL_H
|
||||
#define _IBCS2_SIGNAL_H
|
||||
|
||||
#define IBCS2_SIGHUP 1
|
||||
#define IBCS2_SIGINT 2
|
||||
#define IBCS2_SIGQUIT 3
|
||||
#define IBCS2_SIGILL 4
|
||||
#define IBCS2_SIGTRAP 5
|
||||
#define IBCS2_SIGIOT 6
|
||||
#define IBCS2_SIGABRT 6
|
||||
#define IBCS2_SIGEMT 7
|
||||
#define IBCS2_SIGFPE 8
|
||||
#define IBCS2_SIGKILL 9
|
||||
#define IBCS2_SIGBUS 10
|
||||
#define IBCS2_SIGSEGV 11
|
||||
#define IBCS2_SIGSYS 12
|
||||
#define IBCS2_SIGPIPE 13
|
||||
#define IBCS2_SIGALRM 14
|
||||
#define IBCS2_SIGTERM 15
|
||||
#define IBCS2_SIGUSR1 16
|
||||
#define IBCS2_SIGUSR2 17
|
||||
#define IBCS2_SIGCLD 18
|
||||
#define IBCS2_SIGPWR 19
|
||||
#define IBCS2_SIGWINCH 20
|
||||
#define IBCS2_SIGPOLL 22
|
||||
#define IBCS2_NSIG 32
|
||||
#define IBCS2_SIGTBLSZ 32
|
||||
|
||||
/*
|
||||
* SCO-specific
|
||||
*/
|
||||
#define IBCS2_SIGSTOP 23
|
||||
#define IBCS2_SIGTSTP 24
|
||||
#define IBCS2_SIGCONT 25
|
||||
#define IBCS2_SIGTTIN 26
|
||||
#define IBCS2_SIGTTOU 27
|
||||
#define IBCS2_SIGVTALRM 28
|
||||
#define IBCS2_SIGPROF 29
|
||||
|
||||
#define IBCS2_SIGNO_MASK 0x00FF
|
||||
#define IBCS2_SIGNAL_MASK 0x0000
|
||||
#define IBCS2_SIGSET_MASK 0x0100
|
||||
#define IBCS2_SIGHOLD_MASK 0x0200
|
||||
#define IBCS2_SIGRELSE_MASK 0x0400
|
||||
#define IBCS2_SIGIGNORE_MASK 0x0800
|
||||
#define IBCS2_SIGPAUSE_MASK 0x1000
|
||||
|
||||
#define IBCS2_SIGNO(x) ((x) & IBCS2_SIGNO_MASK)
|
||||
#define IBCS2_SIGCALL(x) ((x) & ~IBCS2_SIGNO_MASK)
|
||||
|
||||
typedef long ibcs2_sigset_t;
|
||||
typedef void (*ibcs2_sig_t)(int);
|
||||
|
||||
struct ibcs2_sigaction {
|
||||
ibcs2_sig_t isa_handler;
|
||||
ibcs2_sigset_t isa_mask;
|
||||
int isa_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
|
||||
|
||||
#define IBCS2_MINSIGSTKSZ 8192
|
||||
|
||||
extern int bsd_to_ibcs2_sig[];
|
||||
|
||||
#endif /* _IBCS2_SIGNAL_H */
|
@ -1,206 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 1994, 1995 Scott Bartram
|
||||
* Copyright (c) 1994 Arne H Juul
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/jail.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_socksys.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
/* Local structures */
|
||||
struct getipdomainname_args {
|
||||
char *ipdomainname;
|
||||
int len;
|
||||
};
|
||||
|
||||
struct setipdomainname_args {
|
||||
char *ipdomainname;
|
||||
int len;
|
||||
};
|
||||
|
||||
/* Local prototypes */
|
||||
static int ibcs2_getipdomainname(struct thread *,
|
||||
struct getipdomainname_args *);
|
||||
static int ibcs2_setipdomainname(struct thread *,
|
||||
struct setipdomainname_args *);
|
||||
|
||||
/*
|
||||
* iBCS2 socksys calls.
|
||||
*/
|
||||
|
||||
int
|
||||
ibcs2_socksys(struct thread *td, struct ibcs2_socksys_args *uap)
|
||||
{
|
||||
int error;
|
||||
int realargs[7]; /* 1 for command, 6 for recvfrom */
|
||||
void *passargs;
|
||||
|
||||
/*
|
||||
* SOCKET should only be legal on /dev/socksys.
|
||||
* GETIPDOMAINNAME should only be legal on /dev/socksys ?
|
||||
* The others are (and should be) only legal on sockets.
|
||||
*/
|
||||
|
||||
if ((error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs))) != 0)
|
||||
return error;
|
||||
DPRINTF(("ibcs2_socksys: %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
realargs[0], realargs[1], realargs[2], realargs[3],
|
||||
realargs[4], realargs[5], realargs[6]));
|
||||
|
||||
passargs = (void *)(realargs + 1);
|
||||
switch (realargs[0]) {
|
||||
case SOCKSYS_ACCEPT:
|
||||
return sys_accept(td, passargs);
|
||||
case SOCKSYS_BIND:
|
||||
return sys_bind(td, passargs);
|
||||
case SOCKSYS_CONNECT:
|
||||
return sys_connect(td, passargs);
|
||||
case SOCKSYS_GETPEERNAME:
|
||||
return sys_getpeername(td, passargs);
|
||||
case SOCKSYS_GETSOCKNAME:
|
||||
return sys_getsockname(td, passargs);
|
||||
case SOCKSYS_GETSOCKOPT:
|
||||
return sys_getsockopt(td, passargs);
|
||||
case SOCKSYS_LISTEN:
|
||||
return sys_listen(td, passargs);
|
||||
case SOCKSYS_RECV:
|
||||
realargs[5] = realargs[6] = 0;
|
||||
/* FALLTHROUGH */
|
||||
case SOCKSYS_RECVFROM:
|
||||
return sys_recvfrom(td, passargs);
|
||||
case SOCKSYS_SEND:
|
||||
realargs[5] = realargs[6] = 0;
|
||||
/* FALLTHROUGH */
|
||||
case SOCKSYS_SENDTO:
|
||||
return sys_sendto(td, passargs);
|
||||
case SOCKSYS_SETSOCKOPT:
|
||||
return sys_setsockopt(td, passargs);
|
||||
case SOCKSYS_SHUTDOWN:
|
||||
return sys_shutdown(td, passargs);
|
||||
case SOCKSYS_SOCKET:
|
||||
return sys_socket(td, passargs);
|
||||
case SOCKSYS_SELECT:
|
||||
return sys_select(td, passargs);
|
||||
case SOCKSYS_GETIPDOMAIN:
|
||||
return ibcs2_getipdomainname(td, passargs);
|
||||
case SOCKSYS_SETIPDOMAIN:
|
||||
return ibcs2_setipdomainname(td, passargs);
|
||||
case SOCKSYS_ADJTIME:
|
||||
return sys_adjtime(td, passargs);
|
||||
case SOCKSYS_SETREUID:
|
||||
return sys_setreuid(td, passargs);
|
||||
case SOCKSYS_SETREGID:
|
||||
return sys_setregid(td, passargs);
|
||||
case SOCKSYS_GETTIME:
|
||||
return sys_gettimeofday(td, passargs);
|
||||
case SOCKSYS_SETTIME:
|
||||
return sys_settimeofday(td, passargs);
|
||||
case SOCKSYS_GETITIMER:
|
||||
return sys_getitimer(td, passargs);
|
||||
case SOCKSYS_SETITIMER:
|
||||
return sys_setitimer(td, passargs);
|
||||
|
||||
default:
|
||||
printf("socksys unknown %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
realargs[0], realargs[1], realargs[2], realargs[3],
|
||||
realargs[4], realargs[5], realargs[6]);
|
||||
return EINVAL;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ibcs2_getipdomainname(struct thread *td, struct getipdomainname_args *uap)
|
||||
{
|
||||
char hname[MAXHOSTNAMELEN], *dptr;
|
||||
int len;
|
||||
|
||||
/* Get the domain name. */
|
||||
getcredhostname(td->td_ucred, hname, sizeof(hname));
|
||||
|
||||
dptr = strchr(hname, '.');
|
||||
if ( dptr )
|
||||
dptr++;
|
||||
else
|
||||
/* Make it effectively an empty string */
|
||||
dptr = hname + strlen(hname);
|
||||
|
||||
len = strlen(dptr) + 1;
|
||||
if ((u_int)uap->len > len + 1)
|
||||
uap->len = len + 1;
|
||||
return (copyout((caddr_t)dptr, (caddr_t)uap->ipdomainname, uap->len));
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ibcs2_setipdomainname(struct thread *td, struct setipdomainname_args *uap)
|
||||
{
|
||||
char hname[MAXHOSTNAMELEN], *ptr;
|
||||
int error, sctl[2], hlen;
|
||||
|
||||
/* Get the domain name */
|
||||
getcredhostname(td->td_ucred, hname, sizeof(hname));
|
||||
|
||||
/* W/out a hostname a domain-name is nonsense */
|
||||
if ( strlen(hname) == 0 )
|
||||
return EINVAL;
|
||||
|
||||
/* Get the host's unqualified name (strip off the domain) */
|
||||
ptr = strchr(hname, '.');
|
||||
if ( ptr != NULL ) {
|
||||
ptr++;
|
||||
*ptr = '\0';
|
||||
} else {
|
||||
if (strlcat(hname, ".", sizeof(hname)) >= sizeof(hname))
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/* Set ptr to the end of the string so we can append to it */
|
||||
hlen = strlen(hname);
|
||||
ptr = hname + hlen;
|
||||
if ((u_int)uap->len > (sizeof (hname) - hlen - 1))
|
||||
return EINVAL;
|
||||
|
||||
/* Append the ipdomain to the end */
|
||||
error = copyinstr((caddr_t)uap->ipdomainname, ptr, uap->len, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
/* 'sethostname' with the new information */
|
||||
sctl[0] = CTL_KERN;
|
||||
sctl[1] = KERN_HOSTNAME;
|
||||
hlen = strlen(hname) + 1;
|
||||
return (kernel_sysctl(td, sctl, 2, 0, 0, hname, hlen, 0, 0));
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 1994, 1995 Scott Bartram
|
||||
* Copyright (c) 1994 Arne H Juul
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _I386_IBCS2_IBCS2_SOCKSYS_H_
|
||||
#define _I386_IBCS2_IBCS2_SOCKSYS_H_
|
||||
|
||||
#include <sys/ioccom.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#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
|
||||
|
||||
#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)
|
||||
|
||||
#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;
|
||||
int type;
|
||||
int proto;
|
||||
ibcs2_dev_t dev;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct ibcs2_socksys_args {
|
||||
int fd;
|
||||
int magic;
|
||||
caddr_t argsp;
|
||||
};
|
||||
|
||||
int ibcs2_socksys(struct thread *, struct ibcs2_socksys_args *);
|
||||
|
||||
#endif /* !_I386_IBCS2_IBCS2_SOCKSYS_H_ */
|
@ -1,245 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* 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.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/jail.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/sysproto.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_util.h>
|
||||
#include <i386/ibcs2/ibcs2_utsname.h>
|
||||
|
||||
|
||||
static void bsd_stat2ibcs_stat(struct stat *, struct ibcs2_stat *);
|
||||
static int cvt_statfs(struct statfs *, caddr_t, int);
|
||||
|
||||
static void
|
||||
bsd_stat2ibcs_stat(st, st4)
|
||||
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_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_rdev = (ibcs2_dev_t)st->st_rdev;
|
||||
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_atim.tv_sec;
|
||||
st4->st_mtim = (ibcs2_time_t)st->st_mtim.tv_sec;
|
||||
st4->st_ctim = (ibcs2_time_t)st->st_ctim.tv_sec;
|
||||
}
|
||||
|
||||
static int
|
||||
cvt_statfs(sp, buf, len)
|
||||
struct statfs *sp;
|
||||
caddr_t buf;
|
||||
int len;
|
||||
{
|
||||
struct ibcs2_statfs ssfs;
|
||||
|
||||
if (len < 0)
|
||||
return (EINVAL);
|
||||
else if (len > sizeof(ssfs))
|
||||
len = sizeof(ssfs);
|
||||
bzero(&ssfs, sizeof ssfs);
|
||||
ssfs.f_fstyp = 0;
|
||||
ssfs.f_bsize = sp->f_bsize;
|
||||
ssfs.f_frsize = 0;
|
||||
ssfs.f_blocks = sp->f_blocks;
|
||||
ssfs.f_bfree = sp->f_bfree;
|
||||
ssfs.f_files = sp->f_files;
|
||||
ssfs.f_ffree = sp->f_ffree;
|
||||
ssfs.f_fname[0] = 0;
|
||||
ssfs.f_fpack[0] = 0;
|
||||
return copyout((caddr_t)&ssfs, buf, len);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_statfs(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_statfs_args *uap;
|
||||
{
|
||||
struct statfs *sf;
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
CHECKALTEXIST(td, uap->path, &path);
|
||||
sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
||||
error = kern_statfs(td, path, UIO_SYSSPACE, sf);
|
||||
free(path, M_TEMP);
|
||||
if (error == 0)
|
||||
error = cvt_statfs(sf, (caddr_t)uap->buf, uap->len);
|
||||
free(sf, M_STATFS);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_fstatfs(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_fstatfs_args *uap;
|
||||
{
|
||||
struct statfs *sf;
|
||||
int error;
|
||||
|
||||
sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
||||
error = kern_fstatfs(td, uap->fd, sf);
|
||||
if (error == 0)
|
||||
error = cvt_statfs(sf, (caddr_t)uap->buf, uap->len);
|
||||
free(sf, M_STATFS);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_stat(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_stat_args *uap;
|
||||
{
|
||||
struct ibcs2_stat ibcs2_st;
|
||||
struct stat st;
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
CHECKALTEXIST(td, uap->path, &path);
|
||||
|
||||
error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, NULL);
|
||||
free(path, M_TEMP);
|
||||
if (error)
|
||||
return (error);
|
||||
bsd_stat2ibcs_stat(&st, &ibcs2_st);
|
||||
return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
|
||||
ibcs2_stat_len);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_lstat(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_lstat_args *uap;
|
||||
{
|
||||
struct ibcs2_stat ibcs2_st;
|
||||
struct stat st;
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
CHECKALTEXIST(td, uap->path, &path);
|
||||
|
||||
error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path,
|
||||
UIO_SYSSPACE, &st, NULL);
|
||||
free(path, M_TEMP);
|
||||
if (error)
|
||||
return (error);
|
||||
bsd_stat2ibcs_stat(&st, &ibcs2_st);
|
||||
return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
|
||||
ibcs2_stat_len);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_fstat(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_fstat_args *uap;
|
||||
{
|
||||
struct ibcs2_stat ibcs2_st;
|
||||
struct stat st;
|
||||
int error;
|
||||
|
||||
error = kern_fstat(td, uap->fd, &st);
|
||||
if (error)
|
||||
return (error);
|
||||
bsd_stat2ibcs_stat(&st, &ibcs2_st);
|
||||
return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
|
||||
ibcs2_stat_len);
|
||||
}
|
||||
|
||||
int
|
||||
ibcs2_utssys(td, uap)
|
||||
struct thread *td;
|
||||
struct ibcs2_utssys_args *uap;
|
||||
{
|
||||
switch (uap->flag) {
|
||||
case 0: /* uname(2) */
|
||||
{
|
||||
char machine_name[9], *p;
|
||||
struct ibcs2_utsname sut;
|
||||
bzero(&sut, ibcs2_utsname_len);
|
||||
|
||||
strncpy(sut.sysname,
|
||||
IBCS2_UNAME_SYSNAME, sizeof(sut.sysname) - 1);
|
||||
strncpy(sut.release,
|
||||
IBCS2_UNAME_RELEASE, sizeof(sut.release) - 1);
|
||||
strncpy(sut.version,
|
||||
IBCS2_UNAME_VERSION, sizeof(sut.version) - 1);
|
||||
getcredhostname(td->td_ucred, machine_name,
|
||||
sizeof(machine_name) - 1);
|
||||
p = strchr(machine_name, '.');
|
||||
if ( p )
|
||||
*p = '\0';
|
||||
strncpy(sut.nodename, machine_name, sizeof(sut.nodename) - 1);
|
||||
strncpy(sut.machine, machine, sizeof(sut.machine) - 1);
|
||||
|
||||
DPRINTF(("IBCS2 uname: sys=%s rel=%s ver=%s node=%s mach=%s\n",
|
||||
sut.sysname, sut.release, sut.version, sut.nodename,
|
||||
sut.machine));
|
||||
return copyout((caddr_t)&sut, (caddr_t)uap->a1,
|
||||
ibcs2_utsname_len);
|
||||
}
|
||||
|
||||
case 2: /* ustat(2) */
|
||||
{
|
||||
return ENOSYS; /* XXX - TODO */
|
||||
}
|
||||
|
||||
default:
|
||||
return ENOSYS;
|
||||
}
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
/* $NetBSD: ibcs2_stat.h,v 1.2 1994/10/26 02:53:03 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_STAT_H
|
||||
#define _IBCS2_STAT_H
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_stat {
|
||||
ibcs2_dev_t st_dev;
|
||||
ibcs2_ino_t st_ino;
|
||||
ibcs2_mode_t st_mode;
|
||||
ibcs2_nlink_t st_nlink;
|
||||
ibcs2_uid_t st_uid;
|
||||
ibcs2_gid_t st_gid;
|
||||
ibcs2_dev_t st_rdev;
|
||||
ibcs2_off_t st_size;
|
||||
ibcs2_time_t st_atim;
|
||||
ibcs2_time_t st_mtim;
|
||||
ibcs2_time_t st_ctim;
|
||||
};
|
||||
|
||||
#define ibcs2_stat_len (sizeof(struct ibcs2_stat))
|
||||
|
||||
#define IBCS2_S_IFMT 0xf000
|
||||
#define IBCS2_S_IFIFO 0x1000
|
||||
#define IBCS2_S_IFCHR 0x2000
|
||||
#define IBCS2_S_IFDIR 0x4000
|
||||
#define IBCS2_S_IFBLK 0x6000
|
||||
#define IBCS2_S_IFREG 0x8000
|
||||
#define IBCS2_S_IFSOCK 0xc000
|
||||
|
||||
#define IBCS2_S_IFNAM 0x5000
|
||||
#define IBCS2_S_IFLNK 0xa000
|
||||
|
||||
#define IBCS2_S_ISUID 0x0800
|
||||
#define IBCS2_S_ISGID 0x0400
|
||||
#define IBCS2_S_ISVTX 0x0200
|
||||
|
||||
#define IBCS2_S_IRWXU 0x01c0
|
||||
#define IBCS2_S_IRUSR 0x0100
|
||||
#define IBCS2_S_IWUSR 0x0080
|
||||
#define IBCS2_S_IXUSR 0x0040
|
||||
#define IBCS2_S_IRWXG 0x0038
|
||||
#define IBCS2_S_IRGRP 0x0020
|
||||
#define IBCS2_S_IWGRP 0x000f
|
||||
#define IBCS2_S_IXGRP 0x0008
|
||||
#define IBCS2_S_IRWXO 0x0007
|
||||
#define IBCS2_S_IROTH 0x0004
|
||||
#define IBCS2_S_IWOTH 0x0002
|
||||
#define IBCS2_S_IXOTH 0x0001
|
||||
|
||||
#define IBCS2_S_ISFIFO(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFIFO)
|
||||
#define IBCS2_S_ISCHR(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFCHR)
|
||||
#define IBCS2_S_ISDIR(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFDIR)
|
||||
#define IBCS2_S_ISBLK(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFBLK)
|
||||
#define IBCS2_S_ISREG(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFREG)
|
||||
#define IBCS2_S_ISSOCK(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFSOCK)
|
||||
|
||||
#endif /* _IBCS2_STAT_H */
|
@ -1,51 +0,0 @@
|
||||
/* $NetBSD: ibcs2_statfs.h,v 1.2 1994/10/26 02:53:06 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_STATFS_H
|
||||
#define _IBCS2_STATFS_H
|
||||
|
||||
struct ibcs2_statfs {
|
||||
short f_fstyp;
|
||||
long f_bsize;
|
||||
long f_frsize;
|
||||
long f_blocks;
|
||||
long f_bfree;
|
||||
long f_files;
|
||||
long f_ffree;
|
||||
char f_fname[6];
|
||||
char f_fpack[6];
|
||||
};
|
||||
|
||||
#endif /* _IBCS2_STATFS_H */
|
@ -1,52 +0,0 @@
|
||||
/*-
|
||||
* ibcs2_stropts.h
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_STROPTS_H
|
||||
#define _IBCS2_STROPTS_H
|
||||
|
||||
#define IBCS2_STR ('S'<<8)
|
||||
#define IBCS2_I_NREAD (IBCS2_STR|01)
|
||||
#define IBCS2_I_PUSH (IBCS2_STR|02)
|
||||
#define IBCS2_I_POP (IBCS2_STR|03)
|
||||
#define IBCS2_I_LOOK (IBCS2_STR|04)
|
||||
#define IBCS2_I_FLUSH (IBCS2_STR|05)
|
||||
#define IBCS2_I_SRDOPT (IBCS2_STR|06)
|
||||
#define IBCS2_I_GRDOPT (IBCS2_STR|07)
|
||||
#define IBCS2_I_STR (IBCS2_STR|010)
|
||||
#define IBCS2_I_SETSIG (IBCS2_STR|011)
|
||||
#define IBCS2_I_GETSIG (IBCS2_STR|012)
|
||||
#define IBCS2_I_FIND (IBCS2_STR|013)
|
||||
#define IBCS2_I_LINK (IBCS2_STR|014)
|
||||
#define IBCS2_I_UNLINK (IBCS2_STR|015)
|
||||
#define IBCS2_I_PEEK (IBCS2_STR|017)
|
||||
#define IBCS2_I_FDINSERT (IBCS2_STR|020)
|
||||
#define IBCS2_I_SENDFD (IBCS2_STR|021)
|
||||
#define IBCS2_I_RECVFD (IBCS2_STR|022)
|
||||
|
||||
#endif /* _IBCS2_STROPTS_H */
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* System call numbers.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define IBCS2_SYS_syscall 0
|
||||
#define IBCS2_SYS_exit 1
|
||||
#define IBCS2_SYS_fork 2
|
||||
#define IBCS2_SYS_ibcs2_read 3
|
||||
#define IBCS2_SYS_write 4
|
||||
#define IBCS2_SYS_ibcs2_open 5
|
||||
#define IBCS2_SYS_close 6
|
||||
#define IBCS2_SYS_ibcs2_wait 7
|
||||
#define IBCS2_SYS_ibcs2_creat 8
|
||||
#define IBCS2_SYS_link 9
|
||||
#define IBCS2_SYS_ibcs2_unlink 10
|
||||
#define IBCS2_SYS_ibcs2_execv 11
|
||||
#define IBCS2_SYS_ibcs2_chdir 12
|
||||
#define IBCS2_SYS_ibcs2_time 13
|
||||
#define IBCS2_SYS_ibcs2_mknod 14
|
||||
#define IBCS2_SYS_ibcs2_chmod 15
|
||||
#define IBCS2_SYS_ibcs2_chown 16
|
||||
#define IBCS2_SYS_break 17
|
||||
#define IBCS2_SYS_ibcs2_stat 18
|
||||
#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_access 33
|
||||
#define IBCS2_SYS_ibcs2_nice 34
|
||||
#define IBCS2_SYS_ibcs2_statfs 35
|
||||
#define IBCS2_SYS_sync 36
|
||||
#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
|
||||
#define IBCS2_SYS_ibcs2_fcntl 62
|
||||
#define IBCS2_SYS_ibcs2_ulimit 63
|
||||
/* 70 is obsolete rfs_advfs */
|
||||
/* 71 is obsolete rfs_unadvfs */
|
||||
/* 72 is obsolete rfs_rmount */
|
||||
/* 73 is obsolete rfs_rumount */
|
||||
/* 74 is obsolete rfs_rfstart */
|
||||
/* 75 is obsolete rfs_sigret */
|
||||
/* 76 is obsolete rfs_rdebug */
|
||||
/* 77 is obsolete rfs_rfstop */
|
||||
#define IBCS2_SYS_ibcs2_rmdir 79
|
||||
#define IBCS2_SYS_ibcs2_mkdir 80
|
||||
#define IBCS2_SYS_ibcs2_getdents 81
|
||||
#define IBCS2_SYS_ibcs2_sysfs 84
|
||||
#define IBCS2_SYS_ibcs2_getmsg 85
|
||||
#define IBCS2_SYS_ibcs2_putmsg 86
|
||||
#define IBCS2_SYS_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_ibcs2_isc 105
|
||||
#define IBCS2_SYS_MAXSYSCALL 128
|
@ -1,147 +0,0 @@
|
||||
/*
|
||||
* System call switch table.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#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_proto.h>
|
||||
|
||||
#define AS(name) (sizeof(struct name) / sizeof(register_t))
|
||||
|
||||
/* The casts are bogus but will do for now. */
|
||||
struct sysent ibcs2_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */
|
||||
{ AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */
|
||||
{ 0, (sy_call_t *)sys_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = fork */
|
||||
{ AS(ibcs2_read_args), (sy_call_t *)ibcs2_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = ibcs2_read */
|
||||
{ AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */
|
||||
{ AS(ibcs2_open_args), (sy_call_t *)ibcs2_open, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = ibcs2_open */
|
||||
{ AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = close */
|
||||
{ AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = ibcs2_wait */
|
||||
{ AS(ibcs2_creat_args), (sy_call_t *)ibcs2_creat, AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = ibcs2_creat */
|
||||
{ AS(link_args), (sy_call_t *)sys_link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */
|
||||
{ AS(ibcs2_unlink_args), (sy_call_t *)ibcs2_unlink, AUE_UNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = ibcs2_unlink */
|
||||
{ AS(ibcs2_execv_args), (sy_call_t *)ibcs2_execv, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = ibcs2_execv */
|
||||
{ AS(ibcs2_chdir_args), (sy_call_t *)ibcs2_chdir, AUE_CHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = ibcs2_chdir */
|
||||
{ AS(ibcs2_time_args), (sy_call_t *)ibcs2_time, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = ibcs2_time */
|
||||
{ AS(ibcs2_mknod_args), (sy_call_t *)ibcs2_mknod, AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = ibcs2_mknod */
|
||||
{ AS(ibcs2_chmod_args), (sy_call_t *)ibcs2_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = ibcs2_chmod */
|
||||
{ AS(ibcs2_chown_args), (sy_call_t *)ibcs2_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = ibcs2_chown */
|
||||
{ AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */
|
||||
{ AS(ibcs2_stat_args), (sy_call_t *)ibcs2_stat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = ibcs2_stat */
|
||||
{ AS(ibcs2_lseek_args), (sy_call_t *)ibcs2_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = ibcs2_lseek */
|
||||
{ 0, (sy_call_t *)sys_getpid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */
|
||||
{ AS(ibcs2_mount_args), (sy_call_t *)ibcs2_mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = ibcs2_mount */
|
||||
{ AS(ibcs2_umount_args), (sy_call_t *)ibcs2_umount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = ibcs2_umount */
|
||||
{ AS(ibcs2_setuid_args), (sy_call_t *)ibcs2_setuid, AUE_SETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = ibcs2_setuid */
|
||||
{ 0, (sy_call_t *)sys_getuid, AUE_GETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = getuid */
|
||||
{ AS(ibcs2_stime_args), (sy_call_t *)ibcs2_stime, AUE_SETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = ibcs2_stime */
|
||||
{ AS(ptrace_args), (sy_call_t *)sys_ptrace, AUE_PTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = ptrace */
|
||||
{ AS(ibcs2_alarm_args), (sy_call_t *)ibcs2_alarm, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = ibcs2_alarm */
|
||||
{ AS(ibcs2_fstat_args), (sy_call_t *)ibcs2_fstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = ibcs2_fstat */
|
||||
{ 0, (sy_call_t *)ibcs2_pause, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = ibcs2_pause */
|
||||
{ AS(ibcs2_utime_args), (sy_call_t *)ibcs2_utime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = ibcs2_utime */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 31 = ibcs2_stty */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 32 = ibcs2_gtty */
|
||||
{ AS(ibcs2_access_args), (sy_call_t *)ibcs2_access, AUE_ACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 33 = ibcs2_access */
|
||||
{ AS(ibcs2_nice_args), (sy_call_t *)ibcs2_nice, AUE_NICE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = ibcs2_nice */
|
||||
{ AS(ibcs2_statfs_args), (sy_call_t *)ibcs2_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 35 = ibcs2_statfs */
|
||||
{ 0, (sy_call_t *)sys_sync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = sync */
|
||||
{ AS(ibcs2_kill_args), (sy_call_t *)ibcs2_kill, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = ibcs2_kill */
|
||||
{ AS(ibcs2_fstatfs_args), (sy_call_t *)ibcs2_fstatfs, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 38 = ibcs2_fstatfs */
|
||||
{ AS(ibcs2_pgrpsys_args), (sy_call_t *)ibcs2_pgrpsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = ibcs2_pgrpsys */
|
||||
{ AS(ibcs2_xenix_args), (sy_call_t *)ibcs2_xenix, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = ibcs2_xenix */
|
||||
{ AS(dup_args), (sy_call_t *)sys_dup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */
|
||||
{ 0, (sy_call_t *)sys_pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */
|
||||
{ AS(ibcs2_times_args), (sy_call_t *)ibcs2_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = ibcs2_times */
|
||||
{ AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = profil */
|
||||
{ AS(ibcs2_plock_args), (sy_call_t *)ibcs2_plock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ibcs2_plock */
|
||||
{ AS(ibcs2_setgid_args), (sy_call_t *)ibcs2_setgid, AUE_SETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = ibcs2_setgid */
|
||||
{ 0, (sy_call_t *)sys_getgid, AUE_GETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = getgid */
|
||||
{ AS(ibcs2_sigsys_args), (sy_call_t *)ibcs2_sigsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = ibcs2_sigsys */
|
||||
{ AS(ibcs2_msgsys_args), (sy_call_t *)ibcs2_msgsys, AUE_MSGSYS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 49 = ibcs2_msgsys */
|
||||
{ AS(ibcs2_sysi86_args), (sy_call_t *)ibcs2_sysi86, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = ibcs2_sysi86 */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 51 = ibcs2_acct */
|
||||
{ AS(ibcs2_shmsys_args), (sy_call_t *)ibcs2_shmsys, AUE_SHMSYS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 52 = ibcs2_shmsys */
|
||||
{ AS(ibcs2_semsys_args), (sy_call_t *)ibcs2_semsys, AUE_SEMSYS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 53 = ibcs2_semsys */
|
||||
{ AS(ibcs2_ioctl_args), (sy_call_t *)ibcs2_ioctl, AUE_IOCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 54 = ibcs2_ioctl */
|
||||
{ AS(ibcs2_uadmin_args), (sy_call_t *)ibcs2_uadmin, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = ibcs2_uadmin */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 56 = nosys */
|
||||
{ AS(ibcs2_utssys_args), (sy_call_t *)ibcs2_utssys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = ibcs2_utssys */
|
||||
{ AS(fsync_args), (sy_call_t *)sys_fsync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 58 = fsync */
|
||||
{ AS(ibcs2_execve_args), (sy_call_t *)ibcs2_execve, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 59 = ibcs2_execve */
|
||||
{ AS(umask_args), (sy_call_t *)sys_umask, AUE_UMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 60 = umask */
|
||||
{ AS(chroot_args), (sy_call_t *)sys_chroot, AUE_CHROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 61 = chroot */
|
||||
{ AS(ibcs2_fcntl_args), (sy_call_t *)ibcs2_fcntl, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 62 = ibcs2_fcntl */
|
||||
{ AS(ibcs2_ulimit_args), (sy_call_t *)ibcs2_ulimit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 63 = ibcs2_ulimit */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 64 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 65 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 66 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 67 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 69 = reserved for unix/pc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 70 = obsolete rfs_advfs */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 71 = obsolete rfs_unadvfs */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 72 = obsolete rfs_rmount */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 73 = obsolete rfs_rumount */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 74 = obsolete rfs_rfstart */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 75 = obsolete rfs_sigret */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 76 = obsolete rfs_rdebug */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 77 = obsolete rfs_rfstop */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 78 = rfs_rfsys */
|
||||
{ AS(ibcs2_rmdir_args), (sy_call_t *)ibcs2_rmdir, AUE_RMDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 79 = ibcs2_rmdir */
|
||||
{ AS(ibcs2_mkdir_args), (sy_call_t *)ibcs2_mkdir, AUE_MKDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 80 = ibcs2_mkdir */
|
||||
{ AS(ibcs2_getdents_args), (sy_call_t *)ibcs2_getdents, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 81 = ibcs2_getdents */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 82 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 83 = nosys */
|
||||
{ AS(ibcs2_sysfs_args), (sy_call_t *)ibcs2_sysfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 84 = ibcs2_sysfs */
|
||||
{ AS(ibcs2_getmsg_args), (sy_call_t *)ibcs2_getmsg, AUE_GETMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = ibcs2_getmsg */
|
||||
{ AS(ibcs2_putmsg_args), (sy_call_t *)ibcs2_putmsg, AUE_PUTMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = ibcs2_putmsg */
|
||||
{ AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 87 = poll */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 88 = nosys */
|
||||
{ AS(ibcs2_secure_args), (sy_call_t *)ibcs2_secure, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = ibcs2_secure */
|
||||
{ AS(ibcs2_symlink_args), (sy_call_t *)ibcs2_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 90 = ibcs2_symlink */
|
||||
{ AS(ibcs2_lstat_args), (sy_call_t *)ibcs2_lstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 91 = ibcs2_lstat */
|
||||
{ AS(ibcs2_readlink_args), (sy_call_t *)ibcs2_readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 92 = ibcs2_readlink */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 93 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 94 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 95 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 96 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 97 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 98 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 99 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 100 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 101 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 102 = nosys */
|
||||
{ AS(sigreturn_args), (sy_call_t *)sys_sigreturn, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 103 = sigreturn */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 104 = nosys */
|
||||
{ 0, (sy_call_t *)ibcs2_isc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 105 = ibcs2_isc */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 106 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 107 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 108 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 109 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 110 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 111 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 112 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 113 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 114 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 115 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 116 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 117 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 118 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 119 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 120 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 121 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 122 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 123 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 124 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 125 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 126 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 127 = nosys */
|
||||
};
|
@ -1,98 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* 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
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/systm.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
|
||||
|
||||
extern int hw_float;
|
||||
|
||||
int
|
||||
ibcs2_sysi86(struct thread *td, struct ibcs2_sysi86_args *args)
|
||||
{
|
||||
switch (args->cmd) {
|
||||
case SI86_FPHW: { /* Floating Point information */
|
||||
int val, error;
|
||||
|
||||
if (hw_float)
|
||||
val = IBCS2_FP_387;
|
||||
else
|
||||
val = IBCS2_FP_NO;
|
||||
if ((error = copyout(&val, args->arg, sizeof(val))) != 0)
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
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[2];
|
||||
|
||||
name[0] = CTL_KERN;
|
||||
name[1] = KERN_HOSTNAME;
|
||||
return (userland_sysctl(td, name, 2, 0, 0, 0,
|
||||
args->arg, 7, 0, 0));
|
||||
}
|
||||
|
||||
case SI86_MEM: /* size of physical memory */
|
||||
td->td_retval[0] = ctob(physmem);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
#ifdef DIAGNOSTIC
|
||||
printf("IBCS2: 'sysi86' function %d(0x%x) "
|
||||
"not implemented yet\n", args->cmd, args->cmd);
|
||||
#endif
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/imgact.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sx.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_param.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_syscall.h>
|
||||
#include <i386/ibcs2/ibcs2_signal.h>
|
||||
|
||||
MODULE_VERSION(ibcs2, 1);
|
||||
|
||||
extern int bsd_to_ibcs2_errno[];
|
||||
extern struct sysent ibcs2_sysent[IBCS2_SYS_MAXSYSCALL];
|
||||
static int ibcs2_fixup(register_t **, struct image_params *);
|
||||
|
||||
struct sysentvec ibcs2_svr3_sysvec = {
|
||||
.sv_size = nitems(ibcs2_sysent),
|
||||
.sv_table = ibcs2_sysent,
|
||||
.sv_mask = 0xff,
|
||||
.sv_sigsize = IBCS2_SIGTBLSZ,
|
||||
.sv_sigtbl = bsd_to_ibcs2_sig,
|
||||
.sv_errsize = ELAST + 1,
|
||||
.sv_errtbl = bsd_to_ibcs2_errno,
|
||||
.sv_transtrap = NULL,
|
||||
.sv_fixup = ibcs2_fixup,
|
||||
.sv_sendsig = sendsig,
|
||||
.sv_sigcode = sigcode, /* use generic trampoline */
|
||||
.sv_szsigcode = &szsigcode,
|
||||
.sv_prepsyscall = NULL,
|
||||
.sv_name = "IBCS2 COFF",
|
||||
.sv_coredump = NULL, /* we don't have a COFF coredump function */
|
||||
.sv_imgact_try = NULL,
|
||||
.sv_minsigstksz = IBCS2_MINSIGSTKSZ,
|
||||
.sv_pagesize = PAGE_SIZE,
|
||||
.sv_minuser = VM_MIN_ADDRESS,
|
||||
.sv_maxuser = VM_MAXUSER_ADDRESS,
|
||||
.sv_usrstack = USRSTACK,
|
||||
.sv_psstrings = PS_STRINGS,
|
||||
.sv_stackprot = VM_PROT_ALL,
|
||||
.sv_copyout_strings = exec_copyout_strings,
|
||||
.sv_setregs = exec_setregs,
|
||||
.sv_fixlimit = NULL,
|
||||
.sv_maxssiz = NULL,
|
||||
.sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32,
|
||||
.sv_set_syscall_retval = cpu_set_syscall_retval,
|
||||
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
|
||||
.sv_syscallnames = NULL,
|
||||
.sv_schedtail = NULL,
|
||||
.sv_thread_detach = NULL,
|
||||
.sv_trap = NULL,
|
||||
};
|
||||
|
||||
static int
|
||||
ibcs2_fixup(register_t **stack_base, struct image_params *imgp)
|
||||
{
|
||||
|
||||
return (suword(--(*stack_base), imgp->args->argc));
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an "ibcs2" module that does nothing but allow checking for
|
||||
* the presence of the subsystem.
|
||||
*/
|
||||
static int
|
||||
ibcs2_modevent(module_t mod, int type, void *unused)
|
||||
{
|
||||
struct proc *p = NULL;
|
||||
int rval = 0;
|
||||
|
||||
switch(type) {
|
||||
case MOD_LOAD:
|
||||
break;
|
||||
case MOD_UNLOAD:
|
||||
/* if this was an ELF module we'd use elf_brand_inuse()... */
|
||||
sx_slock(&allproc_lock);
|
||||
FOREACH_PROC_IN_SYSTEM(p) {
|
||||
if (p->p_sysent == &ibcs2_svr3_sysvec) {
|
||||
rval = EBUSY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sx_sunlock(&allproc_lock);
|
||||
break;
|
||||
default:
|
||||
rval = EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
return (rval);
|
||||
}
|
||||
static moduledata_t ibcs2_mod = {
|
||||
"ibcs2",
|
||||
ibcs2_modevent,
|
||||
0
|
||||
};
|
||||
DECLARE_MODULE_TIED(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
|
@ -1,238 +0,0 @@
|
||||
/* $NetBSD: ibcs2_termios.h,v 1.3 1994/10/26 02:53:07 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_TERMIOS_H
|
||||
#define _IBCS2_TERMIOS_H 1
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
#define IBCS2_NCC 8
|
||||
#define IBCS2_NCCS 13
|
||||
|
||||
typedef u_short ibcs2_tcflag_t;
|
||||
typedef u_char ibcs2_cc_t;
|
||||
typedef u_long ibcs2_speed_t;
|
||||
|
||||
struct ibcs2_termio {
|
||||
u_short c_iflag;
|
||||
u_short c_oflag;
|
||||
u_short c_cflag;
|
||||
u_short c_lflag;
|
||||
char c_line;
|
||||
u_char c_cc[IBCS2_NCC];
|
||||
};
|
||||
|
||||
struct ibcs2_termios {
|
||||
ibcs2_tcflag_t c_iflag;
|
||||
ibcs2_tcflag_t c_oflag;
|
||||
ibcs2_tcflag_t c_cflag;
|
||||
ibcs2_tcflag_t c_lflag;
|
||||
char c_line;
|
||||
ibcs2_cc_t c_cc[IBCS2_NCCS];
|
||||
char c_ispeed;
|
||||
char c_ospeed;
|
||||
};
|
||||
|
||||
#define IBCS2_VINTR 0
|
||||
#define IBCS2_VQUIT 1
|
||||
#define IBCS2_VERASE 2
|
||||
#define IBCS2_VKILL 3
|
||||
#define IBCS2_VEOF 4
|
||||
#define IBCS2_VEOL 5
|
||||
#define IBCS2_VEOL2 6
|
||||
#define IBCS2_VMIN 4
|
||||
#define IBCS2_VTIME 5
|
||||
#define IBCS2_VSWTCH 7
|
||||
#define IBCS2_VSUSP 10
|
||||
#define IBCS2_VSTART 11
|
||||
#define IBCS2_VSTOP 12
|
||||
|
||||
#define IBCS2_CNUL 0
|
||||
#define IBCS2_CDEL 0377
|
||||
#define IBCS2_CESC '\\'
|
||||
#define IBCS2_CINTR 0177
|
||||
#define IBCS2_CQUIT 034
|
||||
#define IBCS2_CERASE '#'
|
||||
#define IBCS2_CKILL '@'
|
||||
#define IBCS2_CSTART 021
|
||||
#define IBCS2_CSTOP 023
|
||||
#define IBCS2_CSWTCH 032
|
||||
#define IBCS2_CNSWTCH 0
|
||||
#define IBCS2_CSUSP 032
|
||||
|
||||
#define IBCS2_IGNBRK 0000001
|
||||
#define IBCS2_BRKINT 0000002
|
||||
#define IBCS2_IGNPAR 0000004
|
||||
#define IBCS2_PARMRK 0000010
|
||||
#define IBCS2_INPCK 0000020
|
||||
#define IBCS2_ISTRIP 0000040
|
||||
#define IBCS2_INLCR 0000100
|
||||
#define IBCS2_IGNCR 0000200
|
||||
#define IBCS2_ICRNL 0000400
|
||||
#define IBCS2_IUCLC 0001000
|
||||
#define IBCS2_IXON 0002000
|
||||
#define IBCS2_IXANY 0004000
|
||||
#define IBCS2_IXOFF 0010000
|
||||
#define IBCS2_IMAXBEL 0020000
|
||||
#define IBCS2_DOSMODE 0100000
|
||||
|
||||
#define IBCS2_OPOST 0000001
|
||||
#define IBCS2_OLCUC 0000002
|
||||
#define IBCS2_ONLCR 0000004
|
||||
#define IBCS2_OCRNL 0000010
|
||||
#define IBCS2_ONOCR 0000020
|
||||
#define IBCS2_ONLRET 0000040
|
||||
#define IBCS2_OFILL 0000100
|
||||
#define IBCS2_OFDEL 0000200
|
||||
#define IBCS2_NLDLY 0000400
|
||||
#define IBCS2_NL0 0000000
|
||||
#define IBCS2_NL1 0000400
|
||||
#define IBCS2_CRDLY 0003000
|
||||
#define IBCS2_CR0 0000000
|
||||
#define IBCS2_CR1 0001000
|
||||
#define IBCS2_CR2 0002000
|
||||
#define IBCS2_CR3 0003000
|
||||
#define IBCS2_TABDLY 0014000
|
||||
#define IBCS2_TAB0 0000000
|
||||
#define IBCS2_TAB1 0004000
|
||||
#define IBCS2_TAB2 0010000
|
||||
#define IBCS2_TAB3 0014000
|
||||
#define IBCS2_BSDLY 0020000
|
||||
#define IBCS2_BS0 0000000
|
||||
#define IBCS2_BS1 0020000
|
||||
#define IBCS2_VTDLY 0040000
|
||||
#define IBCS2_VT0 0000000
|
||||
#define IBCS2_VT1 0040000
|
||||
#define IBCS2_FFDLY 0100000
|
||||
#define IBCS2_FF0 0000000
|
||||
#define IBCS2_FF1 0100000
|
||||
|
||||
#define IBCS2_CBAUD 0000017
|
||||
#define IBCS2_CSIZE 0000060
|
||||
#define IBCS2_CS5 0000000
|
||||
#define IBCS2_CS6 0000020
|
||||
#define IBCS2_CS7 0000040
|
||||
#define IBCS2_CS8 0000060
|
||||
#define IBCS2_CSTOPB 0000100
|
||||
#define IBCS2_CREAD 0000200
|
||||
#define IBCS2_PARENB 0000400
|
||||
#define IBCS2_PARODD 0001000
|
||||
#define IBCS2_HUPCL 0002000
|
||||
#define IBCS2_CLOCAL 0004000
|
||||
#define IBCS2_RCV1EN 0010000
|
||||
#define IBCS2_XMT1EN 0020000
|
||||
#define IBCS2_LOBLK 0040000
|
||||
#define IBCS2_XCLUDE 0100000
|
||||
|
||||
#define IBCS2_ISIG 0000001
|
||||
#define IBCS2_ICANON 0000002
|
||||
#define IBCS2_XCASE 0000004
|
||||
#define IBCS2_ECHO 0000010
|
||||
#define IBCS2_ECHOE 0000020
|
||||
#define IBCS2_ECHOK 0000040
|
||||
#define IBCS2_ECHONL 0000100
|
||||
#define IBCS2_NOFLSH 0000200
|
||||
#define IBCS2_IEXTEN 0000400
|
||||
#define IBCS2_TOSTOP 0001000
|
||||
|
||||
#define IBCS2_XIOC (('i'<<24)|('X'<<16))
|
||||
#define IBCS2_XCGETA (IBCS2_XIOC|1)
|
||||
#define IBCS2_XCSETA (IBCS2_XIOC|2)
|
||||
#define IBCS2_XCSETAW (IBCS2_XIOC|3)
|
||||
#define IBCS2_XCSETAF (IBCS2_XIOC|4)
|
||||
|
||||
#define IBCS2_OXIOC ('x'<<8)
|
||||
#define IBCS2_OXCGETA (IBCS2_OXIOC|1)
|
||||
#define IBCS2_OXCSETA (IBCS2_OXIOC|2)
|
||||
#define IBCS2_OXCSETAW (IBCS2_OXIOC|3)
|
||||
#define IBCS2_OXCSETAF (IBCS2_OXIOC|4)
|
||||
|
||||
#define IBCS2_TIOC ('T'<<8)
|
||||
#define IBCS2_TCGETA (IBCS2_TIOC|1)
|
||||
#define IBCS2_TCSETA (IBCS2_TIOC|2)
|
||||
#define IBCS2_TCSETAW (IBCS2_TIOC|3)
|
||||
#define IBCS2_TCSETAF (IBCS2_TIOC|4)
|
||||
#define IBCS2_TCSBRK (IBCS2_TIOC|5)
|
||||
#define IBCS2_TCXONC (IBCS2_TIOC|6)
|
||||
#define IBCS2_TCFLSH (IBCS2_TIOC|7)
|
||||
|
||||
#define IBCS2_TCGETSC (IBCS2_TIOC|34)
|
||||
#define IBCS2_TCSETSC (IBCS2_TIOC|35)
|
||||
|
||||
#define IBCS2_TIOCSWINSZ (IBCS2_TIOC|103)
|
||||
#define IBCS2_TIOCGWINSZ (IBCS2_TIOC|104)
|
||||
#define IBCS2_TIOCSPGRP (IBCS2_TIOC|118)
|
||||
#define IBCS2_TIOCGPGRP (IBCS2_TIOC|119)
|
||||
|
||||
#define IBCS2_TCSANOW IBCS2_XCSETA
|
||||
#define IBCS2_TCSADRAIN IBCS2_XCSETAW
|
||||
#define IBCS2_TCSAFLUSH IBCS2_XCSETAF
|
||||
#define IBCS2_TCSADFLUSH IBCS2_XCSETAF
|
||||
|
||||
#define IBCS2_TCIFLUSH 0
|
||||
#define IBCS2_TCOFLUSH 1
|
||||
#define IBCS2_TCIOFLUSH 2
|
||||
|
||||
#define IBCS2_TCOOFF 0
|
||||
#define IBCS2_TCOON 1
|
||||
#define IBCS2_TCIOFF 2
|
||||
#define IBCS2_TCION 3
|
||||
|
||||
#define IBCS2_B0 0
|
||||
#define IBCS2_B50 1
|
||||
#define IBCS2_B75 2
|
||||
#define IBCS2_B110 3
|
||||
#define IBCS2_B134 4
|
||||
#define IBCS2_B150 5
|
||||
#define IBCS2_B200 6
|
||||
#define IBCS2_B300 7
|
||||
#define IBCS2_B600 8
|
||||
#define IBCS2_B1200 9
|
||||
#define IBCS2_B1800 10
|
||||
#define IBCS2_B2400 11
|
||||
#define IBCS2_B4800 12
|
||||
#define IBCS2_B9600 13
|
||||
#define IBCS2_B19200 14
|
||||
#define IBCS2_B38400 15
|
||||
|
||||
struct ibcs2_winsize {
|
||||
u_short ws_row;
|
||||
u_short ws_col;
|
||||
u_short ws_xpixel;
|
||||
u_short ws_ypixel;
|
||||
};
|
||||
|
||||
#endif /* _IBCS2_H_ */
|
||||
|
@ -1,53 +0,0 @@
|
||||
/* $NetBSD: ibcs2_time.h,v 1.2 1994/10/26 02:53:08 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_TIME_H
|
||||
#define _IBCS2_TIME_H
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_tm {
|
||||
int tm_sec;
|
||||
int tm_min;
|
||||
int tm_hour;
|
||||
int tm_mday;
|
||||
int tm_mon;
|
||||
int tm_year;
|
||||
int tm_wday;
|
||||
int tm_yday;
|
||||
int tm_isdst;
|
||||
};
|
||||
|
||||
#endif /* _IBCS2_TIME_H */
|
@ -1,57 +0,0 @@
|
||||
/* $NetBSD: ibcs2_types.h,v 1.5 1995/08/14 01:11:54 mycroft Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_TYPES_H
|
||||
#define _IBCS2_TYPES_H
|
||||
|
||||
typedef unsigned char ibcs2_uchar_t;
|
||||
typedef unsigned long ibcs2_ulong_t;
|
||||
|
||||
typedef char * ibcs2_caddr_t;
|
||||
typedef long ibcs2_daddr_t;
|
||||
typedef long ibcs2_off_t;
|
||||
typedef long ibcs2_key_t;
|
||||
typedef unsigned short ibcs2_uid_t;
|
||||
typedef unsigned short ibcs2_gid_t;
|
||||
typedef short ibcs2_nlink_t;
|
||||
typedef short ibcs2_dev_t;
|
||||
typedef unsigned short ibcs2_ino_t;
|
||||
typedef unsigned int ibcs2_size_t;
|
||||
typedef long ibcs2_time_t;
|
||||
typedef long ibcs2_clock_t;
|
||||
typedef unsigned short ibcs2_mode_t;
|
||||
typedef short ibcs2_pid_t;
|
||||
|
||||
#endif /* _IBCS2_TYPES_H */
|
@ -1,78 +0,0 @@
|
||||
/* $NetBSD: ibcs2_unistd.h,v 1.2 1994/10/26 02:53:11 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_UNISTD_H
|
||||
#define _IBCS2_UNISTD_H
|
||||
|
||||
#define IBCS2_R_OK 4
|
||||
#define IBCS2_W_OK 2
|
||||
#define IBCS2_X_OK 1
|
||||
#define IBCS2_F_OK 0
|
||||
|
||||
#define IBCS2_F_ULOCK 0
|
||||
#define IBCS2_F_LOCK 1
|
||||
#define IBCS2_F_TLOCK 2
|
||||
#define IBCS2_F_TEST 3
|
||||
|
||||
#define IBCS2_SEEK_SET 0
|
||||
#define IBCS2_SEEK_CUR 1
|
||||
#define IBCS2_SEEK_END 2
|
||||
|
||||
#define IBCS2_SC_ARG_MAX 0
|
||||
#define IBCS2_SC_CHILD_MAX 1
|
||||
#define IBCS2_SC_CLK_TCK 2
|
||||
#define IBCS2_SC_NGROUPS_MAX 3
|
||||
#define IBCS2_SC_OPEN_MAX 4
|
||||
#define IBCS2_SC_JOB_CONTROL 5
|
||||
#define IBCS2_SC_SAVED_IDS 6
|
||||
#define IBCS2_SC_VERSION 7
|
||||
#define IBCS2_SC_PASS_MAX 8
|
||||
#define IBCS2_SC_XOPEN_VERSION 9
|
||||
|
||||
#define IBCS2_PC_LINK_MAX 0
|
||||
#define IBCS2_PC_MAX_CANON 1
|
||||
#define IBCS2_PC_MAX_INPUT 2
|
||||
#define IBCS2_PC_NAME_MAX 3
|
||||
#define IBCS2_PC_PATH_MAX 4
|
||||
#define IBCS2_PC_PIPE_BUF 5
|
||||
#define IBCS2_PC_CHOWN_RESTRICTED 6
|
||||
#define IBCS2_PC_NO_TRUNC 7
|
||||
#define IBCS2_PC_VDISABLE 8
|
||||
|
||||
#define IBCS2_STDIN_FILENO 0
|
||||
#define IBCS2_STDOUT_FILENO 1
|
||||
#define IBCS2_STDERR_FILENO 2
|
||||
|
||||
#endif /* _IBCS2_UNISTD_H */
|
@ -1,49 +0,0 @@
|
||||
/* $NetBSD: ibcs2_ustat.h,v 1.2 1994/10/26 02:53:13 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_USTAT_H
|
||||
#define _IBCS2_USTAT_H 1
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_ustat {
|
||||
long f_tfree;
|
||||
ibcs2_ino_t f_tinode;
|
||||
char f_fname[6];
|
||||
char f_fpack[6];
|
||||
};
|
||||
#define ibcs2_ustat_len (sizeof(struct ibcs2_ustat))
|
||||
|
||||
#endif /* _IBCS2_USTAT_H */
|
@ -1,62 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1994 Christos Zoulas
|
||||
* Copyright (c) 1995 Frank van der Linden
|
||||
* 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.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
|
||||
const char ibcs2_emul_path[] = "/compat/ibcs2";
|
||||
|
||||
/*
|
||||
* Search an alternate path before passing pathname arguments on
|
||||
* to system calls. Useful for keeping a separate 'emulation tree'.
|
||||
*
|
||||
* If cflag is set, we check if an attempt can be made to create
|
||||
* the named file, i.e. we check if the directory it should
|
||||
* be in exists.
|
||||
*/
|
||||
int
|
||||
ibcs2_emul_find(struct thread *td, char *path, enum uio_seg pathseg,
|
||||
char **pbuf, int cflag)
|
||||
{
|
||||
|
||||
return (kern_alternate_path(td, ibcs2_emul_path, path, pathseg, pbuf,
|
||||
cflag, AT_FDCWD));
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1994 Christos Zoulas
|
||||
* Copyright (c) 1995 Frank van der Linden
|
||||
* 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.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp
|
||||
* from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is pretty much the same as Christos' svr4_util.h
|
||||
* (for now).
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_UTIL_H_
|
||||
#define _IBCS2_UTIL_H_
|
||||
|
||||
#include <sys/proc.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
#ifdef DEBUG_IBCS2
|
||||
#define DPRINTF(a) printf a;
|
||||
#else
|
||||
#define DPRINTF(a)
|
||||
#endif
|
||||
|
||||
extern const char ibcs2_emul_path[];
|
||||
|
||||
int ibcs2_emul_find(struct thread *, char *, enum uio_seg, char **, int);
|
||||
|
||||
#define CHECKALT(td, upath, pathp, i) \
|
||||
do { \
|
||||
int _error; \
|
||||
\
|
||||
_error = ibcs2_emul_find(td, upath, UIO_USERSPACE, pathp, i); \
|
||||
if (*(pathp) == NULL) \
|
||||
return (_error); \
|
||||
} while (0)
|
||||
|
||||
#define CHECKALTEXIST(td, upath, pathp) CHECKALT(td, upath, pathp, 0)
|
||||
#define CHECKALTCREAT(td, upath, pathp) CHECKALT(td, upath, pathp, 1)
|
||||
|
||||
#ifdef SPX_HACK
|
||||
int spx_open(struct thread *td);
|
||||
#endif
|
||||
|
||||
#endif /* !_IBCS2_UTIL_H_ */
|
@ -1,45 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* 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.
|
||||
* 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 Scott Bartram.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_UTIME_H
|
||||
#define _IBCS2_UTIME_H
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
|
||||
struct ibcs2_utimbuf {
|
||||
ibcs2_time_t actime;
|
||||
ibcs2_time_t modtime;
|
||||
};
|
||||
|
||||
#endif /* _IBCS2_UTIME_H */
|
@ -1,60 +0,0 @@
|
||||
/* $NetBSD: ibcs2_utsname.h,v 1.2 1994/10/26 02:53:14 cgd Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1994 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.
|
||||
* 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 Scott Bartram.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_UTSNAME_H
|
||||
#define _IBCS2_UTSNAME_H
|
||||
|
||||
#ifndef IBCS2_UNAME_SYSNAME
|
||||
#define IBCS2_UNAME_SYSNAME ostype
|
||||
#endif
|
||||
|
||||
#ifndef IBCS2_UNAME_RELEASE
|
||||
#define IBCS2_UNAME_RELEASE "3.2"
|
||||
#endif
|
||||
|
||||
#ifndef IBCS2_UNAME_VERSION
|
||||
#define IBCS2_UNAME_VERSION "2.0"
|
||||
#endif
|
||||
|
||||
struct ibcs2_utsname {
|
||||
char sysname[9];
|
||||
char nodename[9];
|
||||
char release[9];
|
||||
char version[9];
|
||||
char machine[9];
|
||||
};
|
||||
#define ibcs2_utsname_len (sizeof(struct ibcs2_utsname))
|
||||
|
||||
#endif /* _IBCS2_UTSNAME_H */
|
@ -1,219 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* 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
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/clock.h>
|
||||
#include <sys/jail.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/filio.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/unistd.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include <i386/ibcs2/ibcs2_types.h>
|
||||
#include <i386/ibcs2/ibcs2_unistd.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>
|
||||
|
||||
|
||||
extern struct sysent xenix_sysent[];
|
||||
|
||||
int
|
||||
ibcs2_xenix(struct thread *td, struct ibcs2_xenix_args *uap)
|
||||
{
|
||||
struct trapframe *tf = td->td_frame;
|
||||
struct sysent *callp;
|
||||
u_int code;
|
||||
int error;
|
||||
|
||||
code = (tf->tf_eax & 0xff00) >> 8;
|
||||
callp = &xenix_sysent[code];
|
||||
|
||||
if (code < IBCS2_XENIX_MAXSYSCALL)
|
||||
error = ((*callp->sy_call)(td, (void *)uap));
|
||||
else
|
||||
error = ENOSYS;
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
xenix_rdchk(td, uap)
|
||||
struct thread *td;
|
||||
struct xenix_rdchk_args *uap;
|
||||
{
|
||||
int data, error;
|
||||
|
||||
DPRINTF(("IBCS2: 'xenix rdchk'\n"));
|
||||
|
||||
error = kern_ioctl(td, uap->fd, FIONREAD, (caddr_t)&data);
|
||||
if (error)
|
||||
return (error);
|
||||
td->td_retval[0] = data ? 1 : 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
xenix_chsize(td, uap)
|
||||
struct thread *td;
|
||||
struct xenix_chsize_args *uap;
|
||||
{
|
||||
struct ftruncate_args sa;
|
||||
|
||||
DPRINTF(("IBCS2: 'xenix chsize'\n"));
|
||||
sa.fd = uap->fd;
|
||||
sa.length = uap->size;
|
||||
return sys_ftruncate(td, &sa);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
xenix_ftime(td, uap)
|
||||
struct thread *td;
|
||||
struct xenix_ftime_args *uap;
|
||||
{
|
||||
struct timeval tv;
|
||||
struct ibcs2_timeb {
|
||||
unsigned long time __packed;
|
||||
unsigned short millitm;
|
||||
short timezone;
|
||||
short dstflag;
|
||||
} itb;
|
||||
|
||||
DPRINTF(("IBCS2: 'xenix ftime'\n"));
|
||||
microtime(&tv);
|
||||
itb.time = tv.tv_sec;
|
||||
itb.millitm = (tv.tv_usec / 1000);
|
||||
itb.timezone = tz_minuteswest;
|
||||
itb.dstflag = tz_dsttime != DST_NONE;
|
||||
|
||||
return copyout((caddr_t)&itb, (caddr_t)uap->tp,
|
||||
sizeof(struct ibcs2_timeb));
|
||||
}
|
||||
|
||||
int
|
||||
xenix_nap(struct thread *td, struct xenix_nap_args *uap)
|
||||
{
|
||||
long period;
|
||||
|
||||
DPRINTF(("IBCS2: 'xenix nap %d ms'\n", uap->millisec));
|
||||
period = (long)uap->millisec / (1000/hz);
|
||||
if (period)
|
||||
pause("nap", period);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
xenix_utsname(struct thread *td, struct xenix_utsname_args *uap)
|
||||
{
|
||||
struct ibcs2_sco_utsname {
|
||||
char sysname[9];
|
||||
char nodename[9];
|
||||
char release[16];
|
||||
char kernelid[20];
|
||||
char machine[9];
|
||||
char bustype[9];
|
||||
char sysserial[10];
|
||||
unsigned short sysorigin;
|
||||
unsigned short sysoem;
|
||||
char numusers[9];
|
||||
unsigned short numcpu;
|
||||
} ibcs2_sco_uname;
|
||||
|
||||
DPRINTF(("IBCS2: 'xenix sco_utsname'\n"));
|
||||
bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname));
|
||||
strncpy(ibcs2_sco_uname.sysname, ostype,
|
||||
sizeof(ibcs2_sco_uname.sysname) - 1);
|
||||
getcredhostname(td->td_ucred, ibcs2_sco_uname.nodename,
|
||||
sizeof(ibcs2_sco_uname.nodename) - 1);
|
||||
strncpy(ibcs2_sco_uname.release, osrelease,
|
||||
sizeof(ibcs2_sco_uname.release) - 1);
|
||||
strncpy(ibcs2_sco_uname.kernelid, version,
|
||||
sizeof(ibcs2_sco_uname.kernelid) - 1);
|
||||
strncpy(ibcs2_sco_uname.machine, machine,
|
||||
sizeof(ibcs2_sco_uname.machine) - 1);
|
||||
strncpy(ibcs2_sco_uname.bustype, "ISA/EISA",
|
||||
sizeof(ibcs2_sco_uname.bustype) - 1);
|
||||
strncpy(ibcs2_sco_uname.sysserial, "no charge",
|
||||
sizeof(ibcs2_sco_uname.sysserial) - 1);
|
||||
strncpy(ibcs2_sco_uname.numusers, "unlim",
|
||||
sizeof(ibcs2_sco_uname.numusers) - 1);
|
||||
ibcs2_sco_uname.sysorigin = 0xFFFF;
|
||||
ibcs2_sco_uname.sysoem = 0xFFFF;
|
||||
ibcs2_sco_uname.numcpu = 1;
|
||||
return copyout((caddr_t)&ibcs2_sco_uname,
|
||||
(caddr_t)(void *)(intptr_t)uap->addr,
|
||||
sizeof(struct ibcs2_sco_utsname));
|
||||
}
|
||||
|
||||
int
|
||||
xenix_scoinfo(struct thread *td, struct xenix_scoinfo_args *uap)
|
||||
{
|
||||
/* scoinfo (not documented) */
|
||||
td->td_retval[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
xenix_eaccess(struct thread *td, struct xenix_eaccess_args *uap)
|
||||
{
|
||||
char *path;
|
||||
int error, bsd_flags;
|
||||
|
||||
bsd_flags = 0;
|
||||
if (uap->flags & IBCS2_R_OK)
|
||||
bsd_flags |= R_OK;
|
||||
if (uap->flags & IBCS2_W_OK)
|
||||
bsd_flags |= W_OK;
|
||||
if (uap->flags & IBCS2_X_OK)
|
||||
bsd_flags |= X_OK;
|
||||
|
||||
CHECKALTEXIST(td, uap->path, &path);
|
||||
error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE,
|
||||
AT_EACCESS, bsd_flags);
|
||||
free(path, M_TEMP);
|
||||
return (error);
|
||||
}
|
@ -1,160 +0,0 @@
|
||||
/*
|
||||
* System call prototypes.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb
|
||||
*/
|
||||
|
||||
#ifndef _IBCS2_XENIX_H_
|
||||
#define _IBCS2_XENIX_H_
|
||||
|
||||
#include <sys/signal.h>
|
||||
#include <sys/acl.h>
|
||||
#include <sys/cpuset.h>
|
||||
#include <sys/_semaphore.h>
|
||||
#include <sys/ucontext.h>
|
||||
|
||||
#include <bsm/audit_kevents.h>
|
||||
|
||||
struct proc;
|
||||
|
||||
struct thread;
|
||||
|
||||
#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
|
||||
0 : sizeof(register_t) - sizeof(t))
|
||||
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
#define PADL_(t) 0
|
||||
#define PADR_(t) PAD_(t)
|
||||
#else
|
||||
#define PADL_(t) PAD_(t)
|
||||
#define PADR_(t) 0
|
||||
#endif
|
||||
|
||||
struct xenix_rdchk_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
};
|
||||
struct xenix_chsize_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char size_l_[PADL_(long)]; long size; char size_r_[PADR_(long)];
|
||||
};
|
||||
struct xenix_ftime_args {
|
||||
char tp_l_[PADL_(struct timeb *)]; struct timeb * tp; char tp_r_[PADR_(struct timeb *)];
|
||||
};
|
||||
struct xenix_nap_args {
|
||||
char millisec_l_[PADL_(int)]; int millisec; char millisec_r_[PADR_(int)];
|
||||
};
|
||||
struct xenix_scoinfo_args {
|
||||
register_t dummy;
|
||||
};
|
||||
struct xenix_eaccess_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_sigaction_args {
|
||||
char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
|
||||
char act_l_[PADL_(struct ibcs2_sigaction *)]; struct ibcs2_sigaction * act; char act_r_[PADR_(struct ibcs2_sigaction *)];
|
||||
char oact_l_[PADL_(struct ibcs2_sigaction *)]; struct ibcs2_sigaction * oact; char oact_r_[PADR_(struct ibcs2_sigaction *)];
|
||||
};
|
||||
struct ibcs2_sigprocmask_args {
|
||||
char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)];
|
||||
char set_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * set; char set_r_[PADR_(ibcs2_sigset_t *)];
|
||||
char oset_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * oset; char oset_r_[PADR_(ibcs2_sigset_t *)];
|
||||
};
|
||||
struct ibcs2_sigpending_args {
|
||||
char mask_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * mask; char mask_r_[PADR_(ibcs2_sigset_t *)];
|
||||
};
|
||||
struct ibcs2_sigsuspend_args {
|
||||
char mask_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * mask; char mask_r_[PADR_(ibcs2_sigset_t *)];
|
||||
};
|
||||
struct ibcs2_getgroups_args {
|
||||
char gidsetsize_l_[PADL_(int)]; int gidsetsize; char gidsetsize_r_[PADR_(int)];
|
||||
char gidset_l_[PADL_(ibcs2_gid_t *)]; ibcs2_gid_t * gidset; char gidset_r_[PADR_(ibcs2_gid_t *)];
|
||||
};
|
||||
struct ibcs2_setgroups_args {
|
||||
char gidsetsize_l_[PADL_(int)]; int gidsetsize; char gidsetsize_r_[PADR_(int)];
|
||||
char gidset_l_[PADL_(ibcs2_gid_t *)]; ibcs2_gid_t * gidset; char gidset_r_[PADR_(ibcs2_gid_t *)];
|
||||
};
|
||||
struct ibcs2_sysconf_args {
|
||||
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_pathconf_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_fpathconf_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
|
||||
};
|
||||
struct ibcs2_rename_args {
|
||||
char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)];
|
||||
char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)];
|
||||
};
|
||||
struct xenix_utsname_args {
|
||||
char addr_l_[PADL_(long)]; long addr; char addr_r_[PADR_(long)];
|
||||
};
|
||||
int xenix_rdchk(struct thread *, struct xenix_rdchk_args *);
|
||||
int xenix_chsize(struct thread *, struct xenix_chsize_args *);
|
||||
int xenix_ftime(struct thread *, struct xenix_ftime_args *);
|
||||
int xenix_nap(struct thread *, struct xenix_nap_args *);
|
||||
int xenix_scoinfo(struct thread *, struct xenix_scoinfo_args *);
|
||||
int xenix_eaccess(struct thread *, struct xenix_eaccess_args *);
|
||||
int ibcs2_sigaction(struct thread *, struct ibcs2_sigaction_args *);
|
||||
int ibcs2_sigprocmask(struct thread *, struct ibcs2_sigprocmask_args *);
|
||||
int ibcs2_sigpending(struct thread *, struct ibcs2_sigpending_args *);
|
||||
int ibcs2_sigsuspend(struct thread *, struct ibcs2_sigsuspend_args *);
|
||||
int ibcs2_getgroups(struct thread *, struct ibcs2_getgroups_args *);
|
||||
int ibcs2_setgroups(struct thread *, struct ibcs2_setgroups_args *);
|
||||
int ibcs2_sysconf(struct thread *, struct ibcs2_sysconf_args *);
|
||||
int ibcs2_pathconf(struct thread *, struct ibcs2_pathconf_args *);
|
||||
int ibcs2_fpathconf(struct thread *, struct ibcs2_fpathconf_args *);
|
||||
int ibcs2_rename(struct thread *, struct ibcs2_rename_args *);
|
||||
int xenix_utsname(struct thread *, struct xenix_utsname_args *);
|
||||
|
||||
#ifdef COMPAT_43
|
||||
|
||||
|
||||
#endif /* COMPAT_43 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD4
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD4 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD6
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD6 */
|
||||
|
||||
|
||||
#ifdef COMPAT_FREEBSD7
|
||||
|
||||
|
||||
#endif /* COMPAT_FREEBSD7 */
|
||||
|
||||
#define IBCS2_XENIX_AUE_xenix_rdchk AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_xenix_chsize AUE_FTRUNCATE
|
||||
#define IBCS2_XENIX_AUE_xenix_ftime AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_xenix_nap AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_xenix_scoinfo AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_xenix_eaccess AUE_EACCESS
|
||||
#define IBCS2_XENIX_AUE_ibcs2_sigaction AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_ibcs2_sigprocmask AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_ibcs2_sigpending AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_ibcs2_sigsuspend AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_ibcs2_getgroups AUE_GETGROUPS
|
||||
#define IBCS2_XENIX_AUE_ibcs2_setgroups AUE_SETGROUPS
|
||||
#define IBCS2_XENIX_AUE_ibcs2_sysconf AUE_NULL
|
||||
#define IBCS2_XENIX_AUE_ibcs2_pathconf AUE_PATHCONF
|
||||
#define IBCS2_XENIX_AUE_ibcs2_fpathconf AUE_FPATHCONF
|
||||
#define IBCS2_XENIX_AUE_ibcs2_rename AUE_RENAME
|
||||
#define IBCS2_XENIX_AUE_xenix_utsname AUE_NULL
|
||||
|
||||
#undef PAD_
|
||||
#undef PADL_
|
||||
#undef PADR_
|
||||
|
||||
#endif /* !_IBCS2_XENIX_H_ */
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* System call numbers.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb
|
||||
*/
|
||||
|
||||
#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_xenix_eaccess 37
|
||||
#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
|
@ -1,77 +0,0 @@
|
||||
/*
|
||||
* System call switch table.
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb
|
||||
*/
|
||||
|
||||
#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_xenix.h>
|
||||
|
||||
#define AS(name) (sizeof(struct name) / sizeof(register_t))
|
||||
|
||||
/* The casts are bogus but will do for now. */
|
||||
struct sysent xenix_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 1 = xenix_xlocking */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 2 = xenix_creatsem */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 3 = xenix_opensem */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 4 = xenix_sigsem */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 5 = xenix_waitsem */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 6 = xenix_nbwaitsem */
|
||||
{ AS(xenix_rdchk_args), (sy_call_t *)xenix_rdchk, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = xenix_rdchk */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 8 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 9 = nosys */
|
||||
{ AS(xenix_chsize_args), (sy_call_t *)xenix_chsize, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = xenix_chsize */
|
||||
{ AS(xenix_ftime_args), (sy_call_t *)xenix_ftime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = xenix_ftime */
|
||||
{ AS(xenix_nap_args), (sy_call_t *)xenix_nap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = xenix_nap */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 13 = xenix_sdget */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 14 = xenix_sdfree */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 15 = xenix_sdenter */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 16 = xenix_sdleave */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 17 = xenix_sdgetv */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 18 = xenix_sdwaitv */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 19 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 20 = nosys */
|
||||
{ 0, (sy_call_t *)xenix_scoinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = xenix_scoinfo */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 22 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 23 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 24 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 25 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 26 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 27 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 28 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 29 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 30 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 31 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 32 = xenix_proctl */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 33 = xenix_execseg */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 34 = xenix_unexecseg */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 35 = nosys */
|
||||
{ AS(select_args), (sy_call_t *)sys_select, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = select */
|
||||
{ AS(xenix_eaccess_args), (sy_call_t *)xenix_eaccess, AUE_EACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = xenix_eaccess */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 38 = xenix_paccess */
|
||||
{ AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = ibcs2_sigaction */
|
||||
{ AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = ibcs2_sigprocmask */
|
||||
{ AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = ibcs2_sigpending */
|
||||
{ AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = ibcs2_sigsuspend */
|
||||
{ AS(ibcs2_getgroups_args), (sy_call_t *)ibcs2_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = ibcs2_getgroups */
|
||||
{ AS(ibcs2_setgroups_args), (sy_call_t *)ibcs2_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = ibcs2_setgroups */
|
||||
{ AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ibcs2_sysconf */
|
||||
{ AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = ibcs2_pathconf */
|
||||
{ AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = ibcs2_fpathconf */
|
||||
{ AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = ibcs2_rename */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 49 = nosys */
|
||||
{ AS(xenix_utsname_args), (sy_call_t *)xenix_utsname, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = xenix_utsname */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 51 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 52 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 53 = nosys */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 54 = nosys */
|
||||
{ AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_GETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = getitimer */
|
||||
{ AS(setitimer_args), (sy_call_t *)sys_setitimer, AUE_SETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 56 = setitimer */
|
||||
};
|
@ -1,495 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1994 Sean Eric Fagan
|
||||
* Copyright (c) 1994 Søren Schmidt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/imgact.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/vnode.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_map.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/vm_extern.h>
|
||||
|
||||
#include <i386/ibcs2/coff.h>
|
||||
#include <i386/ibcs2/ibcs2_util.h>
|
||||
|
||||
MODULE_DEPEND(coff, ibcs2, 1, 1, 1);
|
||||
|
||||
extern struct sysentvec ibcs2_svr3_sysvec;
|
||||
|
||||
static int coff_load_file(struct thread *td, char *name);
|
||||
static int exec_coff_imgact(struct image_params *imgp);
|
||||
|
||||
static int load_coff_section(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(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset,
|
||||
caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)
|
||||
{
|
||||
size_t map_len;
|
||||
vm_offset_t map_offset;
|
||||
vm_offset_t map_addr;
|
||||
int error;
|
||||
unsigned char *data_buf = NULL;
|
||||
size_t copy_len;
|
||||
|
||||
map_offset = trunc_page(offset);
|
||||
map_addr = trunc_page((vm_offset_t)vmaddr);
|
||||
|
||||
if (memsz > filsz) {
|
||||
/*
|
||||
* We have the stupid situation that
|
||||
* the section is longer than it is on file,
|
||||
* which means it has zero-filled areas, and
|
||||
* we have to work for it. Stupid iBCS!
|
||||
*/
|
||||
map_len = trunc_page(offset + filsz) - trunc_page(map_offset);
|
||||
} else {
|
||||
/*
|
||||
* The only stuff we care about is on disk, and we
|
||||
* don't care if we map in more than is really there.
|
||||
*/
|
||||
map_len = round_page(offset + filsz) - trunc_page(map_offset);
|
||||
}
|
||||
|
||||
DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08jx, 0x%x, 0x%x, "
|
||||
"VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, 0x%x)\n",
|
||||
__FILE__, __LINE__, (uintmax_t)map_addr, map_len, prot,
|
||||
map_offset));
|
||||
|
||||
if ((error = vm_mmap(&vmspace->vm_map,
|
||||
&map_addr,
|
||||
map_len,
|
||||
prot,
|
||||
VM_PROT_ALL,
|
||||
MAP_PRIVATE | MAP_FIXED,
|
||||
OBJT_VNODE,
|
||||
vp,
|
||||
map_offset)) != 0)
|
||||
return error;
|
||||
|
||||
if (memsz == filsz) {
|
||||
/* We're done! */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we have screwball stuff, to accomodate stupid COFF.
|
||||
* We have to map the remaining bit of the file into the kernel's
|
||||
* memory map, allocate some anonymous memory, copy that last
|
||||
* bit into it, and then we're done. *sigh*
|
||||
* For clean-up reasons, we actally map in the file last.
|
||||
*/
|
||||
|
||||
copy_len = (offset + filsz) - trunc_page(offset + filsz);
|
||||
map_addr = trunc_page((vm_offset_t)vmaddr + filsz);
|
||||
map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr;
|
||||
|
||||
DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08jx,0x%x, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", __FILE__, __LINE__, (uintmax_t)map_addr, map_len));
|
||||
|
||||
if (map_len != 0) {
|
||||
error = vm_map_find(&vmspace->vm_map, NULL, 0, &map_addr,
|
||||
map_len, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0);
|
||||
if (error)
|
||||
return (vm_mmap_to_errno(error));
|
||||
}
|
||||
|
||||
if ((error = vm_mmap(exec_map,
|
||||
(vm_offset_t *) &data_buf,
|
||||
PAGE_SIZE,
|
||||
VM_PROT_READ,
|
||||
VM_PROT_READ,
|
||||
0,
|
||||
OBJT_VNODE,
|
||||
vp,
|
||||
trunc_page(offset + filsz))) != 0)
|
||||
return error;
|
||||
|
||||
error = copyout(data_buf, (caddr_t) map_addr, copy_len);
|
||||
|
||||
kmap_free_wakeup(exec_map, (vm_offset_t)data_buf, PAGE_SIZE);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
static int
|
||||
coff_load_file(struct thread *td, char *name)
|
||||
{
|
||||
struct proc *p = td->td_proc;
|
||||
struct vmspace *vmspace = p->p_vmspace;
|
||||
int error;
|
||||
struct nameidata nd;
|
||||
struct vnode *vp;
|
||||
struct vattr attr;
|
||||
struct filehdr *fhdr;
|
||||
struct aouthdr *ahdr;
|
||||
struct scnhdr *scns;
|
||||
char *ptr = NULL;
|
||||
int nscns;
|
||||
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;
|
||||
int i, writecount;
|
||||
|
||||
NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME,
|
||||
UIO_SYSSPACE, name, td);
|
||||
|
||||
error = namei(&nd);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
vp = nd.ni_vp;
|
||||
if (vp == NULL)
|
||||
return ENOEXEC;
|
||||
|
||||
error = VOP_GET_WRITECOUNT(vp, &writecount);
|
||||
if (error != 0)
|
||||
goto fail;
|
||||
if (writecount != 0) {
|
||||
error = ETXTBSY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((error = VOP_GETATTR(vp, &attr, td->td_ucred)) != 0)
|
||||
goto fail;
|
||||
|
||||
if ((vp->v_mount->mnt_flag & MNT_NOEXEC)
|
||||
|| ((attr.va_mode & 0111) == 0)
|
||||
|| (attr.va_type != VREG))
|
||||
goto fail;
|
||||
|
||||
if (attr.va_size == 0) {
|
||||
error = ENOEXEC;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td)) != 0)
|
||||
goto fail;
|
||||
|
||||
if ((error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL)) != 0)
|
||||
goto fail;
|
||||
|
||||
/*
|
||||
* Lose the lock on the vnode. It's no longer needed, and must not
|
||||
* exist for the pagefault paging to work below.
|
||||
*/
|
||||
VOP_UNLOCK(vp, 0);
|
||||
|
||||
if ((error = vm_mmap(exec_map,
|
||||
(vm_offset_t *) &ptr,
|
||||
PAGE_SIZE,
|
||||
VM_PROT_READ,
|
||||
VM_PROT_READ,
|
||||
0,
|
||||
OBJT_VNODE,
|
||||
vp,
|
||||
0)) != 0)
|
||||
goto unlocked_fail;
|
||||
|
||||
fhdr = (struct filehdr *)ptr;
|
||||
|
||||
if (fhdr->f_magic != I386_COFF) {
|
||||
error = ENOEXEC;
|
||||
goto dealloc_and_fail;
|
||||
}
|
||||
|
||||
nscns = fhdr->f_nscns;
|
||||
|
||||
if ((nscns * sizeof(struct scnhdr)) > PAGE_SIZE) {
|
||||
/*
|
||||
* XXX -- just fail. I'm so lazy.
|
||||
*/
|
||||
error = ENOEXEC;
|
||||
goto dealloc_and_fail;
|
||||
}
|
||||
|
||||
ahdr = (struct aouthdr*)(ptr + sizeof(struct filehdr));
|
||||
|
||||
scns = (struct scnhdr*)(ptr + sizeof(struct filehdr)
|
||||
+ sizeof(struct aouthdr));
|
||||
|
||||
for (i = 0; i < nscns; i++) {
|
||||
if (scns[i].s_flags & STYP_NOLOAD)
|
||||
continue;
|
||||
else if (scns[i].s_flags & STYP_TEXT) {
|
||||
text_address = scns[i].s_vaddr;
|
||||
text_size = scns[i].s_size;
|
||||
text_offset = scns[i].s_scnptr;
|
||||
}
|
||||
else if (scns[i].s_flags & STYP_DATA) {
|
||||
data_address = scns[i].s_vaddr;
|
||||
data_size = scns[i].s_size;
|
||||
data_offset = scns[i].s_scnptr;
|
||||
} else if (scns[i].s_flags & STYP_BSS) {
|
||||
bss_size = scns[i].s_size;
|
||||
}
|
||||
}
|
||||
|
||||
if ((error = load_coff_section(vmspace, vp, text_offset,
|
||||
(caddr_t)(void *)(uintptr_t)text_address,
|
||||
text_size, text_size,
|
||||
VM_PROT_READ | VM_PROT_EXECUTE)) != 0) {
|
||||
goto dealloc_and_fail;
|
||||
}
|
||||
if ((error = load_coff_section(vmspace, vp, data_offset,
|
||||
(caddr_t)(void *)(uintptr_t)data_address,
|
||||
data_size + bss_size, data_size,
|
||||
VM_PROT_ALL)) != 0) {
|
||||
goto dealloc_and_fail;
|
||||
}
|
||||
|
||||
error = 0;
|
||||
|
||||
dealloc_and_fail:
|
||||
kmap_free_wakeup(exec_map, (vm_offset_t)ptr, PAGE_SIZE);
|
||||
fail:
|
||||
VOP_UNLOCK(vp, 0);
|
||||
unlocked_fail:
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
}
|
||||
|
||||
static int
|
||||
exec_coff_imgact(imgp)
|
||||
struct image_params *imgp;
|
||||
{
|
||||
const struct filehdr *fhdr = (const struct filehdr*)imgp->image_header;
|
||||
const struct aouthdr *ahdr;
|
||||
const struct scnhdr *scns;
|
||||
int i;
|
||||
struct vmspace *vmspace;
|
||||
int nscns;
|
||||
int error;
|
||||
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;
|
||||
vm_offset_t hole;
|
||||
|
||||
if (fhdr->f_magic != I386_COFF ||
|
||||
!(fhdr->f_flags & F_EXEC)) {
|
||||
|
||||
DPRINTF(("%s(%d): return -1\n", __FILE__, __LINE__));
|
||||
return -1;
|
||||
}
|
||||
|
||||
nscns = fhdr->f_nscns;
|
||||
if ((nscns * sizeof(struct scnhdr)) > PAGE_SIZE) {
|
||||
/*
|
||||
* For now, return an error -- need to be able to
|
||||
* read in all of the section structures.
|
||||
*/
|
||||
|
||||
DPRINTF(("%s(%d): return -1\n", __FILE__, __LINE__));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ahdr = (const struct aouthdr*)
|
||||
((const char*)(imgp->image_header) + sizeof(struct filehdr));
|
||||
imgp->entry_addr = ahdr->entry;
|
||||
|
||||
scns = (const struct scnhdr*)
|
||||
((const char*)(imgp->image_header) + sizeof(struct filehdr) +
|
||||
sizeof(struct aouthdr));
|
||||
|
||||
VOP_UNLOCK(imgp->vp, 0);
|
||||
|
||||
error = exec_new_vmspace(imgp, &ibcs2_svr3_sysvec);
|
||||
if (error)
|
||||
goto fail;
|
||||
vmspace = imgp->proc->p_vmspace;
|
||||
|
||||
for (i = 0; i < nscns; i++) {
|
||||
|
||||
DPRINTF(("i = %d, s_name = %s, s_vaddr = %08lx, "
|
||||
"s_scnptr = %ld s_size = %lx\n", i, scns[i].s_name,
|
||||
scns[i].s_vaddr, scns[i].s_scnptr, scns[i].s_size));
|
||||
if (scns[i].s_flags & STYP_NOLOAD) {
|
||||
/*
|
||||
* A section that is not loaded, for whatever
|
||||
* reason. It takes precedance over other flag
|
||||
* bits...
|
||||
*/
|
||||
continue;
|
||||
} else if (scns[i].s_flags & STYP_TEXT) {
|
||||
text_address = scns[i].s_vaddr;
|
||||
text_size = scns[i].s_size;
|
||||
text_offset = scns[i].s_scnptr;
|
||||
} else if (scns[i].s_flags & STYP_DATA) {
|
||||
/* .data section */
|
||||
data_address = scns[i].s_vaddr;
|
||||
data_size = scns[i].s_size;
|
||||
data_offset = scns[i].s_scnptr;
|
||||
} else if (scns[i].s_flags & STYP_BSS) {
|
||||
/* .bss section */
|
||||
bss_size = scns[i].s_size;
|
||||
} else if (scns[i].s_flags & STYP_LIB) {
|
||||
char *buf = NULL;
|
||||
int foff = trunc_page(scns[i].s_scnptr);
|
||||
int off = scns[i].s_scnptr - foff;
|
||||
int len = round_page(scns[i].s_size + PAGE_SIZE);
|
||||
int j;
|
||||
|
||||
if ((error = vm_mmap(exec_map,
|
||||
(vm_offset_t *) &buf,
|
||||
len,
|
||||
VM_PROT_READ,
|
||||
VM_PROT_READ,
|
||||
MAP_SHARED,
|
||||
OBJT_VNODE,
|
||||
imgp->vp,
|
||||
foff)) != 0) {
|
||||
error = ENOEXEC;
|
||||
goto fail;
|
||||
}
|
||||
if(scns[i].s_size) {
|
||||
char *libbuf;
|
||||
int emul_path_len = strlen(ibcs2_emul_path);
|
||||
|
||||
libbuf = malloc(MAXPATHLEN + emul_path_len,
|
||||
M_TEMP, M_WAITOK);
|
||||
strcpy(libbuf, ibcs2_emul_path);
|
||||
|
||||
for (j = off; j < scns[i].s_size + off;) {
|
||||
long stroff, nextoff;
|
||||
char *libname;
|
||||
|
||||
nextoff = 4 * *(long *)(buf + j);
|
||||
stroff = 4 * *(long *)(buf + j + sizeof(long));
|
||||
|
||||
libname = buf + j + stroff;
|
||||
j += nextoff;
|
||||
|
||||
DPRINTF(("%s(%d): shared library %s\n",
|
||||
__FILE__, __LINE__, libname));
|
||||
strlcpy(&libbuf[emul_path_len], libname, MAXPATHLEN);
|
||||
error = coff_load_file(
|
||||
FIRST_THREAD_IN_PROC(imgp->proc), libbuf);
|
||||
if (error)
|
||||
error = coff_load_file(
|
||||
FIRST_THREAD_IN_PROC(imgp->proc),
|
||||
libname);
|
||||
if (error) {
|
||||
printf(
|
||||
"error %d loading coff shared library %s\n",
|
||||
error, libname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(libbuf, M_TEMP);
|
||||
}
|
||||
kmap_free_wakeup(exec_map, (vm_offset_t)buf, len);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Map in .text now
|
||||
*/
|
||||
|
||||
DPRINTF(("%s(%d): load_coff_section(vmspace, "
|
||||
"imgp->vp, %08lx, %08lx, 0x%lx, 0x%lx, 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, imgp->vp,
|
||||
text_offset,
|
||||
(caddr_t)(void *)(uintptr_t)text_address,
|
||||
text_size, text_size,
|
||||
VM_PROT_READ | VM_PROT_EXECUTE)) != 0) {
|
||||
DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
|
||||
goto fail;
|
||||
}
|
||||
/*
|
||||
* Map in .data and .bss now
|
||||
*/
|
||||
|
||||
|
||||
DPRINTF(("%s(%d): load_coff_section(vmspace, "
|
||||
"imgp->vp, 0x%08lx, 0x%08lx, 0x%lx, 0x%lx, 0x%x)\n",
|
||||
__FILE__, __LINE__, data_offset, data_address,
|
||||
data_size + bss_size, data_size, VM_PROT_ALL));
|
||||
if ((error = load_coff_section(vmspace, imgp->vp,
|
||||
data_offset,
|
||||
(caddr_t)(void *)(uintptr_t)data_address,
|
||||
data_size + bss_size, data_size,
|
||||
VM_PROT_ALL)) != 0) {
|
||||
|
||||
DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
imgp->interpreted = 0;
|
||||
imgp->proc->p_sysent = &ibcs2_svr3_sysvec;
|
||||
|
||||
vmspace->vm_tsize = round_page(text_size) >> PAGE_SHIFT;
|
||||
vmspace->vm_dsize = round_page(data_size + bss_size) >> PAGE_SHIFT;
|
||||
vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)text_address;
|
||||
vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t)data_address;
|
||||
|
||||
hole = trunc_page((vm_offset_t)vmspace->vm_daddr +
|
||||
ctob(vmspace->vm_dsize));
|
||||
|
||||
DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%jx, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n",
|
||||
__FILE__, __LINE__, (uintmax_t)hole));
|
||||
DPRINTF(("imgact: error = %d\n", error));
|
||||
|
||||
vm_map_find(&vmspace->vm_map, NULL, 0,
|
||||
(vm_offset_t *)&hole, PAGE_SIZE, 0, VMFS_NO_SPACE,
|
||||
VM_PROT_ALL, VM_PROT_ALL, 0);
|
||||
DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%p end = 0x%p\n",
|
||||
ctob(vmspace->vm_dsize), vmspace->vm_daddr,
|
||||
ctob(vmspace->vm_dsize) + vmspace->vm_daddr ));
|
||||
DPRINTF(("%s(%d): returning %d!\n", __FILE__, __LINE__, error));
|
||||
|
||||
fail:
|
||||
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tell kern_execve.c about it, with a little help from the linker.
|
||||
*/
|
||||
static struct execsw coff_execsw = { exec_coff_imgact, "coff" };
|
||||
EXEC_SET(coff, coff_execsw);
|
@ -1,11 +0,0 @@
|
||||
# syscalls.conf $FreeBSD$
|
||||
sysnames="/dev/null"
|
||||
sysproto="ibcs2_proto.h"
|
||||
sysproto_h=_IBCS2_SYSPROTO_H_
|
||||
syshdr="ibcs2_syscall.h"
|
||||
sysmk="/dev/null"
|
||||
syssw="ibcs2_sysent.c"
|
||||
syscallprefix="IBCS2_SYS_"
|
||||
switchname="ibcs2_sysent"
|
||||
namesname="ibcs2_syscallnames"
|
||||
systrace="/dev/null"
|
@ -1,38 +0,0 @@
|
||||
$FreeBSD$
|
||||
|
||||
#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_proto.h>
|
||||
#include <i386/ibcs2/ibcs2_xenix.h>
|
||||
|
||||
0 AUE_NULL UNIMPL nosys
|
||||
1 AUE_NULL UNIMPL isc_setostype
|
||||
2 AUE_RENAME NOPROTO { int ibcs2_rename(char *from, char *to); }
|
||||
3 AUE_NULL NOPROTO { int ibcs2_sigaction(int sig, \
|
||||
struct ibcs2_sigaction *act, \
|
||||
struct ibcs2_sigaction *oact); }
|
||||
4 AUE_NULL NOPROTO { int ibcs2_sigprocmask(int how, \
|
||||
ibcs2_sigset_t *set, \
|
||||
ibcs2_sigset_t *oset); }
|
||||
5 AUE_NULL NOPROTO { int ibcs2_sigpending(ibcs2_sigset_t *mask); }
|
||||
6 AUE_GETGROUPS NOPROTO { int getgroups(u_int gidsetsize, \
|
||||
gid_t *gidset); }
|
||||
7 AUE_SETGROUPS NOPROTO { int setgroups(u_int gidsetsize, \
|
||||
gid_t *gidset); }
|
||||
8 AUE_PATHCONF NOPROTO { int ibcs2_pathconf(char *path, int name); }
|
||||
9 AUE_FPATHCONF NOPROTO { int ibcs2_fpathconf(int fd, int name); }
|
||||
10 AUE_NULL UNIMPL nosys
|
||||
11 AUE_WAIT4 NOPROTO { int ibcs2_wait(int a1, int a2, int a3); }
|
||||
12 AUE_SETSID NOPROTO { int setsid(void); }
|
||||
13 AUE_GETPID NOPROTO { pid_t getpid(void); }
|
||||
14 AUE_NULL UNIMPL isc_adduser
|
||||
15 AUE_NULL UNIMPL isc_setuser
|
||||
16 AUE_NULL NOPROTO { int ibcs2_sysconf(int name); }
|
||||
17 AUE_NULL NOPROTO { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); }
|
||||
18 AUE_SYMLINK NOPROTO { int ibcs2_symlink(char *path, char *link); }
|
||||
19 AUE_READLINK NOPROTO { int ibcs2_readlink(char *path, char *buf, \
|
||||
int count); }
|
||||
20 AUE_NULL UNIMPL isc_getmajor
|
@ -1,12 +0,0 @@
|
||||
# syscalls.conf $FreeBSD$
|
||||
sysnames="/dev/null"
|
||||
#sysproto="ibcs2_isc.h"
|
||||
sysproto="/dev/null"
|
||||
sysproto_h=_IBCS2_ISC_H_
|
||||
syshdr="ibcs2_isc_syscall.h"
|
||||
sysmk="/dev/null"
|
||||
syssw="ibcs2_isc_sysent.c"
|
||||
syscallprefix="IBCS2_ISC_"
|
||||
switchname="isc_sysent"
|
||||
namesname="isc_syscallnames"
|
||||
systrace="/dev/null"
|
@ -1,205 +0,0 @@
|
||||
$FreeBSD$
|
||||
|
||||
; @(#)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 audit type nargs name alt{name,tag,rtyp}/comments
|
||||
; number system call number, must be in order
|
||||
; audit the audit event associated with the system call
|
||||
; A value of AUE_NULL means no auditing, but it also means that
|
||||
; there is no audit event for the call at this time. For the
|
||||
; case where the event exists, but we don't want auditing, the
|
||||
; event should be #defined to AUE_NULL in audit_kevents.h.
|
||||
; type one of STD, OBSOL, UNIMPL, COMPAT
|
||||
; name pseudo-prototype of syscall routine
|
||||
; If one of the following alts is different, then all appear:
|
||||
; altname name of system call if different
|
||||
; alttag name of args struct tag if different from [o]`name'"_args"
|
||||
; altrtyp return type if not int (bogus - syscalls always return int)
|
||||
; for UNIMPL/OBSOL, name continues with comments
|
||||
|
||||
; types:
|
||||
; STD always included
|
||||
; COMPAT included on COMPAT #ifdef
|
||||
; OBSOL obsolete, not included in system, only specifies name
|
||||
; UNIMPL not implemented, placeholder only
|
||||
|
||||
#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_proto.h>
|
||||
|
||||
; #ifdef's, etc. may be included, and are copied to the output files.
|
||||
|
||||
0 AUE_NULL NOPROTO { int nosys(void); } syscall nosys_args int
|
||||
1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \
|
||||
sys_exit_args void
|
||||
2 AUE_FORK NOPROTO { int fork(void); }
|
||||
3 AUE_NULL STD { int ibcs2_read(int fd, char *buf, \
|
||||
u_int nbytes); }
|
||||
4 AUE_NULL NOPROTO { int write(int fd, char *buf, \
|
||||
u_int nbytes); }
|
||||
5 AUE_OPEN_RWTC STD { int ibcs2_open(char *path, int flags, \
|
||||
int mode); }
|
||||
6 AUE_CLOSE NOPROTO { int close(int fd); }
|
||||
7 AUE_WAIT4 STD { int ibcs2_wait(int a1, int a2, int a3); }
|
||||
8 AUE_CREAT STD { int ibcs2_creat(char *path, int mode); }
|
||||
9 AUE_LINK NOPROTO { int link(char *path, char *link); }
|
||||
10 AUE_UNLINK STD { int ibcs2_unlink(char *path); }
|
||||
11 AUE_EXECVE STD { int ibcs2_execv(char *path, char **argp); }
|
||||
12 AUE_CHDIR STD { int ibcs2_chdir(char *path); }
|
||||
13 AUE_NULL STD { int ibcs2_time(ibcs2_time_t *tp); }
|
||||
14 AUE_MKNOD STD { int ibcs2_mknod(char* path, int mode, \
|
||||
int dev); }
|
||||
15 AUE_CHMOD STD { int ibcs2_chmod(char *path, int mode); }
|
||||
16 AUE_CHOWN STD { int ibcs2_chown(char *path, int uid, \
|
||||
int gid); }
|
||||
17 AUE_NULL NOPROTO { caddr_t break(caddr_t nsize); }
|
||||
18 AUE_STAT STD { int ibcs2_stat(char* path, \
|
||||
struct ibcs2_stat *st); }
|
||||
19 AUE_LSEEK STD { long ibcs2_lseek(int fd, long offset, \
|
||||
int whence); }
|
||||
20 AUE_NULL NOPROTO { pid_t getpid(void); }
|
||||
21 AUE_MOUNT STD { int ibcs2_mount(char *special, char *dir, \
|
||||
int flags, int fstype, char *data, \
|
||||
int len); }
|
||||
22 AUE_UMOUNT STD { int ibcs2_umount(char *name); }
|
||||
23 AUE_SETUID STD { int ibcs2_setuid(int uid); }
|
||||
24 AUE_GETUID NOPROTO { uid_t getuid(void); }
|
||||
25 AUE_SETTIMEOFDAY STD { int ibcs2_stime(long *timep); }
|
||||
26 AUE_PTRACE NOPROTO { int ptrace(int req, pid_t pid, \
|
||||
caddr_t addr, int data); }
|
||||
27 AUE_NULL STD { int ibcs2_alarm(unsigned sec); }
|
||||
28 AUE_FSTAT STD { int ibcs2_fstat(int fd, \
|
||||
struct ibcs2_stat *st); }
|
||||
29 AUE_NULL STD { int ibcs2_pause(void); }
|
||||
30 AUE_NULL STD { int ibcs2_utime(char *path, \
|
||||
struct ibcs2_utimbuf *buf); }
|
||||
31 AUE_NULL UNIMPL ibcs2_stty
|
||||
32 AUE_NULL UNIMPL ibcs2_gtty
|
||||
33 AUE_ACCESS STD { int ibcs2_access(char *path, int amode); }
|
||||
34 AUE_NICE STD { int ibcs2_nice(int incr); }
|
||||
35 AUE_STATFS STD { int ibcs2_statfs(char *path, \
|
||||
struct ibcs2_statfs *buf, int len, \
|
||||
int fstype); }
|
||||
36 AUE_NULL NOPROTO { int sync(void); }
|
||||
37 AUE_KILL STD { int ibcs2_kill(int pid, int signo); }
|
||||
38 AUE_FSTATFS STD { int ibcs2_fstatfs(int fd, \
|
||||
struct ibcs2_statfs *buf, int len, \
|
||||
int fstype); }
|
||||
39 AUE_NULL STD { int ibcs2_pgrpsys(int type, caddr_t dummy, \
|
||||
int pid, int pgid); }
|
||||
40 AUE_NULL STD { int ibcs2_xenix(int a1, int a2, int a3, \
|
||||
int a4, int a5); }
|
||||
41 AUE_NULL NOPROTO { int dup(u_int fd); }
|
||||
42 AUE_PIPE NOPROTO { int pipe(void); }
|
||||
43 AUE_NULL STD { int ibcs2_times(struct tms *tp); }
|
||||
44 AUE_PROFILE NOPROTO { int profil(caddr_t samples, u_int size, \
|
||||
u_int offset, u_int scale); }
|
||||
45 AUE_NULL STD { int ibcs2_plock(int cmd); }
|
||||
46 AUE_SETGID STD { int ibcs2_setgid(int gid); }
|
||||
47 AUE_GETGID NOPROTO { gid_t getgid(void); }
|
||||
48 AUE_NULL STD { int ibcs2_sigsys(int sig, ibcs2_sig_t fp); }
|
||||
49 AUE_MSGSYS STD { int ibcs2_msgsys(int which, int a2, \
|
||||
int a3, int a4, int a5, int a6); }
|
||||
50 AUE_NULL STD { int ibcs2_sysi86(int cmd, int *arg); }
|
||||
51 AUE_NULL UNIMPL ibcs2_acct
|
||||
52 AUE_SHMSYS STD { int ibcs2_shmsys(int which, int a2, \
|
||||
int a3, int a4); }
|
||||
53 AUE_SEMSYS STD { int ibcs2_semsys(int which, int a2, \
|
||||
int a3, int a4, int a5); }
|
||||
54 AUE_IOCTL STD { int ibcs2_ioctl(int fd, int cmd, \
|
||||
caddr_t data); }
|
||||
55 AUE_NULL STD { int ibcs2_uadmin(int cmd, int func, \
|
||||
caddr_t data); }
|
||||
56 AUE_NULL UNIMPL nosys
|
||||
57 AUE_NULL STD { int ibcs2_utssys(int a1, int a2, \
|
||||
int flag); }
|
||||
58 AUE_FSYNC NOPROTO { int fsync(int fd); }
|
||||
59 AUE_EXECVE STD { int ibcs2_execve(char *path, char **argp, \
|
||||
char **envp); }
|
||||
60 AUE_UMASK NOPROTO { int umask(int newmask); }
|
||||
61 AUE_CHROOT NOPROTO { int chroot(char *path); }
|
||||
62 AUE_FCNTL STD { int ibcs2_fcntl(int fd, int cmd, \
|
||||
char *arg); }
|
||||
63 AUE_NULL STD { long ibcs2_ulimit(int cmd, int newlimit); }
|
||||
64 AUE_NULL UNIMPL reserved for unix/pc
|
||||
65 AUE_NULL UNIMPL reserved for unix/pc
|
||||
66 AUE_NULL UNIMPL reserved for unix/pc
|
||||
67 AUE_NULL UNIMPL reserved for unix/pc
|
||||
68 AUE_NULL UNIMPL reserved for unix/pc
|
||||
69 AUE_NULL UNIMPL reserved for unix/pc
|
||||
70 AUE_NULL OBSOL rfs_advfs
|
||||
71 AUE_NULL OBSOL rfs_unadvfs
|
||||
72 AUE_NULL OBSOL rfs_rmount
|
||||
73 AUE_NULL OBSOL rfs_rumount
|
||||
74 AUE_NULL OBSOL rfs_rfstart
|
||||
75 AUE_NULL OBSOL rfs_sigret
|
||||
76 AUE_NULL OBSOL rfs_rdebug
|
||||
77 AUE_NULL OBSOL rfs_rfstop
|
||||
78 AUE_NULL UNIMPL rfs_rfsys
|
||||
79 AUE_RMDIR STD { int ibcs2_rmdir(char *path); }
|
||||
80 AUE_MKDIR STD { int ibcs2_mkdir(char *path, int mode); }
|
||||
81 AUE_GETDIRENTRIES STD { int ibcs2_getdents(int fd, char *buf, \
|
||||
int nbytes); }
|
||||
82 AUE_NULL UNIMPL nosys
|
||||
83 AUE_NULL UNIMPL nosys
|
||||
84 AUE_NULL STD { int ibcs2_sysfs(int cmd, caddr_t d1, \
|
||||
char *buf); }
|
||||
85 AUE_GETMSG STD { int ibcs2_getmsg(int fd, \
|
||||
struct ibcs2_stropts *ctl, \
|
||||
struct ibcs2_stropts *dat, int *flags); }
|
||||
86 AUE_PUTMSG STD { int ibcs2_putmsg(int fd, \
|
||||
struct ibcs2_stropts *ctl, \
|
||||
struct ibcs2_stropts *dat, int flags); }
|
||||
87 AUE_POLL NOPROTO { int poll(struct pollfd *fds, u_int nfds, \
|
||||
int timeout); }
|
||||
88 AUE_NULL UNIMPL nosys
|
||||
89 AUE_NULL STD { int ibcs2_secure(int cmd, int a1, int a2, \
|
||||
int a3, int a4, int a5); }
|
||||
90 AUE_SYMLINK STD { int ibcs2_symlink(char *path, \
|
||||
char *link); }
|
||||
91 AUE_LSTAT STD { int ibcs2_lstat(char *path, \
|
||||
struct ibcs2_stat *st); }
|
||||
92 AUE_READLINK STD { int ibcs2_readlink(char *path, char *buf, \
|
||||
int count); }
|
||||
93 AUE_NULL UNIMPL nosys
|
||||
94 AUE_NULL UNIMPL nosys
|
||||
95 AUE_NULL UNIMPL nosys
|
||||
96 AUE_NULL UNIMPL nosys
|
||||
97 AUE_NULL UNIMPL nosys
|
||||
98 AUE_NULL UNIMPL nosys
|
||||
99 AUE_NULL UNIMPL nosys
|
||||
100 AUE_NULL UNIMPL nosys
|
||||
101 AUE_NULL UNIMPL nosys
|
||||
102 AUE_NULL UNIMPL nosys
|
||||
103 AUE_NULL NOPROTO { int sigreturn( \
|
||||
struct sigcontext *sigcntxp); }
|
||||
104 AUE_NULL UNIMPL nosys
|
||||
105 AUE_NULL STD { int ibcs2_isc(void); }
|
||||
106 AUE_NULL UNIMPL nosys
|
||||
107 AUE_NULL UNIMPL nosys
|
||||
108 AUE_NULL UNIMPL nosys
|
||||
109 AUE_NULL UNIMPL nosys
|
||||
110 AUE_NULL UNIMPL nosys
|
||||
111 AUE_NULL UNIMPL nosys
|
||||
112 AUE_NULL UNIMPL nosys
|
||||
113 AUE_NULL UNIMPL nosys
|
||||
114 AUE_NULL UNIMPL nosys
|
||||
115 AUE_NULL UNIMPL nosys
|
||||
116 AUE_NULL UNIMPL nosys
|
||||
117 AUE_NULL UNIMPL nosys
|
||||
118 AUE_NULL UNIMPL nosys
|
||||
119 AUE_NULL UNIMPL nosys
|
||||
120 AUE_NULL UNIMPL nosys
|
||||
121 AUE_NULL UNIMPL nosys
|
||||
122 AUE_NULL UNIMPL nosys
|
||||
123 AUE_NULL UNIMPL nosys
|
||||
124 AUE_NULL UNIMPL nosys
|
||||
125 AUE_NULL UNIMPL nosys
|
||||
126 AUE_NULL UNIMPL nosys
|
||||
127 AUE_NULL UNIMPL nosys
|
||||
; vim: syntax=off
|
@ -1,77 +0,0 @@
|
||||
$FreeBSD$
|
||||
|
||||
#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_xenix.h>
|
||||
|
||||
0 AUE_NULL UNIMPL nosys
|
||||
1 AUE_NULL UNIMPL xenix_xlocking
|
||||
2 AUE_NULL UNIMPL xenix_creatsem
|
||||
3 AUE_NULL UNIMPL xenix_opensem
|
||||
4 AUE_NULL UNIMPL xenix_sigsem
|
||||
5 AUE_NULL UNIMPL xenix_waitsem
|
||||
6 AUE_NULL UNIMPL xenix_nbwaitsem
|
||||
7 AUE_NULL STD { int xenix_rdchk(int fd); }
|
||||
8 AUE_NULL UNIMPL nosys
|
||||
9 AUE_NULL UNIMPL nosys
|
||||
10 AUE_FTRUNCATE STD { int xenix_chsize(int fd, long size); }
|
||||
11 AUE_NULL STD { int xenix_ftime(struct timeb *tp); }
|
||||
12 AUE_NULL STD { int xenix_nap(int millisec); }
|
||||
13 AUE_NULL UNIMPL xenix_sdget
|
||||
14 AUE_NULL UNIMPL xenix_sdfree
|
||||
15 AUE_NULL UNIMPL xenix_sdenter
|
||||
16 AUE_NULL UNIMPL xenix_sdleave
|
||||
17 AUE_NULL UNIMPL xenix_sdgetv
|
||||
18 AUE_NULL UNIMPL xenix_sdwaitv
|
||||
19 AUE_NULL UNIMPL nosys
|
||||
20 AUE_NULL UNIMPL nosys
|
||||
21 AUE_NULL STD { int xenix_scoinfo(void); }
|
||||
22 AUE_NULL UNIMPL nosys
|
||||
23 AUE_NULL UNIMPL nosys
|
||||
24 AUE_NULL UNIMPL nosys
|
||||
25 AUE_NULL UNIMPL nosys
|
||||
26 AUE_NULL UNIMPL nosys
|
||||
27 AUE_NULL UNIMPL nosys
|
||||
28 AUE_NULL UNIMPL nosys
|
||||
29 AUE_NULL UNIMPL nosys
|
||||
30 AUE_NULL UNIMPL nosys
|
||||
31 AUE_NULL UNIMPL nosys
|
||||
32 AUE_NULL UNIMPL xenix_proctl
|
||||
33 AUE_NULL UNIMPL xenix_execseg
|
||||
34 AUE_NULL UNIMPL xenix_unexecseg
|
||||
35 AUE_NULL UNIMPL nosys
|
||||
36 AUE_SELECT NOPROTO { int select(u_int nd, fd_set *in, \
|
||||
fd_set *ou, fd_set *ex, \
|
||||
struct timeval *tv); }
|
||||
37 AUE_EACCESS STD { int xenix_eaccess(char *path, int flags); }
|
||||
38 AUE_NULL UNIMPL xenix_paccess
|
||||
39 AUE_NULL STD { int ibcs2_sigaction(int sig, \
|
||||
struct ibcs2_sigaction *act, \
|
||||
struct ibcs2_sigaction *oact); }
|
||||
40 AUE_NULL STD { int ibcs2_sigprocmask(int how, \
|
||||
ibcs2_sigset_t *set, \
|
||||
ibcs2_sigset_t *oset); }
|
||||
41 AUE_NULL STD { int ibcs2_sigpending(ibcs2_sigset_t *mask); }
|
||||
42 AUE_NULL STD { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); }
|
||||
43 AUE_GETGROUPS STD { int ibcs2_getgroups(int gidsetsize, \
|
||||
ibcs2_gid_t *gidset); }
|
||||
44 AUE_SETGROUPS STD { int ibcs2_setgroups(int gidsetsize, \
|
||||
ibcs2_gid_t *gidset); }
|
||||
45 AUE_NULL STD { int ibcs2_sysconf(int name); }
|
||||
46 AUE_PATHCONF STD { int ibcs2_pathconf(char *path, int name); }
|
||||
47 AUE_FPATHCONF STD { int ibcs2_fpathconf(int fd, int name); }
|
||||
48 AUE_RENAME STD { int ibcs2_rename(char *from, char *to); }
|
||||
49 AUE_NULL UNIMPL nosys
|
||||
50 AUE_NULL STD { int xenix_utsname(long addr); }
|
||||
51 AUE_NULL UNIMPL nosys
|
||||
52 AUE_NULL UNIMPL nosys
|
||||
53 AUE_NULL UNIMPL nosys
|
||||
54 AUE_NULL UNIMPL nosys
|
||||
55 AUE_GETITIMER NOPROTO { int getitimer(u_int which, \
|
||||
struct itimerval *itv); }
|
||||
56 AUE_SETITIMER NOPROTO { int setitimer(u_int which, \
|
||||
struct itimerval *itv, \
|
||||
struct itimerval *otv); }
|
@ -1,11 +0,0 @@
|
||||
# syscalls.conf $FreeBSD$
|
||||
sysnames="/dev/null"
|
||||
sysproto="ibcs2_xenix.h"
|
||||
sysproto_h=_IBCS2_XENIX_H_
|
||||
syshdr="ibcs2_xenix_syscall.h"
|
||||
sysmk="/dev/null"
|
||||
syssw="ibcs2_xenix_sysent.c"
|
||||
syscallprefix="IBCS2_XENIX_"
|
||||
switchname="xenix_sysent"
|
||||
namesname="xenix_syscallnames"
|
||||
systrace="/dev/null"
|
@ -92,7 +92,6 @@ SUBDIR= \
|
||||
${_cloudabi32} \
|
||||
${_cloudabi64} \
|
||||
${_cmx} \
|
||||
${_coff} \
|
||||
${_coretemp} \
|
||||
${_cp} \
|
||||
${_cpsw} \
|
||||
@ -153,7 +152,6 @@ SUBDIR= \
|
||||
i2c \
|
||||
${_iavf} \
|
||||
${_ibcore} \
|
||||
${_ibcs2} \
|
||||
${_ichwd} \
|
||||
${_ida} \
|
||||
if_bridge \
|
||||
@ -750,13 +748,11 @@ _apm= apm
|
||||
.if ${MK_SOURCELESS_UCODE} != "no"
|
||||
_ce= ce
|
||||
.endif
|
||||
_coff= coff
|
||||
.if ${MK_SOURCELESS_UCODE} != "no"
|
||||
_cp= cp
|
||||
.endif
|
||||
_glxiic= glxiic
|
||||
_glxsb= glxsb
|
||||
#_ibcs2= ibcs2
|
||||
_pcfclock= pcfclock
|
||||
_pst= pst
|
||||
_sbni= sbni
|
||||
|
@ -1,10 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${SRCTOP}/sys/i386/ibcs2
|
||||
|
||||
KMOD= ibcs2_coff
|
||||
SRCS= imgact_coff.c vnode_if.h
|
||||
|
||||
CFLAGS+= -DCOMPAT_IBCS2
|
||||
|
||||
.include <bsd.kmod.mk>
|
@ -1,15 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${SRCTOP}/sys/i386/ibcs2
|
||||
|
||||
KMOD= ibcs2
|
||||
SRCS= ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \
|
||||
ibcs2_fcntl.c ibcs2_signal.c ibcs2_sysent.c ibcs2_ioctl.c \
|
||||
ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \
|
||||
ibcs2_isc.c ibcs2_isc_sysent.c \
|
||||
ibcs2_msg.c ibcs2_other.c ibcs2_sysi86.c ibcs2_sysvec.c \
|
||||
vnode_if.h opt_spx_hack.h
|
||||
|
||||
CFLAGS+= -DCOMPAT_IBCS2
|
||||
|
||||
.include <bsd.kmod.mk>
|
Loading…
Reference in New Issue
Block a user