From 575021aa90409e1fec01e80d1ecb75be4ec213f1 Mon Sep 17 00:00:00 2001 From: mickey Date: Wed, 17 Apr 1996 05:23:40 +0000 Subject: [PATCH] Good fixes and changes from latest Net. --- sys/compat/freebsd/freebsd_rtprio.h | 2 +- sys/compat/linux/Makefile | 1 + sys/compat/linux/files.linux | 1 + sys/compat/linux/linux_dirent.h | 1 + sys/compat/linux/linux_errno.h | 1 + sys/compat/linux/linux_error.c | 1 + sys/compat/linux/linux_exec.c | 11 +++++++- sys/compat/linux/linux_exec.h | 1 + sys/compat/linux/linux_fcntl.h | 1 + sys/compat/linux/linux_file.c | 23 ++++++++++++---- sys/compat/linux/linux_ioctl.c | 5 ++-- sys/compat/linux/linux_ioctl.h | 12 ++++++++- sys/compat/linux/linux_ipc.c | 39 ++++++++++++++++++++-------- sys/compat/linux/linux_ipc.h | 1 + sys/compat/linux/linux_ipccall.h | 1 + sys/compat/linux/linux_misc.c | 30 +++++++++++++-------- sys/compat/linux/linux_mmap.h | 1 + sys/compat/linux/linux_msg.h | 1 + sys/compat/linux/linux_sem.h | 1 + sys/compat/linux/linux_shm.h | 1 + sys/compat/linux/linux_signal.c | 19 ++++++++++---- sys/compat/linux/linux_signal.h | 1 + sys/compat/linux/linux_socket.c | 33 ++++++++++++++++++++++- sys/compat/linux/linux_socket.h | 1 + sys/compat/linux/linux_socketcall.h | 1 + sys/compat/linux/linux_sockio.h | 1 + sys/compat/linux/linux_syscall.h | 1 + sys/compat/linux/linux_syscallargs.h | 1 + sys/compat/linux/linux_syscalls.c | 1 + sys/compat/linux/linux_sysent.c | 1 + sys/compat/linux/linux_termios.c | 21 +++++++++++---- sys/compat/linux/linux_termios.h | 1 + sys/compat/linux/linux_types.h | 1 + sys/compat/linux/linux_util.h | 1 + sys/compat/linux/syscalls.conf | 1 + sys/compat/linux/syscalls.master | 3 ++- sys/compat/svr4/svr4_filio.c | 4 +-- sys/compat/svr4/svr4_ioctl.c | 6 ++--- sys/compat/svr4/svr4_misc.c | 10 +++---- sys/compat/svr4/svr4_net.c | 11 ++++---- sys/compat/svr4/svr4_signal.c | 14 +++++----- sys/compat/svr4/svr4_sockio.c | 6 ++--- sys/compat/svr4/svr4_stream.c | 16 ++++++------ sys/compat/svr4/svr4_termios.c | 23 ++++++++++++++-- sys/compat/svr4/svr4_ttold.c | 4 +-- 45 files changed, 236 insertions(+), 81 deletions(-) diff --git a/sys/compat/freebsd/freebsd_rtprio.h b/sys/compat/freebsd/freebsd_rtprio.h index 4f7b8c63359..f5d85ee0359 100644 --- a/sys/compat/freebsd/freebsd_rtprio.h +++ b/sys/compat/freebsd/freebsd_rtprio.h @@ -53,7 +53,7 @@ #define FREEBSD_RTP_LOOKUP 0 #define FREEBSD_RTP_SET 1 -#ifndef LOCORE +#ifndef _LOCORE struct freebsd_rtprio { u_short type; u_short prio; 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 #include #include +#include #include #include +#include + #include #include #include @@ -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 #include +#include + +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 #include -#include #include #include +#include /* * 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 #include +/* 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 ...] diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c index 6f553986c67..f7a5062922a 100644 --- a/sys/compat/svr4/svr4_filio.c +++ b/sys/compat/svr4/svr4_filio.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_filio.c,v 1.3 1995/10/07 06:27:40 mycroft Exp $ */ +/* $NetBSD: svr4_filio.c,v 1.4 1996/03/30 22:37:52 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -104,7 +104,7 @@ svr4_filioctl(fp, cmd, data, p, retval) return copyout(&num, data, sizeof(num)); default: - DPRINTF(("Unknown svr4 filio %x\n", cmd)); + DPRINTF(("Unknown svr4 filio %lx\n", cmd)); return 0; /* ENOSYS really */ } } diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index a56bd290cbf..d230a0e5dca 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_ioctl.c,v 1.3 1996/02/26 23:31:57 niklas Exp $ */ -/* $NetBSD: svr4_ioctl.c,v 1.14 1996/02/10 00:48:08 christos Exp $ */ +/* $OpenBSD: svr4_ioctl.c,v 1.4 1996/04/17 05:24:17 mickey Exp $ */ +/* $NetBSD: svr4_ioctl.c,v 1.15 1996/03/30 22:37:57 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -131,7 +131,7 @@ svr4_sys_ioctl(p, v, retval) return svr4_sockioctl(fp, cmd, SCARG(uap, data), p, retval); default: - DPRINTF(("Unimplemented ioctl %x\n", cmd)); + DPRINTF(("Unimplemented ioctl %lx\n", cmd)); return 0; /* XXX: really ENOSYS */ } } diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index ae843100e61..39a7e5795fa 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_misc.c,v 1.3 1996/02/26 23:31:57 niklas Exp $ */ -/* $NetBSD: svr4_misc.c,v 1.35 1996/02/10 17:12:31 christos Exp $ */ +/* $OpenBSD: svr4_misc.c,v 1.4 1996/04/17 05:24:18 mickey Exp $ */ +/* $NetBSD: svr4_misc.c,v 1.36 1996/03/30 22:38:02 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -584,7 +584,7 @@ svr4_sys_break(p, v, retval) new = round_page(SCARG(uap, nsize)); diff = new - old; - DPRINTF(("break(1): old %x new %x diff %x\n", old, new, diff)); + DPRINTF(("break(1): old %lx new %lx diff %x\n", old, new, diff)); if (diff > p->p_rlimit[RLIMIT_DATA].rlim_cur) return ENOMEM; @@ -594,7 +594,7 @@ svr4_sys_break(p, v, retval) vm->vm_dsize, ctob(vm->vm_dsize))); diff = new - old; - DPRINTF(("break(3): old %x new %x diff %x\n", old, new, diff)); + DPRINTF(("break(3): old %lx new %lx diff %x\n", old, new, diff)); if (diff > 0) { rv = vm_allocate(&vm->vm_map, &old, diff, FALSE); @@ -935,7 +935,7 @@ svr4_setinfo(p, st, s) i.si_code = SVR4_CLD_KILLED; } - DPRINTF(("siginfo [pid %d signo %d code %d errno %d status %d]\n", + DPRINTF(("siginfo [pid %ld signo %d code %d errno %d status %d]\n", i.si_pid, i.si_signo, i.si_code, i.si_errno, i.si_status)); return copyout(&i, s, sizeof(i)); diff --git a/sys/compat/svr4/svr4_net.c b/sys/compat/svr4/svr4_net.c index a425818e2b0..778bd936c8b 100644 --- a/sys/compat/svr4/svr4_net.c +++ b/sys/compat/svr4/svr4_net.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_net.c,v 1.3 1996/02/26 23:31:59 niklas Exp $ */ -/* $NetBSD: svr4_net.c,v 1.6 1996/02/04 02:01:07 christos Exp $ */ +/* $OpenBSD: svr4_net.c,v 1.4 1996/04/17 05:24:19 mickey Exp $ */ +/* $NetBSD: svr4_net.c,v 1.8 1996/03/30 22:41:02 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -49,6 +49,7 @@ #include #include #include +#include #include @@ -71,10 +72,10 @@ enum { int svr4_netattach __P((int)); -static int svr4_netclose __P((struct file *fp, struct proc *p)); +static int svr4_soo_close __P((struct file *fp, struct proc *p)); static struct fileops svr4_netops = { - soo_read, soo_write, soo_ioctl, soo_select, svr4_netclose + soo_read, soo_write, soo_ioctl, soo_select, svr4_soo_close }; @@ -164,7 +165,7 @@ svr4_netopen(dev, flag, mode, p) } static int -svr4_netclose(fp, p) +svr4_soo_close(fp, p) struct file *fp; struct proc *p; { diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c index 6fa34044718..4ba26f57853 100644 --- a/sys/compat/svr4/svr4_signal.c +++ b/sys/compat/svr4/svr4_signal.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_signal.c,v 1.3 1996/02/26 23:31:59 niklas Exp $ */ -/* $NetBSD: svr4_signal.c,v 1.21 1996/02/09 23:12:18 christos Exp $ */ +/* $OpenBSD: svr4_signal.c,v 1.4 1996/04/17 05:24:20 mickey Exp $ */ +/* $NetBSD: svr4_signal.c,v 1.23 1996/03/30 22:38:07 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -57,13 +57,13 @@ #define svr4_sigismember(s, n) ((s)->bits[svr4_sigword(n)] & svr4_sigmask(n)) #define svr4_sigaddset(s, n) ((s)->bits[svr4_sigword(n)] |= svr4_sigmask(n)) -static __inline int svr4_sigfillset __P((svr4_sigset_t *)); +static __inline void svr4_sigfillset __P((svr4_sigset_t *)); void svr4_to_bsd_sigaction __P((const struct svr4_sigaction *, struct sigaction *)); void bsd_to_svr4_sigaction __P((const struct sigaction *, struct svr4_sigaction *)); -static __inline int +static __inline void svr4_sigfillset(s) svr4_sigset_t *s; { @@ -631,19 +631,19 @@ svr4_sys_context(p, v, retval) switch (SCARG(uap, func)) { case 0: - DPRINTF(("getcontext(%x)\n", SCARG(uap, uc))); + DPRINTF(("getcontext(%p)\n", SCARG(uap, uc))); svr4_getcontext(p, &uc, p->p_sigmask, p->p_sigacts->ps_sigstk.ss_flags & SS_ONSTACK); return copyout(&uc, SCARG(uap, uc), sizeof(uc)); case 1: - DPRINTF(("setcontext(%x)\n", SCARG(uap, uc))); + DPRINTF(("setcontext(%p)\n", SCARG(uap, uc))); if ((error = copyin(SCARG(uap, uc), &uc, sizeof(uc))) != 0) return error; return svr4_setcontext(p, &uc); default: - DPRINTF(("context(%d, %x)\n", SCARG(uap, func), + DPRINTF(("context(%d, %p)\n", SCARG(uap, func), SCARG(uap, uc))); return ENOSYS; } diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c index e7c68f44ea1..8340b5aed58 100644 --- a/sys/compat/svr4/svr4_sockio.c +++ b/sys/compat/svr4/svr4_sockio.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_sockio.c,v 1.2 1996/02/26 23:32:00 niklas Exp $ */ -/* $NetBSD: svr4_sockio.c,v 1.6 1996/02/09 23:12:20 christos Exp $ */ +/* $OpenBSD: svr4_sockio.c,v 1.3 1996/04/17 05:24:21 mickey Exp $ */ +/* $NetBSD: svr4_sockio.c,v 1.7 1996/03/30 22:38:14 christos Exp $ */ /* * Copyright (c) 1995 Christos Zoulas @@ -135,7 +135,7 @@ svr4_sockioctl(fp, cmd, data, p, retval) default: - DPRINTF(("Unknown svr4 sockio %x\n", cmd)); + DPRINTF(("Unknown svr4 sockio %lx\n", cmd)); return 0; /* ENOSYS really */ } } diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index fcd4a109afe..e98ac9b7196 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_stream.c,v 1.2 1996/02/26 23:32:03 niklas Exp $ */ -/* $NetBSD: svr4_stream.c,v 1.11 1996/02/10 00:48:12 christos Exp $ */ +/* $OpenBSD: svr4_stream.c,v 1.3 1996/04/17 05:24:22 mickey Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.12 1996/03/30 22:38:19 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -228,7 +228,7 @@ svr4_sockmod(fp, ioc, p) return 0; default: - DPRINTF(("Unknown sockmod ioctl %x\n", ioc->cmd)); + DPRINTF(("Unknown sockmod ioctl %lx\n", ioc->cmd)); return 0; } @@ -324,7 +324,7 @@ svr4_timod(fp, ioc, p) return 0; default: - DPRINTF(("Unknown timod ioctl %x\n", ioc->cmd)); + DPRINTF(("Unknown timod ioctl %lx\n", ioc->cmd)); return 0; } } @@ -340,7 +340,7 @@ svr4_showioc(str, ioc) int error; int i; - printf("%s cmd = %d, timeout = %d, len = %d, buf = %p { ", + printf("%s cmd = %ld, timeout = %d, len = %d, buf = %p { ", str, ioc->cmd, ioc->timeout, ioc->len, ioc->buf); if ((error = copyin(ioc->buf, ptr, ioc->len)) != 0) { @@ -430,7 +430,7 @@ svr4_streamioctl(fp, cmd, dat, p, retval) break; default: - DPRINTF(("Unimplemented module %c %d\n", + DPRINTF(("Unimplemented module %c %ld\n", (char) (cmd >> 8), cmd & 0xff)); return 0; } @@ -551,7 +551,7 @@ svr4_streamioctl(fp, cmd, dat, p, retval) return 0; default: - DPRINTF(("unimpl cmd = %x\n", cmd)); + DPRINTF(("unimpl cmd = %lx\n", cmd)); break; } @@ -751,7 +751,7 @@ svr4_sys_putmsg(p, v, retval) return error; } default: - DPRINTF(("putmsg: Unimplemented command %x\n", sc.cmd)); + DPRINTF(("putmsg: Unimplemented command %lx\n", sc.cmd)); return ENOSYS; } } diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c index b9c4a2f8b6e..e00a0d80ddc 100644 --- a/sys/compat/svr4/svr4_termios.c +++ b/sys/compat/svr4/svr4_termios.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_termios.c,v 1.6 1995/10/14 20:24:58 christos Exp $ */ +/* $NetBSD: svr4_termios.c,v 1.8 1996/03/30 22:38:23 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -541,8 +541,27 @@ svr4_termioctl(fp, cmd, data, p, retval) return (*ctl)(fp, cmd, (caddr_t) &bt, p); + case SVR4_TIOCGWINSZ: + { + struct svr4_winsize ws; + + error = (*ctl)(fp, TIOCGWINSZ, (caddr_t) &ws, p); + if (error) + return error; + return copyout(&st, data, sizeof(st)); + } + + case SVR4_TIOCSWINSZ: + { + struct svr4_winsize ws; + + if ((error = copyin(data, &ws, sizeof(ws))) != 0) + return error; + return (*ctl)(fp, TIOCSWINSZ, (caddr_t) &ws, p); + } + default: - DPRINTF(("Unknown svr4 termios %x\n", cmd)); + DPRINTF(("Unknown svr4 termios %lx\n", cmd)); return ENOSYS; } } diff --git a/sys/compat/svr4/svr4_ttold.c b/sys/compat/svr4/svr4_ttold.c index 0ce97072dad..bfc1c574781 100644 --- a/sys/compat/svr4/svr4_ttold.c +++ b/sys/compat/svr4/svr4_ttold.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_ttold.c,v 1.7 1995/10/14 20:25:01 christos Exp $ */ +/* $NetBSD: svr4_ttold.c,v 1.8 1996/03/30 22:38:27 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -282,7 +282,7 @@ svr4_ttoldioctl(fp, cmd, data, p, retval) } default: - DPRINTF(("Unknown svr4 ttold %x\n", cmd)); + DPRINTF(("Unknown svr4 ttold %lx\n", cmd)); return 0; /* ENOSYS really */ } } -- 2.20.1