diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-26 20:23:43 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-26 20:23:43 +0000 |
commit | 1761d011b4a83a9818c0a207dae66dbcbf764e69 (patch) | |
tree | 1fd597a50c1a17327c0c3581a4b8a38b15b30ea9 /sys/compat/ultrix/ultrix_misc.c | |
parent | 9d7e2bf74d251f8245c717a45d446a0da7f6639b (diff) |
from netbsd:
Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.
Add emulation of Ultrix getmnt(2) in ultrix_fs.c
Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
Fix ultrix_sys_select() entry.
Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.
Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
Diffstat (limited to 'sys/compat/ultrix/ultrix_misc.c')
-rw-r--r-- | sys/compat/ultrix/ultrix_misc.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index 9a42e7bbaab..80512eac5e3 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_misc.c,v 1.16.2.1 1995/10/18 06:46:14 jonathan Exp $ */ +/* $NetBSD: ultrix_misc.c,v 1.18 1995/12/26 04:23:14 jonathan Exp $ */ /* * Copyright (c) 1992, 1993 @@ -193,6 +193,43 @@ ultrix_sys_execv(p, v, retval) return (sys_execve(p, &ouap, retval)); } +ultrix_sys_select(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct sys_select_args *uap = v; + struct timeval atv, *tvp; + int error; + + /* Limit number of FDs selected on to the native maximum */ + + if (SCARG(uap, nd) > FD_SETSIZE) + SCARG(uap, nd) = FD_SETSIZE; + + /* Check for negative timeval */ + if (SCARG(uap, tv)) { + error = copyin((caddr_t)SCARG(uap, tv), (caddr_t)&atv, + sizeof(atv)); + if (error) + goto done; +#ifdef DEBUG + /* Ultrix clients sometimes give negative timeouts? */ + if (atv.tv_sec < 0 || atv.tv_usec < 0) + printf("ultrix select( %d, %d)\n", + atv.tv_sec, atv.tv_usec); + /*tvp = (timeval *)STACKGAPBASE;*/ +#endif + + } + error = sys_select(p, (void*) uap, retval); + if (error == EINVAL) + printf("ultrix select: bad args?\n"); + +done: + return error; +} + #if defined(NFSCLIENT) async_daemon(p, v, retval) struct proc *p; |