Merge the nathanw_sa branch.

This commit is contained in:
thorpej 2003-01-18 08:49:22 +00:00
parent 6881e93b29
commit 71f181a907
5 changed files with 144 additions and 121 deletions

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.37 2001/05/30 11:37:33 mrg Exp $
$NetBSD: syscalls.master,v 1.38 2003/01/18 08:49:22 thorpej Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -40,6 +40,7 @@
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/ultrix/ultrix_syscallargs.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_fs.c,v 1.24 2003/01/06 13:26:26 wiz Exp $ */
/* $NetBSD: ultrix_fs.c,v 1.25 2003/01/18 08:49:22 thorpej Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.24 2003/01/06 13:26:26 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.25 2003/01/18 08:49:22 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.24 2003/01/06 13:26:26 wiz Exp $");
#include <ufs/ufs/quota.h>
#include <ufs/ufs/ufsmount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/ultrix/ultrix_syscallargs.h>
#include <compat/common/compat_util.h>
@ -203,12 +204,13 @@ make_ultrix_mntent(sp, tem)
}
int
ultrix_sys_getmnt(p, v, retval)
struct proc *p;
ultrix_sys_getmnt(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_getmnt_args *uap = v;
struct proc *p = l->l_proc;
struct mount *mp, *nmp;
struct statfs *sp;
struct ultrix_fs_data *sfsp;
@ -346,13 +348,13 @@ struct ultrix_ufs_args {
};
int
ultrix_sys_mount(p, v, retval)
struct proc *p;
ultrix_sys_mount(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_mount_args *uap = v;
struct proc *p = l->l_proc;
int error;
int otype = SCARG(uap, type);
char fsname[MFSNAMELEN];
@ -472,5 +474,5 @@ ultrix_sys_mount(p, v, retval)
if ((error = copyout(&na, SCARG(&nuap, data), sizeof na)) != 0)
return (error);
}
return (sys_mount(p, &nuap, retval));
return (sys_mount(l, &nuap, retval));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_ioctl.c,v 1.18 2001/11/13 02:09:33 lukem Exp $ */
/* $NetBSD: ultrix_ioctl.c,v 1.19 2003/01/18 08:49:22 thorpej Exp $ */
/* from : NetBSD: sunos_ioctl.c,v 1.21 1995/10/07 06:27:31 mycroft Exp */
/*
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.18 2001/11/13 02:09:33 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.19 2003/01/18 08:49:22 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_ultrix.h"
@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.18 2001/11/13 02:09:33 lukem Exp
#include <sys/mount.h>
#include <compat/ultrix/ultrix_syscallargs.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/sunos/sunos.h>
@ -448,12 +449,13 @@ stio2stios(t, ts)
}
int
ultrix_sys_ioctl(p, v, retval)
struct proc *p;
ultrix_sys_ioctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_ioctl_args *uap = v;
struct proc *p = l->l_proc;
struct filedesc *fdp = p->p_fd;
struct file *fp;
int (*ctl) __P((struct file *, u_long, caddr_t, struct proc *));
@ -779,5 +781,5 @@ ultrix_sys_ioctl(p, v, retval)
}
}
return (sys_ioctl(p, uap, retval));
return (sys_ioctl(l, uap, retval));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_misc.c,v 1.80 2002/11/01 19:26:23 jdolecek Exp $ */
/* $NetBSD: ultrix_misc.c,v 1.81 2003/01/18 08:49:22 thorpej Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.80 2002/11/01 19:26:23 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.81 2003/01/18 08:49:22 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfsserver.h"
@ -125,6 +125,7 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.80 2002/11/01 19:26:23 jdolecek Ex
#include <sys/unistd.h>
#include <sys/ipc.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/ultrix/ultrix_syscall.h>
@ -190,8 +191,8 @@ const struct emul emul_ultrix = {
#define GSI_PROG_ENV 1
int
ultrix_sys_getsysinfo(p, v, retval)
struct proc *p;
ultrix_sys_getsysinfo(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -212,8 +213,8 @@ ultrix_sys_getsysinfo(p, v, retval)
}
int
ultrix_sys_setsysinfo(p, v, retval)
struct proc *p;
ultrix_sys_setsysinfo(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -227,8 +228,8 @@ ultrix_sys_setsysinfo(p, v, retval)
}
int
ultrix_sys_waitpid(p, v, retval)
struct proc *p;
ultrix_sys_waitpid(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -240,12 +241,12 @@ ultrix_sys_waitpid(p, v, retval)
SCARG(&ua, options) = SCARG(uap, options);
SCARG(&ua, rusage) = 0;
return (sys_wait4(p, &ua, retval));
return (sys_wait4(l, &ua, retval));
}
int
ultrix_sys_wait3(p, v, retval)
struct proc *p;
ultrix_sys_wait3(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -257,7 +258,7 @@ ultrix_sys_wait3(p, v, retval)
SCARG(&ua, options) = SCARG(uap, options);
SCARG(&ua, rusage) = SCARG(uap, rusage);
return (sys_wait4(p, &ua, retval));
return (sys_wait4(l, &ua, retval));
}
/*
@ -268,8 +269,8 @@ ultrix_sys_wait3(p, v, retval)
* limit nfds to at most FD_MAX.
*/
int
ultrix_sys_select(p, v, retval)
struct proc *p;
ultrix_sys_select(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -296,7 +297,7 @@ ultrix_sys_select(p, v, retval)
#endif
}
error = sys_select(p, (void*) uap, retval);
error = sys_select(l, (void*) uap, retval);
if (error == EINVAL)
printf("ultrix select: bad args?\n");
@ -306,8 +307,8 @@ done:
#if defined(NFS)
int
async_daemon(p, v, retval)
struct proc *p;
async_daemon(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -316,7 +317,7 @@ async_daemon(p, v, retval)
SCARG(&ouap, flag) = NFSSVC_BIOD;
SCARG(&ouap, argp) = NULL;
return (sys_nfssvc(p, &ouap, retval));
return (sys_nfssvc(l, &ouap, retval));
}
#endif /* NFS */
@ -324,12 +325,13 @@ async_daemon(p, v, retval)
#define SUN__MAP_NEW 0x80000000 /* if not, old mmap & cannot handle */
int
ultrix_sys_mmap(p, v, retval)
struct proc *p;
ultrix_sys_mmap(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_mmap_args *uap = v;
struct proc *p = l->l_proc;
struct sys_mmap_args ouap;
struct filedesc *fdp;
struct file *fp;
@ -369,16 +371,17 @@ ultrix_sys_mmap(p, v, retval)
SCARG(&ouap, fd) = -1;
}
return (sys_mmap(p, &ouap, retval));
return (sys_mmap(l, &ouap, retval));
}
int
ultrix_sys_setsockopt(p, v, retval)
struct proc *p;
ultrix_sys_setsockopt(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_setsockopt_args *uap = v;
struct proc *p = l->l_proc;
struct file *fp;
struct mbuf *m = NULL;
int error;
@ -445,8 +448,8 @@ struct ultrix_utsname {
};
int
ultrix_sys_uname(p, v, retval)
struct proc *p;
ultrix_sys_uname(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -478,12 +481,13 @@ ultrix_sys_uname(p, v, retval)
}
int
ultrix_sys_setpgrp(p, v, retval)
struct proc *p;
ultrix_sys_setpgrp(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_setpgrp_args *uap = v;
struct proc *p = l->l_proc;
/*
* difference to our setpgid call is to include backwards
@ -493,15 +497,15 @@ ultrix_sys_setpgrp(p, v, retval)
*/
if (!SCARG(uap, pgid) &&
(!SCARG(uap, pid) || SCARG(uap, pid) == p->p_pid))
return sys_setsid(p, uap, retval);
return sys_setsid(l, uap, retval);
else
return sys_setpgid(p, uap, retval);
return sys_setpgid(l, uap, retval);
}
#if defined (NFSSERVER)
int
ultrix_sys_nfssvc(p, v, retval)
struct proc *p;
ultrix_sys_nfssvc(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -527,7 +531,7 @@ ultrix_sys_nfssvc(p, v, retval)
if (error = copyout(&sa, SCARG(&outuap, mtchval), SCARG(&outuap, mtchlen)))
return (error);
return nfssvc(p, &outuap, retval);
return nfssvc(l, &outuap, retval);
#else
return (ENOSYS);
#endif
@ -542,8 +546,8 @@ struct ultrix_ustat {
};
int
ultrix_sys_ustat(p, v, retval)
struct proc *p;
ultrix_sys_ustat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -564,8 +568,8 @@ ultrix_sys_ustat(p, v, retval)
}
int
ultrix_sys_quotactl(p, v, retval)
struct proc *p;
ultrix_sys_quotactl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -578,8 +582,8 @@ ultrix_sys_quotactl(p, v, retval)
}
int
ultrix_sys_vhangup(p, v, retval)
struct proc *p;
ultrix_sys_vhangup(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -593,8 +597,8 @@ ultrix_sys_vhangup(p, v, retval)
*/
#ifdef __mips
int
ultrix_sys_cacheflush(p, v, retval)
struct proc *p;
ultrix_sys_cacheflush(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -603,6 +607,7 @@ ultrix_sys_cacheflush(p, v, retval)
syscallarg(int) nbytes;
syscallarg(int) flag;
} */ *uap = v;
struct proc *p = l->l_proc;
vaddr_t va = (vaddr_t)SCARG(uap, addr);
int nbytes = SCARG(uap, nbytes);
int whichcache = SCARG(uap, whichcache);
@ -612,8 +617,8 @@ ultrix_sys_cacheflush(p, v, retval)
int
ultrix_sys_cachectl(p, v, retval)
struct proc *p;
ultrix_sys_cachectl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -622,6 +627,7 @@ ultrix_sys_cachectl(p, v, retval)
syscallarg(int) nbytes;
syscallarg(int) cacheop;
} */ *uap = v;
struct proc *p = l->l_proc;
vaddr_t va = (vaddr_t)SCARG(uap, addr);
int nbytes = SCARG(uap, nbytes);
int cacheop = SCARG(uap, cacheop);
@ -633,8 +639,8 @@ ultrix_sys_cachectl(p, v, retval)
int
ultrix_sys_exportfs(p, v, retval)
struct proc *p;
ultrix_sys_exportfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -650,8 +656,8 @@ ultrix_sys_exportfs(p, v, retval)
}
int
ultrix_sys_sigpending(p, v, retval)
struct proc *p;
ultrix_sys_sigpending(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -659,15 +665,15 @@ ultrix_sys_sigpending(p, v, retval)
sigset_t ss;
int mask;
sigpending1(p, &ss);
sigpending1(l->l_proc, &ss);
mask = ss.__bits[0];
return (copyout((caddr_t)&mask, (caddr_t)SCARG(uap, mask), sizeof(int)));
}
int
ultrix_sys_sigreturn(p, v, retval)
struct proc *p;
ultrix_sys_sigreturn(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -675,12 +681,12 @@ ultrix_sys_sigreturn(p, v, retval)
/* struct sigcontext13 is close enough to Ultrix */
return (compat_13_sys_sigreturn(p, uap, retval));
return (compat_13_sys_sigreturn(l, uap, retval));
}
int
ultrix_sys_sigcleanup(p, v, retval)
struct proc *p;
ultrix_sys_sigcleanup(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -688,12 +694,12 @@ ultrix_sys_sigcleanup(p, v, retval)
/* struct sigcontext13 is close enough to Ultrix */
return (compat_13_sys_sigreturn(p, uap, retval));
return (compat_13_sys_sigreturn(l, uap, retval));
}
int
ultrix_sys_sigsuspend(p, v, retval)
struct proc *p;
ultrix_sys_sigsuspend(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -706,7 +712,7 @@ ultrix_sys_sigsuspend(p, v, retval)
ss.__bits[2] = 0;
ss.__bits[3] = 0;
return (sigsuspend1(p, &ss));
return (sigsuspend1(l->l_proc, &ss));
}
#define ULTRIX_SV_ONSTACK 0x0001 /* take signal on signal stack */
@ -714,8 +720,8 @@ ultrix_sys_sigsuspend(p, v, retval)
#define ULTRIX_SV_OLDSIG 0x1000 /* Emulate old signal() for POSIX */
int
ultrix_sys_sigvec(p, v, retval)
struct proc *p;
ultrix_sys_sigvec(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -744,7 +750,7 @@ ultrix_sys_sigvec(p, v, retval)
#endif
native_sigset13_to_sigset(&nsv.sv_mask, &nsa.sa_mask);
}
error = sigaction1(p, SCARG(uap, signum),
error = sigaction1(l->l_proc, SCARG(uap, signum),
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0,
NULL, 0);
if (error)
@ -762,8 +768,8 @@ ultrix_sys_sigvec(p, v, retval)
}
int
ultrix_sys_shmsys(p, v, retval)
struct proc *p;
ultrix_sys_shmsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -783,24 +789,24 @@ ultrix_sys_shmsys(p, v, retval)
SCARG(&shmat_args, shmid) = SCARG(uap, a2);
SCARG(&shmat_args, shmaddr) = (void *)SCARG(uap, a3);
SCARG(&shmat_args, shmflg) = SCARG(uap, a4);
return (sys_shmat(p, &shmat_args, retval));
return (sys_shmat(l, &shmat_args, retval));
case 1: /* Ultrix shmctl() */
SCARG(&shmctl_args, shmid) = SCARG(uap, a2);
SCARG(&shmctl_args, cmd) = SCARG(uap, a3);
SCARG(&shmctl_args, buf) = (struct shmid_ds14 *)SCARG(uap, a4);
return (compat_14_sys_shmctl(p, &shmctl_args, retval));
return (compat_14_sys_shmctl(l, &shmctl_args, retval));
case 2: /* Ultrix shmdt() */
SCARG(&shmat_args, shmaddr) = (void *)SCARG(uap, a2);
return (sys_shmdt(p, &shmdt_args, retval));
return (sys_shmdt(l, &shmdt_args, retval));
case 3: /* Ultrix shmget() */
SCARG(&shmget_args, key) = SCARG(uap, a2);
SCARG(&shmget_args, size) = SCARG(uap, a3);
SCARG(&shmget_args, shmflg) = SCARG(uap, a4)
& (IPC_CREAT|IPC_EXCL|IPC_NOWAIT);
return (sys_shmget(p, &shmget_args, retval));
return (sys_shmget(l, &shmget_args, retval));
default:
return (EINVAL);
@ -863,12 +869,13 @@ bsd_to_ultrix_flock(fl, ufl)
}
int
ultrix_sys_fcntl(p, v, retval)
struct proc *p;
ultrix_sys_fcntl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_fcntl_args *uap = v;
struct proc *p = l->l_proc;
int error;
struct ultrix_flock ufl;
struct flock fl, *flp;
@ -901,7 +908,7 @@ ultrix_sys_fcntl(p, v, retval)
break;
}
error = sys_fcntl(p, args, retval);
error = sys_fcntl(l, args, retval);
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_pathname.c,v 1.14 2002/03/16 20:43:58 christos Exp $ */
/* $NetBSD: ultrix_pathname.c,v 1.15 2003/01/18 08:49:23 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.14 2002/03/16 20:43:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.15 2003/01/18 08:49:23 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -74,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.14 2002/03/16 20:43:58 christo
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/vnode.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <sys/proc.h>
@ -83,13 +84,14 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.14 2002/03/16 20:43:58 christo
static int ultrixstatfs __P((struct statfs *sp, caddr_t buf));
int
ultrix_sys_creat(p, v, retval)
struct proc *p;
ultrix_sys_creat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_creat_args *uap = v;
struct sys_open_args ap;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
@ -98,52 +100,55 @@ ultrix_sys_creat(p, v, retval)
SCARG(&ap, flags) = O_WRONLY | O_CREAT | O_TRUNC;
SCARG(&ap, mode) = SCARG(uap, mode);
return (sys_open(p, &ap, retval));
return (sys_open(l, &ap, retval));
}
int
ultrix_sys_access(p, v, retval)
struct proc *p;
ultrix_sys_access(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_access_args *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
return (sys_access(p, uap, retval));
return (sys_access(l, uap, retval));
}
int
ultrix_sys_stat(p, v, retval)
struct proc *p;
ultrix_sys_stat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_stat_args *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
return (compat_43_sys_stat(p, uap, retval));
return (compat_43_sys_stat(l, uap, retval));
}
int
ultrix_sys_lstat(p, v, retval)
struct proc *p;
ultrix_sys_lstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_lstat_args *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
return (compat_43_sys_lstat(p, uap, retval));
return (compat_43_sys_lstat(l, uap, retval));
}
int
ultrix_sys_execv(p, v, retval)
struct proc *p;
ultrix_sys_execv(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -151,6 +156,7 @@ ultrix_sys_execv(p, v, retval)
syscallarg(const char *) path;
syscallarg(char **) argv;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_execve_args ap;
caddr_t sg;
@ -161,12 +167,12 @@ ultrix_sys_execv(p, v, retval)
SCARG(&ap, argp) = SCARG(uap, argp);
SCARG(&ap, envp) = NULL;
return (sys_execve(p, &ap, retval));
return (sys_execve(l, &ap, retval));
}
int
ultrix_sys_execve(p, v, retval)
struct proc *p;
ultrix_sys_execve(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -175,6 +181,7 @@ ultrix_sys_execve(p, v, retval)
syscallarg(char **) argv;
syscallarg(char **) envp;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_execve_args ap;
caddr_t sg;
@ -185,37 +192,38 @@ ultrix_sys_execve(p, v, retval)
SCARG(&ap, argp) = SCARG(uap, argp);
SCARG(&ap, envp) = SCARG(uap, envp);
return (sys_execve(p, &ap, retval));
return (sys_execve(l, &ap, retval));
}
int
ultrix_sys_open(p, v, retval)
struct proc *p;
ultrix_sys_open(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_open_args *uap = v;
int l, r;
struct proc *p = l->l_proc;
int q, r;
int noctty;
int ret;
caddr_t sg = stackgap_init(p, 0);
/* 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);
q = SCARG(uap, flags);
noctty = q & 0x8000;
r = (q & (0x0001 | 0x0002 | 0x0008 | 0x0040 | 0x0200 | 0x0400 | 0x0800));
r |= ((q & (0x0004 | 0x1000 | 0x4000)) ? O_NONBLOCK : 0);
r |= ((q & 0x0080) ? O_SHLOCK : 0);
r |= ((q & 0x0100) ? O_EXLOCK : 0);
r |= ((q & 0x2000) ? O_FSYNC : 0);
if (r & O_CREAT)
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
else
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
SCARG(uap, flags) = r;
ret = sys_open(p, (struct sys_open_args *)uap, retval);
ret = sys_open(l, (struct sys_open_args *)uap, retval);
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
struct filedesc *fdp = p->p_fd;
@ -270,12 +278,13 @@ ultrixstatfs(sp, buf)
int
ultrix_sys_statfs(p, v, retval)
struct proc *p;
ultrix_sys_statfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_statfs_args *uap = v;
struct proc *p = l->l_proc;
struct mount *mp;
struct statfs *sp;
int error;
@ -303,12 +312,13 @@ ultrix_sys_statfs(p, v, retval)
* it goes here anyway.
*/
int
ultrix_sys_fstatfs(p, v, retval)
struct proc *p;
ultrix_sys_fstatfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_fstatfs_args *uap = v;
struct proc *p = l->l_proc;
struct file *fp;
struct mount *mp;
struct statfs *sp;
@ -329,18 +339,19 @@ ultrix_sys_fstatfs(p, v, retval)
}
int
ultrix_sys_mknod(p, v, retval)
struct proc *p;
ultrix_sys_mknod(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct ultrix_sys_mknod_args *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
if (S_ISFIFO(SCARG(uap, mode)))
return sys_mkfifo(p, uap, retval);
return sys_mkfifo(l, uap, retval);
return sys_mknod(p, (struct sys_mknod_args *)uap, retval);
return sys_mknod(l, (struct sys_mknod_args *)uap, retval);
}