diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-01-08 19:30:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-01-08 19:30:29 +0000 |
commit | 889b7362ce39de7fd488802b99f9d23a01f3a7dc (patch) | |
tree | 3e87c6eadb9f04dc3deb002e55d8c768c086b23a /sys/compat/ultrix | |
parent | d6e3f036697796bf7af2cb3e1e6798efad7c598c (diff) |
from netbsd:
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
Diffstat (limited to 'sys/compat/ultrix')
-rw-r--r-- | sys/compat/ultrix/files.ultrix | 3 | ||||
-rw-r--r-- | sys/compat/ultrix/syscalls.master | 10 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_misc.c | 157 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_pathname.c | 304 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_syscall.h | 2 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_syscallargs.h | 30 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_syscalls.c | 2 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_sysent.c | 18 | ||||
-rw-r--r-- | sys/compat/ultrix/ultrix_util.h | 41 |
9 files changed, 404 insertions, 163 deletions
diff --git a/sys/compat/ultrix/files.ultrix b/sys/compat/ultrix/files.ultrix index 1e2fc3d780f..7425a11eae6 100644 --- a/sys/compat/ultrix/files.ultrix +++ b/sys/compat/ultrix/files.ultrix @@ -1,4 +1,4 @@ -# $NetBSD: files.ultrix,v 1.2 1995/12/26 04:22:30 jonathan Exp $ +# $NetBSD: files.ultrix,v 1.3 1996/01/07 13:38:49 jonathan Exp $ # # Config file description for machine-independent Ultrix compat code. # Included by ports that need it. @@ -6,6 +6,7 @@ # ports should define any machine-specific files they need in their # own file lists. +file compat/ultrix/ultrix_pathname.c compat_ultrix file compat/ultrix/ultrix_ioctl.c compat_ultrix file compat/ultrix/ultrix_misc.c compat_ultrix file compat/ultrix/ultrix_syscalls.c compat_ultrix diff --git a/sys/compat/ultrix/syscalls.master b/sys/compat/ultrix/syscalls.master index 7fb63c6c1c0..d37a9714466 100644 --- a/sys/compat/ultrix/syscalls.master +++ b/sys/compat/ultrix/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.14 1995/12/26 10:06:15 jonathan Exp $ + $NetBSD: syscalls.master,v 1.15 1996/01/07 13:38:57 jonathan Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -47,7 +47,7 @@ int mode); } 6 NOARGS { int sys_close(int fd); } 7 NOARGS { int compat_43_sys_wait(void); } owait -8 NOARGS { int compat_43_sys_creat(char *path, int mode); } +8 STD { int ultrix_sys_creat(char *path, int mode); } 9 NOARGS { int sys_link(char *path, char *link); } 10 NOARGS { int sys_unlink(char *path); } 11 STD { int ultrix_sys_execv(char *path, char **argp); } @@ -74,15 +74,15 @@ 30 OBSOL v7 utime 31 OBSOL v7 stty 32 OBSOL v7 gtty -33 NOARGS { int sys_access(char *path, int flags); } +33 STD { int ultrix_sys_access(char *path, int flags); } 34 OBSOL v7 nice 35 OBSOL v7 ftime 36 NOARGS { int sys_sync(void); } 37 NOARGS { int sys_kill(int pid, int signum); } -38 NOARGS { int compat_43_sys_stat(char *path, \ +38 STD { int ultrix_sys_stat(char *path, \ struct ostat *ub); } ostat 39 OBSOL v7 setpgrp -40 NOARGS { int compat_43_sys_lstat(char *path, \ +40 STD { int ultrix_sys_lstat(char *path, \ struct ostat *ub); } olstat 41 NOARGS { int sys_dup(u_int fd); } 42 NOARGS { int sys_pipe(void); } diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index eca5fa1ba0b..1f5b5341658 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.19 1996/01/03 21:07:33 jonathan Exp $ */ +/* $NetBSD: ultrix_misc.c,v 1.20 1996/01/07 13:38:51 jonathan Exp $ */ /* * Copyright (c) 1992, 1993 @@ -60,9 +60,9 @@ #include <sys/dir.h> #include <sys/proc.h> #include <sys/file.h> -#include <sys/stat.h> #include <sys/filedesc.h> -#include <sys/ioctl.h> +/*#include <sys/stat.h>*/ +/*#include <sys/ioctl.h>*/ #include <sys/kernel.h> #include <sys/exec.h> #include <sys/malloc.h> @@ -79,6 +79,7 @@ #include <sys/wait.h> #include <sys/utsname.h> #include <sys/unistd.h> + #include <sys/syscallargs.h> #include <compat/ultrix/ultrix_syscall.h> @@ -111,7 +112,6 @@ struct emul emul_ultrix = { 0, copyargs, cpu_exec_ecoff_setregs, - /* 0, 0, */ sigcode, esigcode, }; @@ -181,21 +181,11 @@ ultrix_sys_wait3(p, v, retval) return (sys_wait4(p, &ua, retval)); } -ultrix_sys_execv(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ultrix_sys_execv_args *uap = v; - struct sys_execve_args ouap; - - SCARG(&ouap, path) = SCARG(uap, path); - SCARG(&ouap, argp) = SCARG(uap, argp); - SCARG(&ouap, envp) = NULL; - - return (sys_execve(p, &ouap, retval)); -} - +/* + * Ultrix binaries pass in FD_MAX as the first arg to select(). + * On Ultrix, that is 4096, which is more than the NetBSD sys_select() + * can handle. + */ ultrix_sys_select(p, v, retval) struct proc *p; void *v; @@ -260,6 +250,7 @@ struct dirent { #define SUN__MAP_NEW 0x80000000 /* if not, old mmap & cannot handle */ +int ultrix_sys_mmap(p, v, retval) register struct proc *p; void *v; @@ -357,6 +348,7 @@ struct ultrix_utsname { char machine[9]; }; +int ultrix_sys_uname(p, v, retval) struct proc *p; void *v; @@ -400,40 +392,8 @@ ultrix_sys_setpgrp(p, v, retval) return sys_setpgid(p, uap, retval); } -ultrix_sys_open(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ultrix_sys_open_args *uap = v; - int l, r; - int noctty; - int ret; - - /* convert open flags into NetBSD flags */ - l = SCARG(uap, flags); - noctty = l & 0x8000; - r = (l & (0x0001 | 0x0002 | 0x0008 | 0x0040 | 0x0200 | 0x0400 | 0x0800)); - r |= ((l & (0x0004 | 0x1000 | 0x4000)) ? O_NONBLOCK : 0); - r |= ((l & 0x0080) ? O_SHLOCK : 0); - r |= ((l & 0x0100) ? O_EXLOCK : 0); - r |= ((l & 0x2000) ? O_FSYNC : 0); - - SCARG(uap, flags) = r; - ret = sys_open(p, (struct sys_open_args *)uap, retval); - - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { - struct filedesc *fdp = p->p_fd; - struct file *fp = fdp->fd_ofiles[*retval]; - - /* ignore any error, just give it a try */ - if (fp->f_type == DTYPE_VNODE) - (fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t)0, p); - } - return ret; -} - #if defined (NFSSERVER) +int ultrix_sys_nfssvc(p, v, retval) struct proc *p; void *v; @@ -473,6 +433,7 @@ struct ultrix_ustat { char f_fpack[6]; /* filsys pack name */ }; +int ultrix_sys_ustat(p, v, retval) struct proc *p; void *v; @@ -494,6 +455,7 @@ ultrix_sys_ustat(p, v, retval) return 0; } +int ultrix_sys_quotactl(p, v, retval) struct proc *p; void *v; @@ -504,6 +466,7 @@ ultrix_sys_quotactl(p, v, retval) return EINVAL; } +int ultrix_sys_vhangup(p, v, retval) struct proc *p; void *v; @@ -513,81 +476,7 @@ ultrix_sys_vhangup(p, v, retval) return 0; } -struct ultrix_statfs { - long f_type; /* type of info, zero for now */ - long f_bsize; /* fundamental file system block size */ - long f_blocks; /* total blocks in file system */ - long f_bfree; /* free blocks */ - long f_bavail; /* free blocks available to non-super-user */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - long f_spare[7]; /* spare for later */ -}; - -static -sunstatfs(sp, buf) - struct statfs *sp; - caddr_t buf; -{ - struct ultrix_statfs ssfs; - - bzero(&ssfs, sizeof ssfs); - ssfs.f_type = 0; - ssfs.f_bsize = sp->f_bsize; - ssfs.f_blocks = sp->f_blocks; - ssfs.f_bfree = sp->f_bfree; - ssfs.f_bavail = sp->f_bavail; - ssfs.f_files = sp->f_files; - ssfs.f_ffree = sp->f_ffree; - ssfs.f_fsid = sp->f_fsid; - return copyout((caddr_t)&ssfs, buf, sizeof ssfs); -} - -ultrix_sys_statfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ultrix_sys_statfs_args *uap = v; - register struct mount *mp; - register struct statfs *sp; - int error; - struct nameidata nd; - - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) - return (error); - mp = nd.ni_vp->v_mount; - sp = &mp->mnt_stat; - vrele(nd.ni_vp); - if (error = VFS_STATFS(mp, sp, p)) - return (error); - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - return sunstatfs(sp, (caddr_t)SCARG(uap, buf)); -} - -ultrix_sys_fstatfs(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ultrix_sys_fstatfs_args *uap = v; - struct file *fp; - struct mount *mp; - register struct statfs *sp; - int error; - - if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) - return (error); - mp = ((struct vnode *)fp->f_data)->v_mount; - sp = &mp->mnt_stat; - if (error = VFS_STATFS(mp, sp, p)) - return (error); - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - return sunstatfs(sp, (caddr_t)SCARG(uap, buf)); -} - +int ultrix_sys_exportfs(p, v, retval) struct proc *p; void *v; @@ -603,20 +492,6 @@ ultrix_sys_exportfs(p, v, retval) } int -ultrix_sys_mknod(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - struct ultrix_sys_mknod_args *uap = v; - - if (S_ISFIFO(SCARG(uap, mode))) - return sys_mkfifo(p, uap, retval); - - return sys_mknod(p, (struct sys_mknod_args *)uap, retval); -} - -int ultrix_sys_sigpending(p, v, retval) struct proc *p; void *v; diff --git a/sys/compat/ultrix/ultrix_pathname.c b/sys/compat/ultrix/ultrix_pathname.c new file mode 100644 index 00000000000..2175ac438ac --- /dev/null +++ b/sys/compat/ultrix/ultrix_pathname.c @@ -0,0 +1,304 @@ +/* $NetBSD: ultrix_pathname.c,v 1.1 1996/01/07 13:38:52 jonathan Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Lawrence Berkeley Laboratory. + * + * 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 the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * + * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 + * + * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp + */ + + +/* + * Ultrix emulation filesystem-namespace compatibility module. + * + * Ultrix system calls that examine the filesysten namespace + * are implemented here. Each system call has a wrapper that + * first checks if the given file exists at a special `emulation' + * pathname: the given path, prefixex with '/emul/ultrix', and + * if that pathname exists, it is used instead of the providd pathname. + * + * Used to locate OS-specific files (shared libraries, config files, + * etc) used by emul processes at their `normal' pathnames, without + * polluting, or conflicting with, the native filesysten namespace. + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/namei.h> +#include <sys/file.h> +#include <sys/filedesc.h> +#include <sys/ioctl.h> +#include <sys/mount.h> +#include <sys/stat.h> +#include <sys/vnode.h> +#include <sys/syscallargs.h> + +#include <compat/ultrix/ultrix_syscallargs.h> +#include <compat/ultrix/ultrix_util.h> + +const char ultrix_emul_path[] = "/emul/ultrix"; + +int +ultrix_sys_creat(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_creat_args *uap = v; + struct sys_open_args ouap; + + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + SCARG(&ouap, path) = SCARG(uap, path); + SCARG(&ouap, flags) = O_WRONLY | O_CREAT | O_TRUNC; + SCARG(&ouap, mode) = SCARG(uap, mode); + + return (sys_open(p, &ouap, retval)); +} + + +int +ultrix_sys_access(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_access_args *uap = v; + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + return (sys_access(p, uap, retval)); +} + +int +ultrix_sys_stat(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_stat_args *uap = v; + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + return (compat_43_sys_stat(p, uap, retval)); +} + +int +ultrix_sys_lstat(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_lstat_args *uap = v; + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + return (compat_43_sys_lstat(p, uap, retval)); +} + +int +ultrix_sys_execv(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_execv_args *uap = v; + struct sys_execve_args ouap; + + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + SCARG(&ouap, path) = SCARG(uap, path); + SCARG(&ouap, argp) = SCARG(uap, argp); + SCARG(&ouap, envp) = NULL; + + return (sys_execve(p, &ouap, retval)); +} + +int +ultrix_sys_open(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_open_args *uap = v; + int l, r; + int noctty; + int ret; + + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + /* convert open flags into NetBSD flags */ + l = SCARG(uap, flags); + noctty = l & 0x8000; + r = (l & (0x0001 | 0x0002 | 0x0008 | 0x0040 | 0x0200 | 0x0400 | 0x0800)); + r |= ((l & (0x0004 | 0x1000 | 0x4000)) ? O_NONBLOCK : 0); + r |= ((l & 0x0080) ? O_SHLOCK : 0); + r |= ((l & 0x0100) ? O_EXLOCK : 0); + r |= ((l & 0x2000) ? O_FSYNC : 0); + + SCARG(uap, flags) = r; + ret = sys_open(p, (struct sys_open_args *)uap, retval); + + if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + struct filedesc *fdp = p->p_fd; + struct file *fp = fdp->fd_ofiles[*retval]; + + /* ignore any error, just give it a try */ + if (fp->f_type == DTYPE_VNODE) + (fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t)0, p); + } + return ret; +} + + +struct ultrix_statfs { + long f_type; /* type of info, zero for now */ + long f_bsize; /* fundamental file system block size */ + long f_blocks; /* total blocks in file system */ + long f_bfree; /* free blocks */ + long f_bavail; /* free blocks available to non-super-user */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* file system id */ + long f_spare[7]; /* spare for later */ +}; + +/* + * Custruct ultrix statfs result from native. + * XXX should this be the same as returned by Ultrix getmnt(2)? + * XXX Ultrix predates DEV_BSIZE. Is conversion of disk space from 1k + * block units to DEV_BSIZE necessary? + */ +static int +ultrixstatfs(sp, buf) + struct statfs *sp; + caddr_t buf; +{ + struct ultrix_statfs ssfs; + + bzero(&ssfs, sizeof ssfs); + ssfs.f_type = 0; + ssfs.f_bsize = sp->f_bsize; + ssfs.f_blocks = sp->f_blocks; + ssfs.f_bfree = sp->f_bfree; + ssfs.f_bavail = sp->f_bavail; + ssfs.f_files = sp->f_files; + ssfs.f_ffree = sp->f_ffree; + ssfs.f_fsid = sp->f_fsid; + return copyout((caddr_t)&ssfs, buf, sizeof ssfs); +} + + +int +ultrix_sys_statfs(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_statfs_args *uap = v; + register struct mount *mp; + register struct statfs *sp; + int error; + struct nameidata nd; + + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); + if (error = namei(&nd)) + return (error); + mp = nd.ni_vp->v_mount; + sp = &mp->mnt_stat; + vrele(nd.ni_vp); + if (error = VFS_STATFS(mp, sp, p)) + return (error); + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + return ultrixstatfs(sp, (caddr_t)SCARG(uap, buf)); +} + +/* + * sys_fstatfs() takes an fd, not a path, and so needs no emul + * pathname processing; but it's similar enough to sys_statfs() that + * it goes here anyway. + */ +int +ultrix_sys_fstatfs(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_fstatfs_args *uap = v; + struct file *fp; + struct mount *mp; + register struct statfs *sp; + int error; + + if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) + return (error); + mp = ((struct vnode *)fp->f_data)->v_mount; + sp = &mp->mnt_stat; + if (error = VFS_STATFS(mp, sp, p)) + return (error); + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + return ultrixstatfs(sp, (caddr_t)SCARG(uap, buf)); +} + +int +ultrix_sys_mknod(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct ultrix_sys_mknod_args *uap = v; + + caddr_t sg = stackgap_init(p->p_emul); + ULTRIX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); + + if (S_ISFIFO(SCARG(uap, mode))) + return sys_mkfifo(p, uap, retval); + + return sys_mknod(p, (struct sys_mknod_args *)uap, retval); +} diff --git a/sys/compat/ultrix/ultrix_syscall.h b/sys/compat/ultrix/ultrix_syscall.h index ecf9d58658a..97d853e3550 100644 --- a/sys/compat/ultrix/ultrix_syscall.h +++ b/sys/compat/ultrix/ultrix_syscall.h @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.11 1995/10/07 06:28:00 mycroft Exp + * created from NetBSD: syscalls.master,v 1.14 1995/12/26 10:06:15 jonathan Exp */ #define ULTRIX_SYS_syscall 0 diff --git a/sys/compat/ultrix/ultrix_syscallargs.h b/sys/compat/ultrix/ultrix_syscallargs.h index 0b30b52388b..06a3470bf0b 100644 --- a/sys/compat/ultrix/ultrix_syscallargs.h +++ b/sys/compat/ultrix/ultrix_syscallargs.h @@ -2,7 +2,7 @@ * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.11 1995/10/07 06:28:00 mycroft Exp + * created from NetBSD: syscalls.master,v 1.14 1995/12/26 10:06:15 jonathan Exp */ #define syscallarg(x) union { x datum; register_t pad; } @@ -13,6 +13,11 @@ struct ultrix_sys_open_args { syscallarg(int) mode; }; +struct ultrix_sys_creat_args { + syscallarg(char *) path; + syscallarg(int) mode; +}; + struct ultrix_sys_execv_args { syscallarg(char *) path; syscallarg(char **) argp; @@ -32,6 +37,21 @@ struct ultrix_sys_mount_args { syscallarg(caddr_t) data; }; +struct ultrix_sys_access_args { + syscallarg(char *) path; + syscallarg(int) flags; +}; + +struct ultrix_sys_stat_args { + syscallarg(char *) path; + syscallarg(struct ostat *) ub; +}; + +struct ultrix_sys_lstat_args { + syscallarg(char *) path; + syscallarg(struct ostat *) ub; +}; + struct ultrix_sys_ioctl_args { syscallarg(int) fd; syscallarg(u_long) com; @@ -159,7 +179,7 @@ int sys_write __P((struct proc *, void *, register_t *)); int ultrix_sys_open __P((struct proc *, void *, register_t *)); int sys_close __P((struct proc *, void *, register_t *)); int compat_43_sys_wait __P((struct proc *, void *, register_t *)); -int compat_43_sys_creat __P((struct proc *, void *, register_t *)); +int ultrix_sys_creat __P((struct proc *, void *, register_t *)); int sys_link __P((struct proc *, void *, register_t *)); int sys_unlink __P((struct proc *, void *, register_t *)); int ultrix_sys_execv __P((struct proc *, void *, register_t *)); @@ -173,11 +193,11 @@ int sys_getpid __P((struct proc *, void *, register_t *)); int ultrix_sys_mount __P((struct proc *, void *, register_t *)); int sys_setuid __P((struct proc *, void *, register_t *)); int sys_getuid __P((struct proc *, void *, register_t *)); -int sys_access __P((struct proc *, void *, register_t *)); +int ultrix_sys_access __P((struct proc *, void *, register_t *)); int sys_sync __P((struct proc *, void *, register_t *)); int sys_kill __P((struct proc *, void *, register_t *)); -int compat_43_sys_stat __P((struct proc *, void *, register_t *)); -int compat_43_sys_lstat __P((struct proc *, void *, register_t *)); +int ultrix_sys_stat __P((struct proc *, void *, register_t *)); +int ultrix_sys_lstat __P((struct proc *, void *, register_t *)); int sys_dup __P((struct proc *, void *, register_t *)); int sys_pipe __P((struct proc *, void *, register_t *)); int sys_profil __P((struct proc *, void *, register_t *)); diff --git a/sys/compat/ultrix/ultrix_syscalls.c b/sys/compat/ultrix/ultrix_syscalls.c index cd6cfe6b455..b606612a6df 100644 --- a/sys/compat/ultrix/ultrix_syscalls.c +++ b/sys/compat/ultrix/ultrix_syscalls.c @@ -2,7 +2,7 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.11 1995/10/07 06:28:00 mycroft Exp + * created from NetBSD: syscalls.master,v 1.14 1995/12/26 10:06:15 jonathan Exp */ char *ultrix_syscallnames[] = { diff --git a/sys/compat/ultrix/ultrix_sysent.c b/sys/compat/ultrix/ultrix_sysent.c index 13a53958973..4ccde208410 100644 --- a/sys/compat/ultrix/ultrix_sysent.c +++ b/sys/compat/ultrix/ultrix_sysent.c @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.11 1995/10/07 06:28:00 mycroft Exp + * created from NetBSD: syscalls.master,v 1.14 1995/12/26 10:06:15 jonathan Exp */ #include <sys/param.h> @@ -49,8 +49,8 @@ struct sysent ultrix_sysent[] = { sys_close }, /* 6 = close */ { 0, 0, compat_43_sys_wait }, /* 7 = owait */ - { 2, s(struct compat_43_sys_creat_args), - compat_43_sys_creat }, /* 8 = creat */ + { 2, s(struct ultrix_sys_creat_args), + ultrix_sys_creat }, /* 8 = creat */ { 2, s(struct sys_link_args), sys_link }, /* 9 = link */ { 1, s(struct sys_unlink_args), @@ -99,8 +99,8 @@ struct sysent ultrix_sysent[] = { sys_nosys }, /* 31 = obsolete v7 stty */ { 0, 0, sys_nosys }, /* 32 = obsolete v7 gtty */ - { 2, s(struct sys_access_args), - sys_access }, /* 33 = access */ + { 2, s(struct ultrix_sys_access_args), + ultrix_sys_access }, /* 33 = access */ { 0, 0, sys_nosys }, /* 34 = obsolete v7 nice */ { 0, 0, @@ -109,12 +109,12 @@ struct sysent ultrix_sysent[] = { sys_sync }, /* 36 = sync */ { 2, s(struct sys_kill_args), sys_kill }, /* 37 = kill */ - { 2, s(struct compat_43_sys_stat_args), - compat_43_sys_stat }, /* 38 = ostat */ + { 2, s(struct ultrix_sys_stat_args), + ultrix_sys_stat }, /* 38 = ostat */ { 0, 0, sys_nosys }, /* 39 = obsolete v7 setpgrp */ - { 2, s(struct compat_43_sys_lstat_args), - compat_43_sys_lstat }, /* 40 = olstat */ + { 2, s(struct ultrix_sys_lstat_args), + ultrix_sys_lstat }, /* 40 = olstat */ { 1, s(struct sys_dup_args), sys_dup }, /* 41 = dup */ { 0, 0, diff --git a/sys/compat/ultrix/ultrix_util.h b/sys/compat/ultrix/ultrix_util.h new file mode 100644 index 00000000000..fe908ae8b19 --- /dev/null +++ b/sys/compat/ultrix/ultrix_util.h @@ -0,0 +1,41 @@ +/* $NetBSD: ultrix_util.h,v 1.1 1996/01/07 13:38:57 jonathan Exp $ */ + +/* + * Copyright (c) 1994 Christos Zoulas + * Copyright (c) 1995 Matthew Green + * 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. + */ + +#ifndef _ULTRIX_UTIL_H_ +#define _ULTRIX_UTIL_H_ + +#include <compat/common/compat_util.h> + +extern const char ultrix_emul_path[]; + +#define ULTRIX_CHECK_ALT_EXIST(p, sgp, path) \ + CHECK_ALT_EXIST(p, sgp, ultrix_emul_path, path) + +#endif /* !_ULTRIX_UTIL_H_ */ |