make this compile again.

This commit is contained in:
christos 2007-12-27 17:18:11 +00:00
parent 6cc2e0f273
commit c9a64311d7
5 changed files with 169 additions and 137 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_fs.c,v 1.44 2007/12/20 23:03:07 dsl Exp $ */
/* $NetBSD: ultrix_fs.c,v 1.45 2007/12/27 17:18:11 christos Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.44 2007/12/20 23:03:07 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.45 2007/12/27 17:18:11 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -300,7 +300,7 @@ ultrix_sys_getmnt(struct lwp *l, const struct ultrix_sys_getmnt_args *uap, regis
bad:
if (path)
FREE(path, M_TEMP);
return (error);
return error;
}
@ -372,9 +372,8 @@ ultrix_sys_mount(struct lwp *l, const struct ultrix_sys_mount_args *uap, registe
struct ultrix_nfs_args una;
struct nfs_args na;
if ((error = copyin(SCARG(uap, data), &una, sizeof una)) !=0) {
return (error);
}
if ((error = copyin(SCARG(uap, data), &una, sizeof(una))) != 0)
return error;
#if 0
/*
* This is the only syscall boundary the
@ -383,7 +382,7 @@ ultrix_sys_mount(struct lwp *l, const struct ultrix_sys_mount_args *uap, registe
*/
if ((error = copyin(una.addr, &osa, sizeof osa)) != 0) {
printf("ultrix_mount: nfs copyin osa\n");
return (error);
return error;
}
sap->sin_family = (u_char)osa.sin_family;
sap->sin_len = sizeof(*sap);
@ -437,5 +436,5 @@ ultrix_sys_mount(struct lwp *l, const struct ultrix_sys_mount_args *uap, registe
&dummy);
}
return (EINVAL);
return EINVAL;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_ioctl.c,v 1.32 2007/12/20 23:03:07 dsl Exp $ */
/* $NetBSD: ultrix_ioctl.c,v 1.33 2007/12/27 17:18:11 christos 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.32 2007/12/20 23:03:07 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.33 2007/12/27 17:18:11 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_ultrix.h"
@ -274,6 +274,7 @@ static void
btios2stios(struct termios *bt, struct emul_termios *st)
{
u_long l, r;
int speed;
l = bt->c_iflag;
r = ((l & IGNBRK) ? 0x00000001 : 0);
@ -364,9 +365,9 @@ btios2stios(struct termios *bt, struct emul_termios *st)
r |= ((l & PENDIN) ? 0x00004000 : 0);
st->c_lflag = r;
l = ttspeedtab(bt->c_ospeed, sptab);
if (l >= 0)
st->c_cflag |= l;
speed = ttspeedtab(bt->c_ospeed, sptab);
if (speed != -1)
st->c_cflag |= speed;
st->c_cc[0] = NATIVE_TO_EMUL_CC(bt->c_cc[VINTR]);
st->c_cc[1] = NATIVE_TO_EMUL_CC(bt->c_cc[VQUIT]);
@ -447,6 +448,7 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
struct filedesc *fdp = p->p_fd;
struct file *fp;
int (*ctl)(struct file *, u_long, void *, struct lwp *);
struct sys_ioctl_args ap;
int error;
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
@ -457,15 +459,18 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
ctl = fp->f_ops->fo_ioctl;
switch (SCARG(uap, com)) {
SCARG(&ap, fd) = SCARG(uap, fd);
SCARG(&ap, data) = SCARG(uap, data);
SCARG(&ap, com) = SCARG(uap, com);
switch (SCARG(&ap, com)) {
case _IOR('t', 0, int):
SCARG(uap, com) = TIOCGETD;
SCARG(&ap, com) = TIOCGETD;
break;
case _IOW('t', 1, int):
{
int disc;
if ((error = copyin(SCARG(uap, data), &disc, sizeof disc)) != 0)
if ((error = copyin(SCARG(&ap, data), &disc, sizeof disc)) != 0)
return error;
/* map SunOS NTTYDISC into our termios discipline */
@ -481,13 +486,13 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
{
int x; /* unused */
return copyin(&x, SCARG(uap, data), sizeof x);
return copyin(&x, SCARG(&ap, data), sizeof x);
}
case _IOR('t', 100, int): /* sun SUNOS_TIOCSSOFTCAR */
{
int x = 0;
return copyout(&x, SCARG(uap, data), sizeof x);
return copyout(&x, SCARG(&ap, data), sizeof x);
}
case _IO('t', 36): /* sun TIOCCONS, no parameters */
{
@ -500,9 +505,9 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
struct sunos_ttysize ss;
if ((error = (*ctl)(fp, TIOCGWINSZ, &ws, l)) != 0)
return (error);
return error;
if ((error = copyin(SCARG(uap, data), &ss, sizeof (ss))) != 0)
if ((error = copyin(SCARG(&ap, data), &ss, sizeof (ss))) != 0)
return error;
ws.ws_row = ss.ts_row;
@ -516,18 +521,18 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
struct sunos_ttysize ss;
if ((error = (*ctl)(fp, TIOCGWINSZ, &ws, l)) != 0)
return (error);
return error;
ss.ts_row = ws.ws_row;
ss.ts_col = ws.ws_col;
return copyout (&ss, SCARG(uap, data), sizeof (ss));
return copyout (&ss, SCARG(&ap, data), sizeof (ss));
}
case _IOW('t', 118, int):
SCARG(uap, com) = TIOCSPGRP;
SCARG(&ap, com) = TIOCSPGRP;
break;
case _IOR('t', 119, int):
SCARG(uap, com) = TIOCGPGRP;
SCARG(&ap, com) = TIOCGPGRP;
break;
/* Emulate termio or termios tcget() */
@ -542,11 +547,11 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
return error;
btios2stios (&bts, &sts);
if (SCARG(uap, com) == ULTRIX_TCGETA) {
if (SCARG(&ap, com) == ULTRIX_TCGETA) {
stios2stio (&sts, &st);
return copyout(&st, SCARG(uap, data), sizeof (st));
return copyout(&st, SCARG(&ap, data), sizeof (st));
} else
return copyout(&sts, SCARG(uap, data), sizeof (sts));
return copyout(&sts, SCARG(&ap, data), sizeof (sts));
/*NOTREACHED*/
}
/* Emulate termio tcset() */
@ -559,7 +564,7 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
struct ultrix_termio st;
int result;
if ((error = copyin(SCARG(uap, data), &st, sizeof (st))) != 0)
if ((error = copyin(SCARG(&ap, data), &st, sizeof (st))) != 0)
return error;
/* get full BSD termios so we don't lose information */
@ -578,13 +583,13 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
* map ioctl code: ultrix tcsets are numbered in reverse order
*/
#ifdef notyet
return (*ctl)(fp, ULTRIX_TCSETA - SCARG(uap, com) + TIOCSETA,
return (*ctl)(fp, ULTRIX_TCSETA - SCARG(&ap, com) + TIOCSETA,
&bts, l);
#else
result= (*ctl)(fp, ULTRIX_TCSETA - SCARG(uap, com) + TIOCSETA,
result= (*ctl)(fp, ULTRIX_TCSETA - SCARG(&ap, com) + TIOCSETA,
&bts, l);
printf("ultrix TCSETA %lx returns %d\n",
ULTRIX_TCSETA - SCARG(uap, com), result);
ULTRIX_TCSETA - SCARG(&ap, com), result);
return result;
#endif
@ -597,10 +602,10 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
struct termios bts;
struct ultrix_termios sts;
if ((error = copyin(SCARG(uap, data), &sts, sizeof (sts))) != 0)
if ((error = copyin(SCARG(&ap, data), &sts, sizeof (sts))) != 0)
return error;
stios2btios (&sts, &bts);
return (*ctl)(fp, ULTRIX_TCSETS - SCARG(uap, com) + TIOCSETA,
return (*ctl)(fp, ULTRIX_TCSETS - SCARG(&ap, com) + TIOCSETA,
&bts, l);
}
/*
@ -609,7 +614,7 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
case _IOW('t', 32, int): { /* TIOCTCNTL */
int on;
error = copyin(SCARG(uap, data), &on, sizeof (on));
error = copyin(SCARG(&ap, data), &on, sizeof (on));
if (error != 0)
return error;
return (*ctl)(fp, TIOCUCNTL, &on, l);
@ -617,7 +622,7 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
case _IOW('t', 33, int): { /* TIOCSIGNAL */
int sig;
error = copyin(SCARG(uap, data), &sig, sizeof (sig));
error = copyin(SCARG(&ap, data), &sig, sizeof (sig));
if (error != 0)
return error;
return (*ctl)(fp, TIOCSIG, &sig, l);
@ -628,7 +633,7 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
*/
#define IN_TYPE(a, type_t) { \
type_t localbuf; \
if ((error = copyin(SCARG(uap, data), \
if ((error = copyin(SCARG(&ap, data), \
&localbuf, sizeof (type_t))) != 0) \
return error; \
return (*ctl)(fp, a, &localbuf, l); \
@ -636,29 +641,29 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
#define INOUT_TYPE(a, type_t) { \
type_t localbuf; \
if ((error = copyin(SCARG(uap, data), &localbuf, \
if ((error = copyin(SCARG(&ap, data), &localbuf, \
sizeof (type_t))) != 0) \
return error; \
if ((error = (*ctl)(fp, a, &localbuf, l)) != 0) \
return error; \
return copyout(&localbuf, SCARG(uap, data), sizeof (type_t)); \
return copyout(&localbuf, SCARG(&ap, data), sizeof (type_t)); \
}
#define IFREQ_IN(a) { \
struct oifreq ifreq; \
if ((error = copyin(SCARG(uap, data), &ifreq, sizeof (ifreq))) != 0) \
if ((error = copyin(SCARG(&ap, data), &ifreq, sizeof (ifreq))) != 0) \
return error; \
return (*ctl)(fp, a, &ifreq, l); \
}
#define IFREQ_INOUT(a) { \
struct oifreq ifreq; \
if ((error = copyin(SCARG(uap, data), &ifreq, sizeof (ifreq))) != 0) \
if ((error = copyin(SCARG(&ap, data), &ifreq, sizeof (ifreq))) != 0) \
return error; \
if ((error = (*ctl)(fp, a, &ifreq, l)) != 0) \
return error; \
return copyout(&ifreq, SCARG(uap, data), sizeof (ifreq)); \
return copyout(&ifreq, SCARG(&ap, data), sizeof (ifreq)); \
}
case _IOW('i', 12, struct oifreq):
@ -698,13 +703,13 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
* 1. our sockaddr's are variable length, not always sizeof(sockaddr)
* 2. this returns a name per protocol, ie. it returns two "lo0"'s
*/
error = copyin(SCARG(uap, data), &ifconfarg, sizeof (ifconfarg));
error = copyin(SCARG(&ap, data), &ifconfarg, sizeof (ifconfarg));
if (error)
return error;
error = (*ctl)(fp, OSIOCGIFCONF, &ifconfarg, l);
if (error)
return error;
return copyout(&ifconfarg, SCARG(uap, data), sizeof (ifconfarg));
return copyout(&ifconfarg, SCARG(&ap, data), sizeof (ifconfarg));
}
@ -758,5 +763,5 @@ ultrix_sys_ioctl(struct lwp *l, const struct ultrix_sys_ioctl_args *uap, registe
return EOPNOTSUPP;
}
return (sys_ioctl(l, uap, retval));
return sys_ioctl(l, &ap, retval);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_misc.c,v 1.109 2007/12/20 23:03:07 dsl Exp $ */
/* $NetBSD: ultrix_misc.c,v 1.110 2007/12/27 17:18:11 christos Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.109 2007/12/20 23:03:07 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.110 2007/12/27 17:18:11 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfsserver.h"
@ -198,6 +198,9 @@ const struct emul emul_ultrix = {
NULL,
uvm_default_mapaddr,
NULL,
0,
NULL
};
#define GSI_PROG_ENV 1
@ -213,7 +216,7 @@ ultrix_sys_getsysinfo(struct lwp *l, const struct ultrix_sys_getsysinfo_args *ua
if (SCARG(uap, nbytes) < sizeof(short))
return EINVAL;
*retval = 1;
return (copyout(&progenv, SCARG(uap, buffer), sizeof(short)));
return copyout(&progenv, SCARG(uap, buffer), sizeof(progenv));
default:
*retval = 0; /* info unavail */
return 0;
@ -231,27 +234,27 @@ ultrix_sys_setsysinfo(struct lwp *l, const struct ultrix_sys_setsysinfo_args *ua
int
ultrix_sys_waitpid(struct lwp *l, const struct ultrix_sys_waitpid_args *uap, register_t *retval)
{
struct sys_wait4_args ua;
struct sys_wait4_args ap;
SCARG(&ua, pid) = SCARG(uap, pid);
SCARG(&ua, status) = SCARG(uap, status);
SCARG(&ua, options) = SCARG(uap, options);
SCARG(&ua, rusage) = 0;
SCARG(&ap, pid) = SCARG(uap, pid);
SCARG(&ap, status) = SCARG(uap, status);
SCARG(&ap, options) = SCARG(uap, options);
SCARG(&ap, rusage) = 0;
return (sys_wait4(l, &ua, retval));
return sys_wait4(l, &ap, retval);
}
int
ultrix_sys_wait3(struct lwp *l, const struct ultrix_sys_wait3_args *uap, register_t *retval)
{
struct sys_wait4_args ua;
struct sys_wait4_args ap;
SCARG(&ua, pid) = -1;
SCARG(&ua, status) = SCARG(uap, status);
SCARG(&ua, options) = SCARG(uap, options);
SCARG(&ua, rusage) = SCARG(uap, rusage);
SCARG(&ap, pid) = -1;
SCARG(&ap, status) = SCARG(uap, status);
SCARG(&ap, options) = SCARG(uap, options);
SCARG(&ap, rusage) = SCARG(uap, rusage);
return (sys_wait4(l, &ua, retval));
return sys_wait4(l, &ap, retval);
}
/*
@ -262,20 +265,26 @@ ultrix_sys_wait3(struct lwp *l, const struct ultrix_sys_wait3_args *uap, registe
* limit nfds to at most FD_MAX.
*/
int
ultrix_sys_select(struct lwp *l, const struct sys_select_args *uap, register_t *retval)
ultrix_sys_select(struct lwp *l, const struct ultrix_sys_select_args *uap, register_t *retval)
{
struct timeval atv;
int error;
struct sys_select_args ap;
/* Limit number of FDs selected on to the native maximum */
if (SCARG(uap, nd) > FD_SETSIZE)
SCARG(uap, nd) = FD_SETSIZE;
SCARG(&ap, nd) = FD_SETSIZE;
else
SCARG(&ap, nd) = SCARG(uap, nd);
SCARG(&ap, in) = SCARG(uap, in);
SCARG(&ap, ou) = SCARG(uap, ou);
SCARG(&ap, ex) = SCARG(uap, ex);
SCARG(&ap, tv) = SCARG(uap, tv);
/* Check for negative timeval */
if (SCARG(uap, tv)) {
error = copyin((void *)SCARG(uap, tv), (void *)&atv,
sizeof(atv));
if (SCARG(&ap, tv)) {
error = copyin(SCARG(uap, tv), &atv, sizeof(atv));
if (error)
goto done;
#ifdef DEBUG
@ -286,7 +295,7 @@ ultrix_sys_select(struct lwp *l, const struct sys_select_args *uap, register_t *
#endif
}
error = sys_select(l, (void*) uap, retval);
error = sys_select(l, &ap, retval);
if (error == EINVAL)
printf("ultrix select: bad args?\n");
@ -303,7 +312,7 @@ async_daemon(struct lwp *l, const void *v, register_t *retval)
SCARG(&ouap, flag) = NFSSVC_BIOD;
SCARG(&ouap, argp) = NULL;
return (sys_nfssvc(l, &ouap, retval));
return sys_nfssvc(l, &ouap, retval);
}
#endif /* NFS */
@ -319,10 +328,10 @@ ultrix_sys_mmap(struct lwp *l, const struct ultrix_sys_mmap_args *uap, register_
* Verify the arguments.
*/
if (SCARG(uap, prot) & ~(PROT_READ|PROT_WRITE|PROT_EXEC))
return (EINVAL); /* XXX still needed? */
return EINVAL; /* XXX still needed? */
if ((SCARG(uap, flags) & SUN__MAP_NEW) == 0)
return (EINVAL);
return EINVAL;
SCARG(&ouap, flags) = SCARG(uap, flags) & ~SUN__MAP_NEW;
SCARG(&ouap, addr) = SCARG(uap, addr);
@ -331,7 +340,7 @@ ultrix_sys_mmap(struct lwp *l, const struct ultrix_sys_mmap_args *uap, register_
SCARG(&ouap, fd) = SCARG(uap, fd);
SCARG(&ouap, pos) = SCARG(uap, pos);
return (sys_mmap(l, &ouap, retval));
return sys_mmap(l, &ouap, retval);
}
int
@ -341,19 +350,26 @@ ultrix_sys_setsockopt(struct lwp *l, const struct ultrix_sys_setsockopt_args *ua
struct file *fp;
struct mbuf *m = NULL;
int error;
struct sys_setsockopt_args ap;
SCARG(&ap, s) = SCARG(uap, s);
SCARG(&ap, level) = SCARG(uap, level);
SCARG(&ap, name) = SCARG(uap, name);
SCARG(&ap, val) = SCARG(uap, val);
SCARG(&ap, valsize) = SCARG(uap, valsize);
/* getsock() will use the descriptor for us */
if ((error = getsock(p->p_fd, SCARG(uap, s), &fp)) != 0)
return (error);
if ((error = getsock(p->p_fd, SCARG(&ap, s), &fp)) != 0)
return error;
#define SO_DONTLINGER (~SO_LINGER)
if (SCARG(uap, name) == SO_DONTLINGER) {
if (SCARG(&ap, name) == SO_DONTLINGER) {
m = m_get(M_WAIT, MT_SOOPTS);
mtod(m, struct linger *)->l_onoff = 0;
m->m_len = sizeof(struct linger);
error = sosetopt((struct socket *)fp->f_data, SCARG(uap, level),
error = sosetopt((struct socket *)fp->f_data, SCARG(&ap, level),
SO_LINGER, m);
}
if (SCARG(uap, level) == IPPROTO_IP) {
if (SCARG(&ap, level) == IPPROTO_IP) {
#define EMUL_IP_MULTICAST_IF 2
#define EMUL_IP_MULTICAST_TTL 3
#define EMUL_IP_MULTICAST_LOOP 4
@ -366,31 +382,31 @@ ultrix_sys_setsockopt(struct lwp *l, const struct ultrix_sys_setsockopt_args *ua
IP_ADD_MEMBERSHIP,
IP_DROP_MEMBERSHIP
};
if (SCARG(uap, name) >= EMUL_IP_MULTICAST_IF &&
SCARG(uap, name) <= EMUL_IP_DROP_MEMBERSHIP) {
SCARG(uap, name) =
ipoptxlat[SCARG(uap, name) - EMUL_IP_MULTICAST_IF];
if (SCARG(&ap, name) >= EMUL_IP_MULTICAST_IF &&
SCARG(&ap, name) <= EMUL_IP_DROP_MEMBERSHIP) {
SCARG(&ap, name) =
ipoptxlat[SCARG(&ap, name) - EMUL_IP_MULTICAST_IF];
}
}
if (SCARG(uap, valsize) > MLEN) {
if (SCARG(&ap, valsize) > MLEN) {
error = EINVAL;
goto out;
}
if (SCARG(uap, val)) {
if (SCARG(&ap, val)) {
m = m_get(M_WAIT, MT_SOOPTS);
error = copyin(SCARG(uap, val), mtod(m, void *),
(u_int)SCARG(uap, valsize));
error = copyin(SCARG(&ap, val), mtod(m, void *),
(u_int)SCARG(&ap, valsize));
if (error) {
(void) m_free(m);
goto out;
}
m->m_len = SCARG(uap, valsize);
m->m_len = SCARG(&ap, valsize);
}
error = sosetopt((struct socket *)fp->f_data, SCARG(uap, level),
SCARG(uap, name), m);
error = sosetopt((struct socket *)fp->f_data, SCARG(&ap, level),
SCARG(&ap, name), m);
out:
FILE_UNUSE(fp, l);
return (error);
return error;
}
#define ULTRIX__SYS_NMLN 32
@ -428,26 +444,28 @@ ultrix_sys_uname(struct lwp *l, const struct ultrix_sys_uname_args *uap, registe
*dp = '\0';
strncpy(sut.machine, machine, sizeof(sut.machine) - 1);
return copyout((void *)&sut, (void *)SCARG(uap, name),
sizeof(struct ultrix_utsname));
return copyout(&sut, SCARG(uap, name), sizeof(sut));
}
int
ultrix_sys_setpgrp(struct lwp *l, const struct ultrix_sys_setpgrp_args *uap, register_t *retval)
{
struct proc *p = l->l_proc;
struct sys_setpgid_args ap;
SCARG(&ap, pid) = SCARG(uap, pid);
SCARG(&ap, pgid) = SCARG(uap, pgid);
/*
* difference to our setpgid call is to include backwards
* compatibility to pre-setsid() binaries. Do setsid()
* instead of setpgid() in those cases where the process
* tries to create a new session the old way.
*/
if (!SCARG(uap, pgid) &&
(!SCARG(uap, pid) || SCARG(uap, pid) == p->p_pid))
return sys_setsid(l, uap, retval);
if (!SCARG(&ap, pgid) &&
(!SCARG(&ap, pid) || SCARG(&ap, pid) == p->p_pid))
return sys_setsid(l, &ap, retval);
else
return sys_setpgid(l, uap, retval);
return sys_setpgid(l, &ap, retval);
}
#if defined (NFSSERVER)
@ -472,13 +490,13 @@ ultrix_sys_nfssvc(struct lwp *l, const void *v, register_t *retval)
memset(&sa, 0, sizeof sa);
if (error = copyout(&sa, SCARG(&outuap, mskval), SCARG(&outuap, msklen)))
return (error);
return error;
if (error = copyout(&sa, SCARG(&outuap, mtchval), SCARG(&outuap, mtchlen)))
return (error);
return error;
return nfssvc(l, &outuap, retval);
#else
return (ENOSYS);
return ENOSYS;
#endif
}
#endif /* NFSSERVER */
@ -504,7 +522,7 @@ ultrix_sys_ustat(struct lwp *l, const struct ultrix_sys_ustat_args *uap, registe
*/
if ((error = copyout(&us, SCARG(uap, buf), sizeof us)) != 0)
return (error);
return error;
return 0;
}
@ -516,7 +534,7 @@ ultrix_sys_quotactl(struct lwp *l, const struct ultrix_sys_quotactl_args *uap, r
}
int
ultrix_sys_vhangup(struct lwp *l, const struct ultrix_sys_vhangup_args *uap, register_t *retval)
ultrix_sys_vhangup(struct lwp *l, const void *uap, register_t *retval)
{
return 0;
@ -540,7 +558,7 @@ ultrix_sys_cacheflush(struct lwp *l, const struct ultrix_sys_cacheflush_args *ua
int nbytes = SCARG(uap, nbytes);
int whichcache = SCARG(uap, whichcache);
return (mips_user_cacheflush(p, va, nbytes, whichcache));
return mips_user_cacheflush(p, va, nbytes, whichcache);
}
@ -583,16 +601,18 @@ ultrix_sys_sigpending(struct lwp *l, const struct ultrix_sys_sigpending_args *ua
sigpending1(l, &ss);
mask = ss.__bits[0];
return (copyout((void *)&mask, (void *)SCARG(uap, mask), sizeof(int)));
return copyout(&mask, SCARG(uap, mask), sizeof(int));
}
int
ultrix_sys_sigreturn(struct lwp *l, const struct ultrix_sys_sigreturn_args *uap, register_t *retval)
{
/* struct sigcontext13 is close enough to Ultrix */
struct compat_13_sys_sigreturn_args ap;
return (compat_13_sys_sigreturn(l, uap, retval));
SCARG(&ap, sigcntxp) = (void *)SCARG(uap, sigcntxp);
return compat_13_sys_sigreturn(l, &ap, retval);
}
int
@ -600,8 +620,11 @@ ultrix_sys_sigcleanup(struct lwp *l, const struct ultrix_sys_sigcleanup_args *ua
{
/* struct sigcontext13 is close enough to Ultrix */
struct compat_13_sys_sigreturn_args ap;
return (compat_13_sys_sigreturn(l, uap, retval));
SCARG(&ap, sigcntxp) = (void *)SCARG(uap, sigcntxp);
return compat_13_sys_sigreturn(l, &ap, retval);
}
int
@ -615,7 +638,7 @@ ultrix_sys_sigsuspend(struct lwp *l, const struct ultrix_sys_sigsuspend_args *ua
ss.__bits[2] = 0;
ss.__bits[3] = 0;
return (sigsuspend1(l, &ss));
return sigsuspend1(l, &ss);
}
#define ULTRIX_SV_ONSTACK 0x0001 /* take signal on signal stack */
@ -632,7 +655,7 @@ ultrix_sys_sigvec(struct lwp *l, const struct ultrix_sys_sigvec_args *uap, regis
if (SCARG(uap, nsv)) {
error = copyin(SCARG(uap, nsv), &nsv, sizeof(nsv));
if (error)
return (error);
return error;
nsa.sa_handler = nsv.sv_handler;
#if 0 /* documentation */
/* ONSTACK is identical */
@ -653,7 +676,7 @@ ultrix_sys_sigvec(struct lwp *l, const struct ultrix_sys_sigvec_args *uap, regis
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0,
NULL, 0);
if (error)
return (error);
return error;
if (SCARG(uap, osv)) {
osv.sv_handler = osa.sa_handler;
osv.sv_flags = osa.sa_flags ^ SA_RESTART;
@ -661,9 +684,9 @@ ultrix_sys_sigvec(struct lwp *l, const struct ultrix_sys_sigvec_args *uap, regis
native_sigset_to_sigset13(&osa.sa_mask, &osv.sv_mask);
error = copyout(&osv, SCARG(uap, osv), sizeof(osv));
if (error)
return (error);
return error;
}
return (0);
return 0;
}
int
@ -683,30 +706,30 @@ ultrix_sys_shmsys(struct lwp *l, const struct ultrix_sys_shmsys_args *uap, regis
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(l, &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(l, &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(l, &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(l, &shmget_args, retval));
return sys_shmget(l, &shmget_args, retval);
default:
return (EINVAL);
return EINVAL;
}
#else
return (EOPNOTSUPP);
return EOPNOTSUPP;
#endif /* SYSVSHM */
}
@ -730,10 +753,10 @@ ultrix_to_bsd_flock(struct ultrix_flock *ufl, struct flock *fl)
fl->l_type = F_UNLCK;
break;
default:
return (EINVAL);
return EINVAL;
}
return (0);
return 0;
}
static void
@ -771,10 +794,10 @@ ultrix_sys_fcntl(struct lwp *l, const struct ultrix_sys_fcntl_args *uap, registe
case F_SETLKW:
error = copyin(SCARG(uap, arg), &ufl, sizeof(ufl));
if (error)
return (error);
return error;
error = ultrix_to_bsd_flock(&ufl, &fl);
if (error)
return (error);
return error;
error = do_fcntl_lock(l, SCARG(uap, fd), SCARG(uap, cmd), &fl);
if (SCARG(uap, cmd) != F_GETLK || error != 0)
return error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_pathname.c,v 1.31 2007/12/20 23:03:07 dsl Exp $ */
/* $NetBSD: ultrix_pathname.c,v 1.32 2007/12/27 17:18:11 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.31 2007/12/20 23:03:07 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.32 2007/12/27 17:18:11 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,7 +87,7 @@ ultrix_sys_creat(struct lwp *l, const struct ultrix_sys_creat_args *uap, registe
SCARG(&ap, flags) = O_WRONLY | O_CREAT | O_TRUNC;
SCARG(&ap, mode) = SCARG(uap, mode);
return (sys_open(l, &ap, retval));
return sys_open(l, &ap, retval);
}
@ -95,21 +95,23 @@ int
ultrix_sys_access(struct lwp *l, const struct ultrix_sys_access_args *uap, register_t *retval)
{
return (sys_access(l, uap, retval));
return sys_access(l, (const struct sys_access_args *)uap, retval);
}
int
ultrix_sys_stat(struct lwp *l, const struct ultrix_sys_stat_args *uap, register_t *retval)
{
return (compat_43_sys_stat(l, uap, retval));
return compat_43_sys_stat(l,
(const struct compat_43_sys_stat_args *)uap, retval);
}
int
ultrix_sys_lstat(struct lwp *l, const struct ultrix_sys_lstat_args *uap, register_t *retval)
{
return (compat_43_sys_lstat(l, uap, retval));
return compat_43_sys_lstat(l,
(const struct compat_43_sys_lstat_args *)uap, retval);
}
int
@ -125,7 +127,7 @@ ultrix_sys_execv(struct lwp *l, const struct ultrix_sys_execv_args *uap, registe
SCARG(&ap, argp) = SCARG(uap, argp);
SCARG(&ap, envp) = NULL;
return (sys_execve(l, &ap, retval));
return sys_execve(l, &ap, retval);
}
int
@ -142,7 +144,7 @@ ultrix_sys_execve(struct lwp *l, const struct ultrix_sys_execve_args *uap, regis
SCARG(&ap, argp) = SCARG(uap, argp);
SCARG(&ap, envp) = SCARG(uap, envp);
return (sys_execve(l, &ap, retval));
return sys_execve(l, &ap, retval);
}
int
@ -152,8 +154,10 @@ ultrix_sys_open(struct lwp *l, const struct ultrix_sys_open_args *uap, register_
int q, r;
int noctty;
int ret;
struct sys_open_args ap;
/* convert open flags into NetBSD flags */
q = SCARG(uap, flags);
noctty = q & 0x8000;
r = (q & (0x0001 | 0x0002 | 0x0008 | 0x0040 | 0x0200 | 0x0400 | 0x0800));
@ -162,8 +166,10 @@ ultrix_sys_open(struct lwp *l, const struct ultrix_sys_open_args *uap, register_
r |= ((q & 0x0100) ? O_EXLOCK : 0);
r |= ((q & 0x2000) ? O_FSYNC : 0);
SCARG(uap, flags) = r;
ret = sys_open(l, (struct sys_open_args *)uap, retval);
SCARG(&ap, path) = SCARG(uap, path);
SCARG(&ap, flags) = r;
SCARG(&ap, mode) = SCARG(uap, mode);
ret = sys_open(l, &ap, retval);
/* XXXSMP */
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) {
@ -227,13 +233,13 @@ ultrix_sys_statfs(struct lwp *l, const struct ultrix_sys_statfs_args *uap, regis
NDINIT(&nd, LOOKUP, FOLLOW | TRYEMULROOT, UIO_USERSPACE,
SCARG(uap, path));
if ((error = namei(&nd)) != 0)
return (error);
return error;
mp = nd.ni_vp->v_mount;
sp = &mp->mnt_stat;
vrele(nd.ni_vp);
if ((error = VFS_STATVFS(mp, sp)) != 0)
return (error);
return error;
sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
return ultrixstatfs(sp, (void *)SCARG(uap, buf));
}
@ -254,7 +260,7 @@ ultrix_sys_fstatfs(struct lwp *l, const struct ultrix_sys_fstatfs_args *uap, reg
/* getvnode() will use the descriptor for us */
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
return error;
mp = ((struct vnode *)fp->f_data)->v_mount;
sp = &mp->mnt_stat;
if ((error = VFS_STATVFS(mp, sp)) != 0)
@ -263,7 +269,7 @@ ultrix_sys_fstatfs(struct lwp *l, const struct ultrix_sys_fstatfs_args *uap, reg
error = ultrixstatfs(sp, (void *)SCARG(uap, buf));
out:
FILE_UNUSE(fp, l);
return (error);
return error;
}
int
@ -271,7 +277,8 @@ ultrix_sys_mknod(struct lwp *l, const struct ultrix_sys_mknod_args *uap, registe
{
if (S_ISFIFO(SCARG(uap, mode)))
return sys_mkfifo(l, uap, retval);
return sys_mkfifo(l, (const struct sys_mkfifo_args *)uap,
retval);
return sys_mknod(l, (struct sys_mknod_args *)uap, retval);
return sys_mknod(l, (const struct sys_mknod_args *)uap, retval);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_syscallargs.h,v 1.48 2007/12/20 23:10:52 dsl Exp $ */
/* $NetBSD: ultrix_syscallargs.h,v 1.49 2007/12/27 17:18:11 christos Exp $ */
/*
* System call argument lists.
@ -684,9 +684,7 @@ int ultrix_sys_cachectl(struct lwp *, const struct ultrix_sys_cachectl_args *, r
#else /* !mips */
#endif /* !mips */
#ifdef NFSSERVER
int ultrix_sys_nfssvc(struct lwp *, const struct ultrix_sys_nfssvc_args *, register_t *);
#else
int ultrix_sys_nfssvc(struct lwp *, const void *, register_t *);
#endif
int compat_43_sys_getdirentries(struct lwp *, const struct compat_43_sys_getdirentries_args *, register_t *);