Merge the nathanw_sa branch.

This commit is contained in:
thorpej 2003-01-18 08:38:14 +00:00
parent afdb47f3fb
commit 540ba7bda5
4 changed files with 154 additions and 127 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32_exec.h,v 1.3 2001/09/20 20:52:26 thorpej Exp $ */
/* $NetBSD: sunos32_exec.h,v 1.4 2003/01/18 08:38:14 thorpej Exp $ */
/*
* Copyright (c) 2001 Matthew R. Green
@ -36,7 +36,7 @@
extern const struct emul emul_sunos;
int exec_sunos32_aout_makecmds __P((struct proc *, struct exec_package *));
void sunos32_setregs __P((struct proc *p, struct exec_package *pack,
void sunos32_setregs __P((struct lwp *l, struct exec_package *pack,
u_long stack));
#endif /* _SUNOS32_EXEC_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32_ioctl.c,v 1.9 2003/01/04 23:43:05 wiz Exp $ */
/* $NetBSD: sunos32_ioctl.c,v 1.10 2003/01/18 08:38:15 thorpej Exp $ */
/* from: NetBSD: sunos_ioctl.c,v 1.35 2001/02/03 22:20:02 mrg Exp */
/*
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.9 2003/01/04 23:43:05 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.10 2003/01/18 08:38:15 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd32.h"
@ -76,6 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.9 2003/01/04 23:43:05 wiz Exp $"
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/disklabel.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <miscfs/specfs/specdev.h>
@ -436,8 +437,8 @@ stio2stios(t, ts)
}
int
sunos32_sys_ioctl(p, v, retval)
struct proc *p;
sunos32_sys_ioctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -446,6 +447,7 @@ sunos32_sys_ioctl(p, v, retval)
netbsd32_u_long com;
netbsd32_caddr_t data;
} */ *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 *));
@ -912,7 +914,7 @@ sunos32_sys_ioctl(p, v, retval)
}
}
return (netbsd32_ioctl(p, uap, retval));
return (netbsd32_ioctl(l, uap, retval));
}
/* SunOS fcntl(2) cmds not implemented */
@ -1014,8 +1016,8 @@ static struct {
};
int
sunos32_sys_fcntl(p, v, retval)
struct proc *p;
sunos32_sys_fcntl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1024,6 +1026,7 @@ sunos32_sys_fcntl(p, v, retval)
syscallarg(int) cmd;
syscallarg(netbsd32_voidp) arg;
} */ *uap = v;
struct proc *p = l->l_proc;
netbsd32_long flg;
int n, ret;
@ -1066,7 +1069,7 @@ sunos32_sys_fcntl(p, v, retval)
if (error)
return error;
error = sys_fcntl(p, &fa, retval);
error = sys_fcntl(l, &fa, retval);
if (error || SCARG(&fa, cmd) != F_GETLK)
return error;
@ -1086,7 +1089,7 @@ sunos32_sys_fcntl(p, v, retval)
return (EOPNOTSUPP);
}
ret = netbsd32_fcntl(p, uap, retval);
ret = netbsd32_fcntl(l, uap, retval);
switch (SCARG(uap, cmd)) {
case F_GETFL:

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32_misc.c,v 1.14 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: sunos32_misc.c,v 1.15 2003/01/18 08:38:15 thorpej Exp $ */
/* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
/*
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.14 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.15 2003/01/18 08:38:15 thorpej Exp $");
#define COMPAT_SUNOS 1
@ -121,6 +121,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.14 2002/09/06 13:18:43 gehenna Ex
#include <sys/wait.h>
#include <sys/utsname.h>
#include <sys/unistd.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <sys/conf.h>
#include <sys/socketvar.h>
@ -173,14 +174,15 @@ void sunos32_sigvec_from_sigaction(sv, sa)
}
int
sunos32_sys_stime(p, v, retval)
struct proc *p;
sunos32_sys_stime(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct sunos32_sys_stime_args /* {
syscallarg(sunos32_time_tp) tp;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_settimeofday_args ap;
caddr_t sg = stackgap_init(p, 0);
struct netbsd32_timeval ntv;
@ -200,12 +202,12 @@ sunos32_sys_stime(p, v, retval)
if (error)
return error;
return sys_settimeofday(p, &ap, retval);
return sys_settimeofday(l, &ap, retval);
}
int
sunos32_sys_wait4(p, v, retval)
struct proc *p;
sunos32_sys_wait4(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -218,12 +220,12 @@ sunos32_sys_wait4(p, v, retval)
if (SCARG(uap, pid) == 0)
SCARG(uap, pid) = WAIT_ANY;
return (netbsd32_wait4(p, uap, retval));
return (netbsd32_wait4(l, uap, retval));
}
int
sunos32_sys_creat(p, v, retval)
struct proc *p;
sunos32_sys_creat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -231,6 +233,7 @@ sunos32_sys_creat(p, v, retval)
syscallarg(const netbsd32_charp) path;
syscallarg(int) mode;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_open_args ua;
caddr_t sg = stackgap_init(p, 0);
@ -240,12 +243,12 @@ sunos32_sys_creat(p, v, retval)
SUNOS32_CHECK_ALT_CREAT(p, &sg, SCARG(&ua, path));
return (sys_open(p, &ua, retval));
return (sys_open(l, &ua, retval));
}
int
sunos32_sys_access(p, v, retval)
struct proc *p;
sunos32_sys_access(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -253,6 +256,7 @@ sunos32_sys_access(p, v, retval)
syscallarg(const netbsd32_charp) path;
syscallarg(int) flags;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_access_args ua;
caddr_t sg = stackgap_init(p, 0);
@ -260,7 +264,7 @@ sunos32_sys_access(p, v, retval)
SUNOS32TO64_UAP(flags);
SUNOS32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
return (sys_access(p, &ua, retval));
return (sys_access(l, &ua, retval));
}
static __inline void sunos32_from___stat13 __P((struct stat *, struct netbsd32_stat43 *));
@ -295,8 +299,8 @@ sunos32_from___stat13(sbp, sb32p)
int
sunos32_sys_stat(p, v, retval)
struct proc *p;
sunos32_sys_stat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -304,6 +308,7 @@ sunos32_sys_stat(p, v, retval)
syscallarg(const netbsd32_charp) path;
syscallarg(netbsd32_stat43p_t) ub;
} */ *uap = v;
struct proc *p = l->l_proc;
struct netbsd32_stat43 sb32;
struct stat sb;
struct nameidata nd;
@ -328,8 +333,8 @@ sunos32_sys_stat(p, v, retval)
}
int
sunos32_sys_lstat(p, v, retval)
struct proc *p;
sunos32_sys_lstat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -338,6 +343,7 @@ sunos32_sys_lstat(p, v, retval)
syscallarg(netbsd32_stat43p_t) ub;
} */ *uap = v;
struct vnode *vp, *dvp;
struct proc *p = l->l_proc;
struct stat sb, sb1;
struct netbsd32_stat43 sb32;
int error;
@ -404,8 +410,8 @@ again:
}
int
sunos32_sys_execv(p, v, retval)
struct proc *p;
sunos32_sys_execv(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -413,6 +419,7 @@ sunos32_sys_execv(p, v, retval)
syscallarg(const char *) path;
syscallarg(char **) argv;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_execve_args ua;
caddr_t sg;
@ -422,12 +429,12 @@ sunos32_sys_execv(p, v, retval)
sg = stackgap_init(p, 0);
SUNOS32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
return netbsd32_execve2(p, &ua, retval);
return netbsd32_execve2(l, &ua, retval);
}
int
sunos32_sys_execve(p, v, retval)
struct proc *p;
sunos32_sys_execve(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -436,6 +443,7 @@ sunos32_sys_execve(p, v, retval)
syscallarg(char **) argv;
syscallarg(char **) envp;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_execve_args ua;
caddr_t sg;
@ -445,12 +453,12 @@ sunos32_sys_execve(p, v, retval)
sg = stackgap_init(p, 0);
SUNOS32_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
return netbsd32_execve2(p, &ua, retval);
return netbsd32_execve2(l, &ua, retval);
}
int
sunos32_sys_omsync(p, v, retval)
struct proc *p;
sunos32_sys_omsync(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -465,12 +473,12 @@ sunos32_sys_omsync(p, v, retval)
SCARG(&ouap, len) = SCARG(uap, len);
SCARG(&ouap, flags) = SCARG(uap, flags);
return (netbsd32___msync13(p, &ouap, retval));
return (netbsd32___msync13(l, &ouap, retval));
}
int
sunos32_sys_unmount(p, v, retval)
struct proc *p;
sunos32_sys_unmount(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -482,7 +490,7 @@ sunos32_sys_unmount(p, v, retval)
SUNOS32TOP_UAP(path, const char);
SCARG(&ua, flags) = 0;
return (sys_unmount(p, &ua, retval));
return (sys_unmount(l, &ua, retval));
}
/*
@ -510,8 +518,8 @@ static struct {
};
int
sunos32_sys_mount(p, v, retval)
struct proc *p;
sunos32_sys_mount(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -521,6 +529,7 @@ sunos32_sys_mount(p, v, retval)
syscallarg(int) flags;
syscallarg(netbsd32_caddr_t) data;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_mount_args ua;
int oflags = SCARG(uap, flags), nflags, error;
char fsname[MFSNAMELEN];
@ -598,13 +607,13 @@ sunos32_sys_mount(p, v, retval)
SUNOS32TOP_UAP(path, const char);
SUNOS32TO64_UAP(flags);
SUNOS32TOP_UAP(data, void);
return (sys_mount(p, &ua, retval));
return (sys_mount(l, &ua, retval));
}
#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;
{
@ -613,7 +622,7 @@ async_daemon(p, v, retval)
SCARG(&ouap, flag) = NFSSVC_BIOD;
SCARG(&ouap, argp) = NULL;
return (netbsd32_nfssvc(p, &ouap, retval));
return (netbsd32_nfssvc(l, &ouap, retval));
}
#endif /* NFS */
@ -641,14 +650,15 @@ sunos_to_native_sigset(mask, ss)
}
int
sunos32_sys_sigpending(p, v, retval)
struct proc *p;
sunos32_sys_sigpending(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct sunos32_sys_sigpending_args /* {
syscallarg(netbsd32_intp) mask;
} */ *uap = v;
struct proc *p = l->l_proc;
sigset_t ss;
int mask;
@ -659,8 +669,8 @@ sunos32_sys_sigpending(p, v, retval)
}
int
sunos32_sys_sigsuspend(p, v, retval)
struct proc *p;
sunos32_sys_sigsuspend(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -668,6 +678,7 @@ sunos32_sys_sigsuspend(p, v, retval)
syscallarg(int) mask;
} */ *uap = v;
int mask;
struct proc *p = l->l_proc;
sigset_t ss;
mask = SCARG(uap, mask);
@ -683,8 +694,8 @@ sunos32_sys_sigsuspend(p, v, retval)
* This is quite ugly, but what do you expect from compatibility code?
*/
int
sunos32_sys_getdents(p, v, retval)
struct proc *p;
sunos32_sys_getdents(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -693,6 +704,7 @@ sunos32_sys_getdents(p, v, retval)
syscallarg(netbsd32_charp) buf;
syscallarg(int) nbytes;
} */ *uap = v;
struct proc *p = l->l_proc;
struct dirent *bdp;
struct vnode *vp;
caddr_t inp, buf; /* BSD-format */
@ -812,8 +824,8 @@ out:
#define SUNOS32__MAP_NEW 0x80000000 /* if not, old mmap & cannot handle */
int
sunos32_sys_mmap(p, v, retval)
struct proc *p;
sunos32_sys_mmap(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -825,6 +837,7 @@ sunos32_sys_mmap(p, v, retval)
syscallarg(int) fd;
syscallarg(netbsd32_long) pos;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_mmap_args ua;
struct filedesc *fdp;
struct file *fp;
@ -866,7 +879,7 @@ sunos32_sys_mmap(p, v, retval)
SCARG(&ua, fd) = -1;
}
error = sys_mmap(p, &ua, (register_t *)&rt);
error = sys_mmap(l, &ua, (register_t *)&rt);
if ((long)rt > (long)UINT_MAX)
printf("sunos32_mmap: retval out of range: %p", rt);
*retval = (netbsd32_voidp)(u_long)rt;
@ -881,8 +894,8 @@ sunos32_sys_mmap(p, v, retval)
#define MC_UNLOCKAS 6
int
sunos32_sys_mctl(p, v, retval)
struct proc *p;
sunos32_sys_mctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -897,15 +910,15 @@ sunos32_sys_mctl(p, v, retval)
case MC_ADVISE: /* ignore for now */
return (0);
case MC_SYNC: /* translate to msync */
return (netbsd32___msync13(p, uap, retval));
return (netbsd32___msync13(l, uap, retval));
default:
return (EINVAL);
}
}
int
sunos32_sys_setsockopt(p, v, retval)
struct proc *p;
sunos32_sys_setsockopt(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -916,6 +929,7 @@ sunos32_sys_setsockopt(p, v, retval)
syscallarg(netbsd32_caddr_t) val;
syscallarg(int) valsize;
} */ *uap = v;
struct proc *p = l->l_proc;
struct file *fp;
struct mbuf *m = NULL;
int error;
@ -972,15 +986,16 @@ sunos32_sys_setsockopt(p, v, retval)
return (error);
}
static __inline__ int sunos32_sys_socket_common(struct proc *, register_t *,
static __inline__ int sunos32_sys_socket_common(struct lwp *, register_t *,
int type);
static __inline__ int
sunos32_sys_socket_common(p, retval, type)
struct proc *p;
sunos32_sys_socket_common(l, retval, type)
struct lwp *l;
register_t *retval;
int type;
{
struct socket *so;
struct proc *p = l->l_proc;
struct file *fp;
int error, fd;
@ -996,8 +1011,8 @@ sunos32_sys_socket_common(p, retval, type)
}
int
sunos32_sys_socket(p, v, retval)
struct proc *p;
sunos32_sys_socket(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1008,15 +1023,15 @@ sunos32_sys_socket(p, v, retval)
} */ *uap = v;
int error;
error = netbsd32_socket(p, v, retval);
error = netbsd32_socket(l, v, retval);
if (error)
return (error);
return sunos32_sys_socket_common(p, retval, SCARG(uap, type));
return sunos32_sys_socket_common(l, retval, SCARG(uap, type));
}
int
sunos32_sys_socketpair(p, v, retval)
struct proc *p;
sunos32_sys_socketpair(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1028,10 +1043,10 @@ sunos32_sys_socketpair(p, v, retval)
} */ *uap = v;
int error;
error = netbsd32_socketpair(p, v, retval);
error = netbsd32_socketpair(l, v, retval);
if (error)
return (error);
return sunos32_sys_socket_common(p, retval, SCARG(uap, type));
return sunos32_sys_socket_common(l, retval, SCARG(uap, type));
}
@ -1039,8 +1054,8 @@ sunos32_sys_socketpair(p, v, retval)
* XXX: This needs cleaning up.
*/
int
sunos32_sys_auditsys(p, v, retval)
struct proc *p;
sunos32_sys_auditsys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1048,8 +1063,8 @@ sunos32_sys_auditsys(p, v, retval)
}
int
sunos32_sys_uname(p, v, retval)
struct proc *p;
sunos32_sys_uname(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1072,8 +1087,8 @@ sunos32_sys_uname(p, v, retval)
}
int
sunos32_sys_setpgrp(p, v, retval)
struct proc *p;
sunos32_sys_setpgrp(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1081,6 +1096,7 @@ sunos32_sys_setpgrp(p, v, retval)
syscallarg(int) pid;
syscallarg(int) pgid;
} */ *uap = v;
struct proc *p = l->l_proc;
/*
* difference to our setpgid call is to include backwards
@ -1090,14 +1106,14 @@ sunos32_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 netbsd32_setpgid(p, uap, retval);
return netbsd32_setpgid(l, uap, retval);
}
int
sunos32_sys_open(p, v, retval)
struct proc *p;
sunos32_sys_open(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1106,20 +1122,21 @@ sunos32_sys_open(p, v, retval)
syscallarg(int) flags;
syscallarg(int) mode;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_open_args ua;
int l, r;
int lf, r;
int noctty;
int ret;
caddr_t sg = stackgap_init(p, 0);
/* convert mode into NetBSD mode */
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);
lf = SCARG(uap, flags);
noctty = lf & 0x8000;
r = (lf & (0x0001 | 0x0002 | 0x0008 | 0x0040 | 0x0200 | 0x0400 | 0x0800));
r |= ((lf & (0x0004 | 0x1000 | 0x4000)) ? O_NONBLOCK : 0);
r |= ((lf & 0x0080) ? O_SHLOCK : 0);
r |= ((lf & 0x0100) ? O_EXLOCK : 0);
r |= ((lf & 0x2000) ? O_FSYNC : 0);
SUNOS32TOP_UAP(path, const char);
SCARG(&ua, flags) = r;
@ -1130,7 +1147,7 @@ sunos32_sys_open(p, v, retval)
else
SUNOS32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
ret = sys_open(p, &ua, retval);
ret = sys_open(l, &ua, retval);
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
struct filedesc *fdp = p->p_fd;
@ -1147,8 +1164,8 @@ sunos32_sys_open(p, v, retval)
#if defined (NFSSERVER)
int
sunos32_sys_nfssvc(p, v, retval)
struct proc *p;
sunos32_sys_nfssvc(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1173,7 +1190,7 @@ sunos32_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
@ -1181,8 +1198,8 @@ sunos32_sys_nfssvc(p, v, retval)
#endif /* NFSSERVER */
int
sunos32_sys_ustat(p, v, retval)
struct proc *p;
sunos32_sys_ustat(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1206,8 +1223,8 @@ sunos32_sys_ustat(p, v, retval)
}
int
sunos32_sys_quotactl(p, v, retval)
struct proc *p;
sunos32_sys_quotactl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1216,11 +1233,12 @@ sunos32_sys_quotactl(p, v, retval)
}
int
sunos32_sys_vhangup(p, v, retval)
struct proc *p;
sunos32_sys_vhangup(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
struct proc *p = l->l_proc;
struct session *sp = p->p_session;
if (sp->s_ttyvp == 0)
@ -1259,8 +1277,8 @@ sunstatfs(sp, buf)
}
int
sunos32_sys_statfs(p, v, retval)
struct proc *p;
sunos32_sys_statfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1268,6 +1286,7 @@ sunos32_sys_statfs(p, v, retval)
syscallarg(const netbsd32_charp) path;
syscallarg(sunos32_statfsp_t) buf;
} */ *uap = v;
struct proc *p = l->l_proc;
struct mount *mp;
struct statfs *sp;
int error;
@ -1289,8 +1308,8 @@ sunos32_sys_statfs(p, v, retval)
}
int
sunos32_sys_fstatfs(p, v, retval)
struct proc *p;
sunos32_sys_fstatfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1298,6 +1317,7 @@ sunos32_sys_fstatfs(p, v, retval)
syscallarg(int) fd;
syscallarg(sunos32_statfsp_t) buf;
} */ *uap = v;
struct proc *p = l->l_proc;
struct file *fp;
struct mount *mp;
struct statfs *sp;
@ -1318,8 +1338,8 @@ sunos32_sys_fstatfs(p, v, retval)
}
int
sunos32_sys_exportfs(p, v, retval)
struct proc *p;
sunos32_sys_exportfs(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1331,8 +1351,8 @@ sunos32_sys_exportfs(p, v, retval)
}
int
sunos32_sys_mknod(p, v, retval)
struct proc *p;
sunos32_sys_mknod(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1341,15 +1361,16 @@ sunos32_sys_mknod(p, v, retval)
syscallarg(int) mode;
syscallarg(int) dev;
} */ *uap = v;
struct proc *p = l->l_proc;
caddr_t sg = stackgap_init(p, 0);
SUNOS32_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
/* netbsd32_mkfifo/mknod to not do alt checking */
if (S_ISFIFO(SCARG(uap, mode)))
return netbsd32_mkfifo(p, (struct netbsd32_mkfifo_args *)uap, retval);
return netbsd32_mkfifo(l, (struct netbsd32_mkfifo_args *)uap, retval);
return netbsd32_mknod(p, (struct netbsd32_mknod_args *)uap, retval);
return netbsd32_mknod(l, (struct netbsd32_mknod_args *)uap, retval);
}
#define SUNOS_SC_ARG_MAX 1
@ -1362,8 +1383,8 @@ sunos32_sys_mknod(p, v, retval)
#define SUNOS_SC_VERSION 8
int
sunos32_sys_sysconf(p, v, retval)
struct proc *p;
sunos32_sys_sysconf(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1411,8 +1432,8 @@ sunos32_sys_sysconf(p, v, retval)
#define SUNOS_RLIM_NLIMITS 7
int
sunos32_sys_getrlimit(p, v, retval)
struct proc *p;
sunos32_sys_getrlimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1427,12 +1448,12 @@ sunos32_sys_getrlimit(p, v, retval)
if (SCARG(uap, which) == SUNOS_RLIMIT_NOFILE)
SCARG(uap, which) = RLIMIT_NOFILE;
return compat_43_netbsd32_ogetrlimit(p, uap, retval);
return compat_43_netbsd32_ogetrlimit(l, uap, retval);
}
int
sunos32_sys_setrlimit(p, v, retval)
struct proc *p;
sunos32_sys_setrlimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1447,7 +1468,7 @@ sunos32_sys_setrlimit(p, v, retval)
if (SCARG(uap, which) == SUNOS_RLIMIT_NOFILE)
SCARG(uap, which) = RLIMIT_NOFILE;
return compat_43_netbsd32_osetrlimit(p, uap, retval);
return compat_43_netbsd32_osetrlimit(l, uap, retval);
}
/* for the m68k machines */
@ -1467,8 +1488,8 @@ static int sreq2breq[] = {
static int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
int
sunos32_sys_ptrace(p, v, retval)
struct proc *p;
sunos32_sys_ptrace(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1496,7 +1517,7 @@ sunos32_sys_ptrace(p, v, retval)
SCARG(&pa, addr) = SCARG(uap, addr);
SCARG(&pa, data) = SCARG(uap, data);
return netbsd32_ptrace(p, &pa, retval);
return netbsd32_ptrace(l, &pa, retval);
}
/*
@ -1526,8 +1547,8 @@ static struct sunos_howto_conv {
};
int
sunos32_sys_reboot(p, v, retval)
struct proc *p;
sunos32_sys_reboot(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1535,6 +1556,7 @@ sunos32_sys_reboot(p, v, retval)
syscallarg(int) howto;
syscallarg(netbsd32_charp) bootstr;
} */ *uap = v;
struct proc *p = l->l_proc;
struct sys_reboot_args ua;
struct sunos_howto_conv *convp;
int error, bsd_howto, sun_howto;
@ -1567,7 +1589,7 @@ sunos32_sys_reboot(p, v, retval)
SCARG(&ua, opt) = bsd_howto;
SCARG(&ua, bootstr) = bootstr;
return (sys_reboot(p, &ua, retval));
return (sys_reboot(l, &ua, retval));
}
/*
@ -1575,8 +1597,8 @@ sunos32_sys_reboot(p, v, retval)
*/
/* ARGSUSED */
int
sunos32_sys_sigvec(p, v, retval)
struct proc *p;
sunos32_sys_sigvec(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
{
@ -1585,6 +1607,7 @@ sunos32_sys_sigvec(p, v, retval)
syscallarg(struct sigvec *) nsv;
syscallarg(struct sigvec *) osv;
} */ *uap = v;
struct proc *p = l->l_proc;
struct netbsd32_sigvec sv;
struct sigaction nsa, osa;
int error;

View File

@ -1,4 +1,4 @@
; $NetBSD: syscalls.master,v 1.8 2002/04/29 09:53:42 mrg Exp $
; $NetBSD: syscalls.master,v 1.9 2003/01/18 08:38:15 thorpej Exp $
; from :NetBSD: syscalls.master,v 1.57 2000/12/09 07:10:36 mycroft Exp
@ -43,6 +43,7 @@
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/poll.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <compat/sunos/sunos.h>