diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-17 05:24:25 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-17 05:24:25 +0000 |
commit | 1417d9fd38968b85b80138ecf619d0cc8c197cc0 (patch) | |
tree | f533c3347d6ce030d053fe836a0e08fe5db5f80e /sys/compat/linux | |
parent | 61c97d6369b446092078e0e99a5541a8ee8b9417 (diff) |
Good fixes and changes from latest Net.
Diffstat (limited to 'sys/compat/linux')
35 files changed, 178 insertions, 43 deletions
diff --git a/sys/compat/linux/Makefile b/sys/compat/linux/Makefile index 0627f6119a4..ad9003f4617 100644 --- a/sys/compat/linux/Makefile +++ b/sys/compat/linux/Makefile @@ -1,3 +1,4 @@ +# $OpenBSD: Makefile,v 1.2 1996/04/17 05:23:42 mickey Exp $ # $NetBSD: Makefile,v 1.1 1995/02/28 23:26:21 fvdl Exp $ DEP= syscalls.conf syscalls.master ../../kern/makesyscalls.sh diff --git a/sys/compat/linux/files.linux b/sys/compat/linux/files.linux index 9dd91177ecc..7d733b00b22 100644 --- a/sys/compat/linux/files.linux +++ b/sys/compat/linux/files.linux @@ -1,3 +1,4 @@ +# $OpenBSD: files.linux,v 1.3 1996/04/17 05:23:42 mickey Exp $ # $NetBSD: files.linux,v 1.4 1996/03/08 04:55:59 mycroft Exp $ # # Config.new file description for machine-independent Linux compat code. diff --git a/sys/compat/linux/linux_dirent.h b/sys/compat/linux/linux_dirent.h index de63da00ca3..5eeec661746 100644 --- a/sys/compat/linux/linux_dirent.h +++ b/sys/compat/linux/linux_dirent.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_dirent.h,v 1.2 1996/04/17 05:23:43 mickey Exp $ */ /* $NetBSD: linux_dirent.h,v 1.3 1995/10/07 06:26:59 mycroft Exp $ */ /* diff --git a/sys/compat/linux/linux_errno.h b/sys/compat/linux/linux_errno.h index 94530fd2eed..5f85b75c7d4 100644 --- a/sys/compat/linux/linux_errno.h +++ b/sys/compat/linux/linux_errno.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_errno.h,v 1.2 1996/04/17 05:23:44 mickey Exp $ */ /* $NetBSD: linux_errno.h,v 1.1 1995/02/28 23:25:34 fvdl Exp $ */ /* * Copyright (c) 1995 Frank van der Linden diff --git a/sys/compat/linux/linux_error.c b/sys/compat/linux/linux_error.c index 1c42debe480..0551a2954ea 100644 --- a/sys/compat/linux/linux_error.c +++ b/sys/compat/linux/linux_error.c @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_error.c,v 1.2 1996/04/17 05:23:45 mickey Exp $ */ /* $NetBSD: linux_error.c,v 1.2 1995/04/22 19:48:32 christos Exp $ */ /* diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c index cc266db42bd..8221564ad73 100644 --- a/sys/compat/linux/linux_exec.c +++ b/sys/compat/linux/linux_exec.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_exec.c,v 1.12 1995/10/07 06:27:00 mycroft Exp $ */ +/* $OpenBSD: linux_exec.c,v 1.2 1996/04/17 05:23:46 mickey Exp $ */ +/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -37,9 +38,12 @@ #include <sys/malloc.h> #include <sys/namei.h> #include <sys/vnode.h> +#include <sys/mount.h> #include <sys/exec_elf.h> #include <sys/mman.h> +#include <sys/syscallargs.h> + #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/vm_map.h> @@ -69,6 +73,11 @@ extern char linux_sigcode[], linux_esigcode[]; extern struct sysent linux_sysent[]; extern char *linux_syscallnames[]; +int exec_linux_aout_prep_zmagic __P((struct proc *, struct exec_package *)); +int exec_linux_aout_prep_nmagic __P((struct proc *, struct exec_package *)); +int exec_linux_aout_prep_omagic __P((struct proc *, struct exec_package *)); +int exec_linux_aout_prep_qmagic __P((struct proc *, struct exec_package *)); + struct emul emul_linux_aout = { "linux", linux_error, diff --git a/sys/compat/linux/linux_exec.h b/sys/compat/linux/linux_exec.h index fe26bac4f31..082f18741a7 100644 --- a/sys/compat/linux/linux_exec.h +++ b/sys/compat/linux/linux_exec.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_exec.h,v 1.2 1996/04/17 05:23:47 mickey Exp $ */ /* $NetBSD: linux_exec.h,v 1.5 1995/10/07 06:27:01 mycroft Exp $ */ /* diff --git a/sys/compat/linux/linux_fcntl.h b/sys/compat/linux/linux_fcntl.h index 4c34e7d3f45..326e4c804df 100644 --- a/sys/compat/linux/linux_fcntl.h +++ b/sys/compat/linux/linux_fcntl.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_fcntl.h,v 1.2 1996/04/17 05:23:48 mickey Exp $ */ /* $NetBSD: linux_fcntl.h,v 1.1 1995/02/28 23:25:40 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index c05a89916f2..92f2858088f 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_file.c,v 1.13 1995/10/08 22:53:43 fvdl Exp $ */ +/* $OpenBSD: linux_file.c,v 1.2 1996/04/17 05:23:49 mickey Exp $ */ +/* $NetBSD: linux_file.c,v 1.14 1996/04/05 00:01:21 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -54,6 +55,15 @@ #include <compat/linux/linux_fcntl.h> #include <compat/linux/linux_util.h> +#include <machine/linux_machdep.h> + +static int linux_to_bsd_ioflags __P((int)); +static int bsd_to_linux_ioflags __P((int)); +static void bsd_to_linux_flock __P((struct flock *, struct linux_flock *)); +static void linux_to_bsd_flock __P((struct linux_flock *, struct flock *)); +static void bsd_to_linux_stat __P((struct stat *, struct linux_stat *)); +static int linux_stat1 __P((struct proc *, void *, register_t *, int)); + /* * Some file-related calls are handled here. The usual flag conversion * an structure conversion is done, and alternate emul path searching. @@ -64,7 +74,8 @@ * of the flags used in open(2) and fcntl(2). */ static int -linux_to_bsd_ioflags(int lflags) +linux_to_bsd_ioflags(lflags) + int lflags; { int res = 0; @@ -84,7 +95,8 @@ linux_to_bsd_ioflags(int lflags) } static int -bsd_to_linux_ioflags(int bflags) +bsd_to_linux_ioflags(bflags) + int bflags; { int res = 0; @@ -483,9 +495,9 @@ linux_sys_fstat(p, v, retval) } static int -linux_stat1(p, uap, retval, dolstat) +linux_stat1(p, v, retval, dolstat) struct proc *p; - struct linux_sys_stat_args *uap; + void *v; register_t *retval; int dolstat; { @@ -494,6 +506,7 @@ linux_stat1(p, uap, retval, dolstat) struct stat *st, tmpst; caddr_t sg; int error; + struct linux_sys_stat_args *uap = v; sg = stackgap_init(p->p_emul); diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 4d6ab75d3b3..35de6a5e658 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_ioctl.c,v 1.13 1996/03/08 04:56:03 mycroft Exp $ */ +/* $OpenBSD: linux_ioctl.c,v 1.5 1996/04/17 05:23:50 mickey Exp $ */ +/* $NetBSD: linux_ioctl.c,v 1.14 1996/04/05 00:01:28 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -44,9 +45,9 @@ #include <sys/syscallargs.h> #include <compat/linux/linux_types.h> -#include <compat/linux/linux_ioctl.h> #include <compat/linux/linux_signal.h> #include <compat/linux/linux_syscallargs.h> +#include <compat/linux/linux_ioctl.h> /* * Most ioctl command are just converted to their NetBSD values, diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index f1c8592eaf5..6f1996a16d7 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -1,4 +1,5 @@ -/* $NetBSD: linux_ioctl.h,v 1.3 1996/03/08 04:56:04 mycroft Exp $ */ +/* $OpenBSD: linux_ioctl.h,v 1.3 1996/04/17 05:23:51 mickey Exp $ */ +/* $NetBSD: linux_ioctl.h,v 1.4 1996/04/05 00:01:36 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -33,3 +34,12 @@ #define _LINUX_IO(x,y) (((x) << 8) | (y)) #define LINUX_IOCGROUP(x) (((x) >> 8) & 0xff) + +struct linux_sys_ioctl_args; +int linux_ioctl_audio __P((struct proc *, struct linux_sys_ioctl_args *, + register_t *)); +int linux_machdepioctl __P((struct proc *, void *, register_t *)); +int linux_ioctl_termios __P((struct proc *, struct linux_sys_ioctl_args *, + register_t *)); +int linux_ioctl_socket __P((struct proc *, struct linux_sys_ioctl_args *, + register_t *)); diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 407a075eb7e..1212be8410b 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_ipc.c,v 1.9 1995/10/08 22:49:29 fvdl Exp $ */ +/* $OpenBSD: linux_ipc.c,v 1.2 1996/04/17 05:23:52 mickey Exp $ */ +/* $NetBSD: linux_ipc.c,v 1.10 1996/04/05 00:01:44 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -75,6 +76,10 @@ static int linux_semget __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); static int linux_semctl __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); +static void bsd_to_linux_semid_ds __P((struct semid_ds *, + struct linux_semid_ds *)); +static void linux_to_bsd_semid_ds __P((struct linux_semid_ds *, + struct semid_ds *)); #endif #ifdef SYSVMSG @@ -82,10 +87,14 @@ static int linux_msgsnd __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); static int linux_msgrcv __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); -static int linux_msgop __P((struct proc *, struct linux_sys_ipc_args *, +static int linux_msgget __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); static int linux_msgctl __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); +static void linux_to_bsd_msqid_ds __P((struct linux_msqid_ds *, + struct msqid_ds *)); +static void bsd_to_linux_msqid_ds __P((struct msqid_ds *, + struct linux_msqid_ds *)); #endif #ifdef SYSVSHM @@ -97,9 +106,18 @@ static int linux_shmget __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); static int linux_shmctl __P((struct proc *, struct linux_sys_ipc_args *, register_t *)); +static void linux_to_bsd_shmid_ds __P((struct linux_shmid_ds *, + struct shmid_ds *)); +static void bsd_to_linux_shmid_ds __P((struct shmid_ds *, + struct linux_shmid_ds *)); #endif +static void linux_to_bsd_ipc_perm __P((struct linux_ipc_perm *, + struct ipc_perm *)); +static void bsd_to_linux_ipc_perm __P((struct ipc_perm *, + struct linux_ipc_perm *)); + int linux_sys_ipc(p, v, retval) struct proc *p; @@ -113,7 +131,6 @@ linux_sys_ipc(p, v, retval) syscallarg(int) a3; syscallarg(caddr_t) ptr; } */ *uap = v; - int what, error; switch (SCARG(uap, what)) { #ifdef SYSVSEM @@ -386,7 +403,7 @@ bsd_to_linux_msqid_ds(bmp, lmp) lmp->l_msg_ctime = bmp->msg_ctime; } -int +static int linux_msgsnd(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -408,7 +425,7 @@ linux_msgsnd(p, uap, retval) return sys_msgsnd(p, &bma, retval); } -int +static int linux_msgrcv(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -436,7 +453,7 @@ linux_msgrcv(p, uap, retval) return sys_msgrcv(p, &bma, retval); } -int +static int linux_msgget(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -456,7 +473,7 @@ linux_msgget(p, uap, retval) return sys_msgget(p, &bma, retval); } -int +static int linux_msgctl(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -510,7 +527,7 @@ linux_msgctl(p, uap, retval) * in which the return value is to be passed. This is subsequently * handled by libc, apparently. */ -int +static int linux_shmat(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -544,7 +561,7 @@ linux_shmat(p, uap, retval) * shmdt(): this could have been mapped directly, if it wasn't for * the extra indirection by the linux_ipc system call. */ -int +static int linux_shmdt(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -566,7 +583,7 @@ linux_shmdt(p, uap, retval) /* * Same story as shmdt. */ -int +static int linux_shmget(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { @@ -636,7 +653,7 @@ bsd_to_linux_shmid_ds(bsp, lsp) * * The usual structure conversion and massaging is done. */ -int +static int linux_shmctl(p, uap, retval) struct proc *p; struct linux_sys_ipc_args /* { diff --git a/sys/compat/linux/linux_ipc.h b/sys/compat/linux/linux_ipc.h index 1f9245f6ed8..963f437b2f6 100644 --- a/sys/compat/linux/linux_ipc.h +++ b/sys/compat/linux/linux_ipc.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_ipc.h,v 1.2 1996/04/17 05:23:53 mickey Exp $ */ /* $NetBSD: linux_ipc.h,v 1.1 1995/02/28 23:25:47 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_ipccall.h b/sys/compat/linux/linux_ipccall.h index 854b641dac2..835f72d1b5d 100644 --- a/sys/compat/linux/linux_ipccall.h +++ b/sys/compat/linux/linux_ipccall.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_ipccall.h,v 1.2 1996/04/17 05:23:54 mickey Exp $ */ /* $NetBSD: linux_ipccall.h,v 1.2 1995/08/15 21:14:33 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 7f0c693cf26..57bef416c1c 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_misc.c,v 1.24 1995/12/18 14:35:08 fvdl Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.4 1996/04/17 05:23:54 mickey Exp $ */ +/* $NetBSD: linux_misc.c,v 1.26 1996/04/04 23:56:01 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -76,12 +77,18 @@ #include <compat/linux/linux_util.h> #include <compat/linux/linux_dirent.h> +/* linux_misc.c */ +static void bsd_to_linux_wstat __P((int *)); +static void bsd_to_linux_statfs __P((struct statfs *, struct linux_statfs *)); +int linux_select1 __P((struct proc *, register_t *, int, fd_set *, fd_set *, + fd_set *, struct timeval *)); + /* * The information on a terminated (or stopped) process needs * to be converted in order for Linux binaries to get a valid signal * number out of it. */ -static int +static void bsd_to_linux_wstat(status) int *status; { @@ -181,7 +188,6 @@ linux_sys_wait4(p, v, retval) return error; bsd_to_linux_wstat(&tstat); - return copyout(&tstat, SCARG(uap, status), sizeof tstat); } @@ -198,9 +204,11 @@ linux_sys_break(p, v, retval) void *v; register_t *retval; { +#if 0 struct linux_sys_brk_args /* { syscallarg(char *) nsize; } */ *uap = v; +#endif return ENOSYS; } @@ -221,8 +229,7 @@ linux_sys_brk(p, v, retval) char *nbrk = SCARG(uap, nsize); struct sys_obreak_args oba; struct vmspace *vm = p->p_vmspace; - int error = 0; - caddr_t oldbrk, newbrk; + caddr_t oldbrk; oldbrk = vm->vm_daddr + ctob(vm->vm_dsize); /* @@ -606,7 +613,7 @@ linux_sys_alarm(p, v, retval) struct linux_sys_alarm_args /* { syscallarg(unsigned int) secs; } */ *uap = v; - int error, s; + int s; struct itimerval *itp, it; itp = &p->p_realtimer; @@ -750,10 +757,10 @@ linux_sys_getdents(p, v, retval) } */ *uap = v; register struct dirent *bdp; struct vnode *vp; - caddr_t inp, buf; /* BSD-format */ - int len, reclen; /* BSD-format */ - caddr_t outp; /* Linux-format */ - int resid, linux_reclen;/* Linux-format */ + caddr_t inp, buf; /* BSD-format */ + int len, reclen; /* BSD-format */ + caddr_t outp; /* Linux-format */ + int resid, linux_reclen = 0; /* Linux-format */ struct file *fp; struct uio auio; struct iovec aiov; @@ -1029,9 +1036,10 @@ linux_sys_getpgid(p, v, retval) } */ *uap = v; struct proc *targp; - if (SCARG(uap, pid) != 0 && SCARG(uap, pid) != p->p_pid) + if (SCARG(uap, pid) != 0 && SCARG(uap, pid) != p->p_pid) { if ((targp = pfind(SCARG(uap, pid))) == 0) return ESRCH; + } else targp = p; diff --git a/sys/compat/linux/linux_mmap.h b/sys/compat/linux/linux_mmap.h index 3b13dcc0c46..248864beda5 100644 --- a/sys/compat/linux/linux_mmap.h +++ b/sys/compat/linux/linux_mmap.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_mmap.h,v 1.2 1996/04/17 05:23:56 mickey Exp $ */ /* $NetBSD: linux_mmap.h,v 1.1 1995/02/28 23:25:52 fvdl Exp $ */ /* * Copyright (c) 1995 Frank van der Linden diff --git a/sys/compat/linux/linux_msg.h b/sys/compat/linux/linux_msg.h index b7858236dbb..992457190dc 100644 --- a/sys/compat/linux/linux_msg.h +++ b/sys/compat/linux/linux_msg.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_msg.h,v 1.2 1996/04/17 05:23:56 mickey Exp $ */ /* $NetBSD: linux_msg.h,v 1.2 1995/08/15 21:14:34 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_sem.h b/sys/compat/linux/linux_sem.h index 8cfbdab7f9a..2177679e273 100644 --- a/sys/compat/linux/linux_sem.h +++ b/sys/compat/linux/linux_sem.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_sem.h,v 1.2 1996/04/17 05:23:57 mickey Exp $ */ /* $NetBSD: linux_sem.h,v 1.1 1995/08/15 21:14:35 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_shm.h b/sys/compat/linux/linux_shm.h index 098595062d1..1c1f83c2d35 100644 --- a/sys/compat/linux/linux_shm.h +++ b/sys/compat/linux/linux_shm.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_shm.h,v 1.2 1996/04/17 05:23:58 mickey Exp $ */ /* $NetBSD: linux_shm.h,v 1.1 1995/02/28 23:25:57 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 212a0f254ee..a6e1c5f6466 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_signal.c,v 1.9 1995/10/07 06:27:12 mycroft Exp $ */ +/* $OpenBSD: linux_signal.c,v 1.2 1996/04/17 05:23:59 mickey Exp $ */ +/* $NetBSD: linux_signal.c,v 1.10 1996/04/04 23:51:36 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -131,6 +132,13 @@ int linux_to_bsd_sig[] = { 0, }; + +/* linux_signal.c */ +void linux_to_bsd_sigset __P((const linux_sigset_t *, sigset_t *)); +void bsd_to_linux_sigset __P((const sigset_t *, linux_sigset_t *)); +void linux_to_bsd_sigaction __P((struct linux_sigaction *, struct sigaction *)); +void bsd_to_linux_sigaction __P((struct sigaction *, struct linux_sigaction *)); + /* * Ok, we know that Linux and BSD signals both are just an unsigned int. * Don't bother to use the sigismember() stuff for now. @@ -180,7 +188,7 @@ linux_to_bsd_sigaction(lsa, bsa) { bsa->sa_handler = lsa->sa_handler; - linux_to_bsd_sigset(&bsa->sa_mask, &lsa->sa_mask); + linux_to_bsd_sigset(&lsa->sa_mask, &bsa->sa_mask); bsa->sa_flags = 0; if ((lsa->sa_flags & LINUX_SA_ONSTACK) != 0) bsa->sa_flags |= SA_ONSTACK; @@ -201,7 +209,7 @@ bsd_to_linux_sigaction(bsa, lsa) { lsa->sa_handler = bsa->sa_handler; - bsd_to_linux_sigset(&lsa->sa_mask, &bsa->sa_mask); + bsd_to_linux_sigset(&bsa->sa_mask, &lsa->sa_mask); lsa->sa_flags = 0; if ((bsa->sa_flags & SA_NOCLDSTOP) != 0) lsa->sa_flags |= LINUX_SA_NOCLDSTOP; @@ -420,7 +428,7 @@ linux_sys_sigsetmask(p, v, retval) bsd_to_linux_sigset(&p->p_sigmask, (linux_sigset_t *)retval); mask = SCARG(uap, mask); - bsd_to_linux_sigset(&mask, &bsdsig); + bsd_to_linux_sigset(&bsdsig, &mask); splhigh(); p->p_sigmask = bsdsig & ~sigcantmask; @@ -459,8 +467,9 @@ linux_sys_sigsuspend(p, v, retval) syscallarg(int) mask; } */ *uap = v; struct sys_sigsuspend_args sa; + linux_sigset_t mask = SCARG(uap, mask); - linux_to_bsd_sigset(&SCARG(uap, mask), &SCARG(&sa, mask)); + linux_to_bsd_sigset(&mask, &SCARG(&sa, mask)); return sys_sigsuspend(p, &sa, retval); } diff --git a/sys/compat/linux/linux_signal.h b/sys/compat/linux/linux_signal.h index e002dbf7c3d..30b16d8fd05 100644 --- a/sys/compat/linux/linux_signal.h +++ b/sys/compat/linux/linux_signal.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_signal.h,v 1.2 1996/04/17 05:24:00 mickey Exp $ */ /* $NetBSD: linux_signal.h,v 1.4 1995/08/27 20:51:51 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 911095aae77..59cfeffe5ec 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_socket.c,v 1.13 1996/03/08 04:56:05 mycroft Exp $ */ +/* $OpenBSD: linux_socket.c,v 1.3 1996/04/17 05:24:01 mickey Exp $ */ +/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -71,6 +72,36 @@ * are copied to structures. */ +int linux_to_bsd_domain __P((int)); +int linux_socket __P((struct proc *, struct linux_socket_args *, register_t *)); +int linux_bind __P((struct proc *, struct linux_bind_args *, register_t *)); +int linux_connect __P((struct proc *, struct linux_connect_args *, + register_t *)); +int linux_listen __P((struct proc *, struct linux_listen_args *, register_t *)); +int linux_accept __P((struct proc *, struct linux_accept_args *, register_t *)); +int linux_getsockname __P((struct proc *, struct linux_getsockname_args *, + register_t *)); +int linux_getpeername __P((struct proc *, struct linux_getpeername_args *, + register_t *)); +int linux_socketpair __P((struct proc *, struct linux_socketpair_args *, + register_t *)); +int linux_send __P((struct proc *, struct linux_send_args *, register_t *)); +int linux_recv __P((struct proc *, struct linux_recv_args *, register_t *)); +int linux_sendto __P((struct proc *, struct linux_sendto_args *, register_t *)); +int linux_recvfrom __P((struct proc *, struct linux_recvfrom_args *, + register_t *)); +int linux_shutdown __P((struct proc *, struct linux_shutdown_args *, + register_t *)); +int linux_to_bsd_sopt_level __P((int)); +int linux_to_bsd_so_sockopt __P((int)); +int linux_to_bsd_ip_sockopt __P((int)); +int linux_to_bsd_tcp_sockopt __P((int)); +int linux_to_bsd_udp_sockopt __P((int)); +int linux_setsockopt __P((struct proc *, struct linux_setsockopt_args *, + register_t *)); +int linux_getsockopt __P((struct proc *, struct linux_getsockopt_args *, + register_t *)); + /* * Convert between Linux and BSD socket domain values */ diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index a0da285cfa2..1cd4d53d341 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_socket.h,v 1.2 1996/04/17 05:24:02 mickey Exp $ */ /* $NetBSD: linux_socket.h,v 1.3 1995/05/28 10:16:34 mycroft Exp $ */ /* diff --git a/sys/compat/linux/linux_socketcall.h b/sys/compat/linux/linux_socketcall.h index 60b1156f2bc..70cb3680ce6 100644 --- a/sys/compat/linux/linux_socketcall.h +++ b/sys/compat/linux/linux_socketcall.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_socketcall.h,v 1.2 1996/04/17 05:24:03 mickey Exp $ */ /* $NetBSD: linux_socketcall.h,v 1.1 1995/02/28 23:26:05 fvdl Exp $ */ /* diff --git a/sys/compat/linux/linux_sockio.h b/sys/compat/linux/linux_sockio.h index c67e65ea340..1a7042cb958 100644 --- a/sys/compat/linux/linux_sockio.h +++ b/sys/compat/linux/linux_sockio.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_sockio.h,v 1.4 1996/04/17 05:24:04 mickey Exp $ */ /* $NetBSD: linux_sockio.h,v 1.5 1996/03/08 04:56:07 mycroft Exp $ */ /* diff --git a/sys/compat/linux/linux_syscall.h b/sys/compat/linux/linux_syscall.h index 9975c899f30..e420b556eb8 100644 --- a/sys/compat/linux/linux_syscall.h +++ b/sys/compat/linux/linux_syscall.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_syscall.h,v 1.3 1996/04/17 05:24:05 mickey Exp $ */ /* * System call numbers. * diff --git a/sys/compat/linux/linux_syscallargs.h b/sys/compat/linux/linux_syscallargs.h index b47f63a4874..20151068e39 100644 --- a/sys/compat/linux/linux_syscallargs.h +++ b/sys/compat/linux/linux_syscallargs.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_syscallargs.h,v 1.4 1996/04/17 05:24:06 mickey Exp $ */ /* * System call argument lists. * diff --git a/sys/compat/linux/linux_syscalls.c b/sys/compat/linux/linux_syscalls.c index 5062a0fb5bf..b1cdcfb3e74 100644 --- a/sys/compat/linux/linux_syscalls.c +++ b/sys/compat/linux/linux_syscalls.c @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_syscalls.c,v 1.3 1996/04/17 05:24:07 mickey Exp $ */ /* * System call names. * diff --git a/sys/compat/linux/linux_sysent.c b/sys/compat/linux/linux_sysent.c index db61518a095..f6b97573118 100644 --- a/sys/compat/linux/linux_sysent.c +++ b/sys/compat/linux/linux_sysent.c @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_sysent.c,v 1.4 1996/04/17 05:24:08 mickey Exp $ */ /* * System call switch table. * diff --git a/sys/compat/linux/linux_termios.c b/sys/compat/linux/linux_termios.c index 205340d4592..11cacd510f8 100644 --- a/sys/compat/linux/linux_termios.c +++ b/sys/compat/linux/linux_termios.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_termios.c,v 1.1 1996/03/08 04:56:08 mycroft Exp $ */ +/* $OpenBSD: linux_termios.c,v 1.2 1996/04/17 05:24:08 mickey Exp $ */ +/* $NetBSD: linux_termios.c,v 1.3 1996/04/05 00:01:54 christos Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -61,6 +62,16 @@ static int linux_spmasks[] = { LINUX_B57600, LINUX_B115200, LINUX_B230400 }; + +static void linux_termio_to_bsd_termios __P((struct linux_termio *, + struct termios *)); +static void bsd_termios_to_linux_termio __P((struct termios *, + struct linux_termio *)); +static void linux_termios_to_bsd_termios __P((struct linux_termios *, + struct termios *)); +static void bsd_termios_to_linux_termios __P((struct termios *, + struct linux_termios *)); + /* * Deal with termio ioctl cruft. This doesn't look very good.. * XXX too much code duplication, obviously.. @@ -71,7 +82,7 @@ static int linux_spmasks[] = { * values. */ -static int +static void linux_termio_to_bsd_termios(lt, bts) register struct linux_termio *lt; register struct termios *bts; @@ -154,7 +165,7 @@ linux_termio_to_bsd_termios(lt, bts) bts->c_cc[VMIN] = lt->c_cc[LINUX_VMIN]; } -static int +static void bsd_termios_to_linux_termio(bts, lt) register struct termios *bts; register struct linux_termio *lt; @@ -240,7 +251,7 @@ bsd_termios_to_linux_termio(bts, lt) lt->c_line = 0; } -static int +static void linux_termios_to_bsd_termios(lts, bts) register struct linux_termios *lts; register struct termios *bts; @@ -328,7 +339,7 @@ linux_termios_to_bsd_termios(lts, bts) bts->c_cc[VREPRINT] = lts->c_cc[LINUX_VREPRINT]; } -static int +static void bsd_termios_to_linux_termios(bts, lts) register struct termios *bts; register struct linux_termios *lts; diff --git a/sys/compat/linux/linux_termios.h b/sys/compat/linux/linux_termios.h index 8bf040ec913..be65628dc00 100644 --- a/sys/compat/linux/linux_termios.h +++ b/sys/compat/linux/linux_termios.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_termios.h,v 1.2 1996/04/17 05:24:09 mickey Exp $ */ #define LINUX_TCGETS _LINUX_IO('T', 1) #define LINUX_TCSETS _LINUX_IO('T', 2) #define LINUX_TCSETSW _LINUX_IO('T', 3) diff --git a/sys/compat/linux/linux_types.h b/sys/compat/linux/linux_types.h index c931a2ab560..a9da8aad44f 100644 --- a/sys/compat/linux/linux_types.h +++ b/sys/compat/linux/linux_types.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_types.h,v 1.2 1996/04/17 05:24:10 mickey Exp $ */ /* $NetBSD: linux_types.h,v 1.4 1995/08/21 03:42:11 mycroft Exp $ */ /* diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index 72fcdbd62c1..a0652749a85 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -1,3 +1,4 @@ +/* $OpenBSD: linux_util.h,v 1.2 1996/04/17 05:24:11 mickey Exp $ */ /* $NetBSD: linux_util.h,v 1.5 1995/06/24 20:20:42 christos Exp $ */ /* diff --git a/sys/compat/linux/syscalls.conf b/sys/compat/linux/syscalls.conf index 3b8796db129..a0974e142cb 100644 --- a/sys/compat/linux/syscalls.conf +++ b/sys/compat/linux/syscalls.conf @@ -1,3 +1,4 @@ +# $OpenBSD: syscalls.conf,v 1.2 1996/04/17 05:24:12 mickey Exp $ # $NetBSD: syscalls.conf,v 1.1 1995/02/28 23:26:24 fvdl Exp $ sysnames="linux_syscalls.c" diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master index 5e5ea73d16d..f5f49826ed6 100644 --- a/sys/compat/linux/syscalls.master +++ b/sys/compat/linux/syscalls.master @@ -1,8 +1,9 @@ + $OpenBSD: syscalls.master,v 1.4 1996/04/17 05:24:13 mickey Exp $ $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 -; NetBSD COMPAT_LINUX system call name/number "master" file. +; OpenBSD COMPAT_LINUX system call name/number "master" file. ; (See syscalls.conf to see what it is processed into.) ; ; Fields: number type [type-dependent ...] |