Make system calls conform to a standard prototype and bring those

prototypes into scope.

Fix a couple of bugs revealed during the prototyping process.
This commit is contained in:
thorpej 1995-09-19 22:19:01 +00:00
parent d95577b1ce
commit b5a39bba19
7 changed files with 219 additions and 144 deletions

View File

@ -44,7 +44,6 @@
#include <compat/ibcs2/ibcs2_syscallargs.h> #include <compat/ibcs2/ibcs2_syscallargs.h>
#include <compat/ibcs2/ibcs2_util.h> #include <compat/ibcs2/ibcs2_util.h>
static int static int
cvt_o_flags(flags) cvt_o_flags(flags)
int flags; int flags;
@ -151,11 +150,12 @@ oflags2ioflags(flags)
} }
int int
ibcs2_open(p, uap, retval) ibcs2_open(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_open_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_open_args *uap = v;
int noctty = SCARG(uap, flags) & IBCS2_O_NOCTTY; int noctty = SCARG(uap, flags) & IBCS2_O_NOCTTY;
int ret; int ret;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -179,11 +179,12 @@ ibcs2_open(p, uap, retval)
} }
int int
ibcs2_creat(p, uap, retval) ibcs2_creat(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_creat_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_creat_args *uap = v;
struct open_args cup; struct open_args cup;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -195,11 +196,12 @@ ibcs2_creat(p, uap, retval)
} }
int int
ibcs2_access(p, uap, retval) ibcs2_access(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_access_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_access_args *uap = v;
struct access_args cup; struct access_args cup;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -210,11 +212,12 @@ ibcs2_access(p, uap, retval)
} }
int int
ibcs2_fcntl(p, uap, retval) ibcs2_fcntl(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_fcntl_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_fcntl_args *uap = v;
int error; int error;
struct fcntl_args fa; struct fcntl_args fa;
struct flock *flp; struct flock *flp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_ioctl.c,v 1.6 1995/03/14 15:12:28 scottb Exp $ */ /* $NetBSD: ibcs2_ioctl.c,v 1.7 1995/09/19 22:19:03 thorpej Exp $ */
/* /*
* Copyright (c) 1994, 1995 Scott Bartram * Copyright (c) 1994, 1995 Scott Bartram
@ -312,11 +312,12 @@ stio2stios(t, ts)
} }
int int
ibcs2_ioctl(p, uap, retval) ibcs2_ioctl(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_ioctl_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_ioctl_args *uap = v;
struct filedesc *fdp = p->p_fd; struct filedesc *fdp = p->p_fd;
struct file *fp; struct file *fp;
int (*ctl)(); int (*ctl)();

View File

@ -121,11 +121,13 @@ struct msqid_ds *bp;
} }
int int
ibcs2_msgsys(p, uap, retval) ibcs2_msgsys(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_msgsys_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_msgsys_args *uap = v;
switch (SCARG(uap, which)) { switch (SCARG(uap, which)) {
#ifdef SYSVMSG #ifdef SYSVMSG
case 0: /* msgget */ case 0: /* msgget */
@ -242,11 +244,12 @@ struct semid_ds *bp;
} }
int int
ibcs2_semsys(p, uap, retval) ibcs2_semsys(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_semsys_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_semsys_args *uap = v;
int error; int error;
#ifdef SYSVSEM #ifdef SYSVSEM
@ -356,11 +359,12 @@ struct shmid_ds *bp;
} }
int int
ibcs2_shmsys(p, uap, retval) ibcs2_shmsys(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_shmsys_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_shmsys_args *uap = v;
int error; int error;
#ifdef SYSVSHM #ifdef SYSVSHM

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_misc.c,v 1.8 1995/06/24 20:19:00 christos Exp $ */ /* $NetBSD: ibcs2_misc.c,v 1.9 1995/09/19 22:19:06 thorpej Exp $ */
/* /*
* Copyright (c) 1994, 1995 Scott Bartram * Copyright (c) 1994, 1995 Scott Bartram
@ -105,11 +105,12 @@
int int
ibcs2_ulimit(p, uap, retval) ibcs2_ulimit(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_ulimit_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_ulimit_args *uap = v;
int error; int error;
struct rlimit rl; struct rlimit rl;
struct setrlimit_args { struct setrlimit_args {
@ -152,11 +153,12 @@ ibcs2_ulimit(p, uap, retval)
} }
int int
ibcs2_waitsys(p, uap, retval) ibcs2_waitsys(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_waitsys_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_waitsys_args *uap = v;
int error, status; int error, status;
struct wait4_args w4; struct wait4_args w4;
#define WAITPID_EFLAGS 0x8c4 /* OF, SF, ZF, PF */ #define WAITPID_EFLAGS 0x8c4 /* OF, SF, ZF, PF */
@ -182,11 +184,12 @@ ibcs2_waitsys(p, uap, retval)
} }
int int
ibcs2_execv(p, uap, retval) ibcs2_execv(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_execv_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_execv_args *uap = v;
struct execve_args ea; struct execve_args ea;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -198,11 +201,12 @@ ibcs2_execv(p, uap, retval)
} }
int int
ibcs2_execve(p, uap, retval) ibcs2_execve(p, v, retval)
struct proc *p; struct proc *p;
struct execve_args *uap; void *v;
int *retval; int *retval;
{ {
struct execve_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -210,11 +214,12 @@ ibcs2_execve(p, uap, retval)
} }
int int
ibcs2_umount(p, uap, retval) ibcs2_umount(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_umount_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_umount_args *uap = v;
struct unmount_args um; struct unmount_args um;
SCARG(&um, path) = SCARG(uap, name); SCARG(&um, path) = SCARG(uap, name);
@ -223,11 +228,12 @@ ibcs2_umount(p, uap, retval)
} }
int int
ibcs2_mount(p, uap, retval) ibcs2_mount(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_mount_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_mount_args *uap = v;
#ifdef notyet #ifdef notyet
int oflags = SCARG(uap, flags), nflags, error; int oflags = SCARG(uap, flags), nflags, error;
char fsname[MFSNAMELEN]; char fsname[MFSNAMELEN];
@ -297,11 +303,12 @@ ibcs2_mount(p, uap, retval)
*/ */
int int
ibcs2_getdents(p, uap, retval) ibcs2_getdents(p, v, retval)
struct proc *p; struct proc *p;
register struct ibcs2_getdents_args *uap; void *v;
int *retval; int *retval;
{ {
register struct ibcs2_getdents_args *uap = v;
register struct vnode *vp; register struct vnode *vp;
register caddr_t inp, buf; /* BSD-format */ register caddr_t inp, buf; /* BSD-format */
register int len, reclen; /* BSD-format */ register int len, reclen; /* BSD-format */
@ -394,11 +401,12 @@ out:
} }
int int
ibcs2_read(p, uap, retval) ibcs2_read(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_read_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_read_args *uap = v;
register struct vnode *vp; register struct vnode *vp;
register caddr_t inp, buf; /* BSD-format */ register caddr_t inp, buf; /* BSD-format */
register int len, reclen; /* BSD-format */ register int len, reclen; /* BSD-format */
@ -503,11 +511,12 @@ out:
} }
int int
ibcs2_mknod(p, uap, retval) ibcs2_mknod(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_mknod_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_mknod_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
@ -526,11 +535,12 @@ ibcs2_mknod(p, uap, retval)
} }
int int
ibcs2_getgroups(p, uap, retval) ibcs2_getgroups(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_getgroups_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_getgroups_args *uap = v;
int error, i; int error, i;
ibcs2_gid_t igid, *iset; ibcs2_gid_t igid, *iset;
struct getgroups_args sa; struct getgroups_args sa;
@ -556,11 +566,12 @@ ibcs2_getgroups(p, uap, retval)
} }
int int
ibcs2_setgroups(p, uap, retval) ibcs2_setgroups(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_setgroups_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_setgroups_args *uap = v;
int error, i; int error, i;
ibcs2_gid_t igid, *iset; ibcs2_gid_t igid, *iset;
struct setgroups_args sa; struct setgroups_args sa;
@ -584,11 +595,12 @@ ibcs2_setgroups(p, uap, retval)
} }
int int
ibcs2_setuid(p, uap, retval) ibcs2_setuid(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_setuid_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_setuid_args *uap = v;
struct setuid_args sa; struct setuid_args sa;
SCARG(&sa, uid) = (uid_t)SCARG(uap, uid); SCARG(&sa, uid) = (uid_t)SCARG(uap, uid);
@ -596,11 +608,12 @@ ibcs2_setuid(p, uap, retval)
} }
int int
ibcs2_setgid(p, uap, retval) ibcs2_setgid(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_setgid_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_setgid_args *uap = v;
struct setgid_args sa; struct setgid_args sa;
SCARG(&sa, gid) = (gid_t)SCARG(uap, gid); SCARG(&sa, gid) = (gid_t)SCARG(uap, gid);
@ -608,11 +621,12 @@ ibcs2_setgid(p, uap, retval)
} }
int int
xenix_ftime(p, uap, retval) xenix_ftime(p, v, retval)
struct proc *p; struct proc *p;
struct xenix_ftime_args *uap; void *v;
int *retval; int *retval;
{ {
struct xenix_ftime_args *uap = v;
struct timeval tv; struct timeval tv;
extern struct timezone tz; extern struct timezone tz;
struct xenix_timeb itb; struct xenix_timeb itb;
@ -626,11 +640,12 @@ xenix_ftime(p, uap, retval)
} }
int int
ibcs2_time(p, uap, retval) ibcs2_time(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_time_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_time_args *uap = v;
struct timeval tv; struct timeval tv;
microtime(&tv); microtime(&tv);
@ -643,31 +658,34 @@ ibcs2_time(p, uap, retval)
} }
int int
ibcs2_pathconf(p, uap, retval) ibcs2_pathconf(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_pathconf_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_pathconf_args *uap = v;
SCARG(uap, name)++; /* iBCS2 _PC_* defines are offset by one */ SCARG(uap, name)++; /* iBCS2 _PC_* defines are offset by one */
return pathconf(p, uap, retval); return pathconf(p, uap, retval);
} }
int int
ibcs2_fpathconf(p, uap, retval) ibcs2_fpathconf(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_fpathconf_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_fpathconf_args *uap = v;
SCARG(uap, name)++; /* iBCS2 _PC_* defines are offset by one */ SCARG(uap, name)++; /* iBCS2 _PC_* defines are offset by one */
return fpathconf(p, uap, retval); return fpathconf(p, uap, retval);
} }
int int
ibcs2_sysconf(p, uap, retval) ibcs2_sysconf(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_sysconf_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_sysconf_args *uap = v;
int mib[2], value, len, error; int mib[2], value, len, error;
struct __sysctl_args sa; struct __sysctl_args sa;
struct getrlimit_args ga; struct getrlimit_args ga;
@ -748,11 +766,12 @@ ibcs2_sysconf(p, uap, retval)
} }
int int
ibcs2_alarm(p, uap, retval) ibcs2_alarm(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_alarm_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_alarm_args *uap = v;
int error; int error;
struct itimerval *itp, *oitp; struct itimerval *itp, *oitp;
struct setitimer_args sa; struct setitimer_args sa;
@ -777,29 +796,34 @@ ibcs2_alarm(p, uap, retval)
} }
int int
ibcs2_getmsg(p, uap, retval) ibcs2_getmsg(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_getmsg_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_getmsg_args *uap = v;
return 0; return 0;
} }
int int
ibcs2_putmsg(p, uap, retval) ibcs2_putmsg(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_putmsg_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_putmsg_args *uap = v;
return 0; return 0;
} }
int int
ibcs2_times(p, uap, retval) ibcs2_times(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_times_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_times_args *uap = v;
int error; int error;
struct getrusage_args ga; struct getrusage_args ga;
struct tms tms; struct tms tms;
@ -831,11 +855,12 @@ ibcs2_times(p, uap, retval)
} }
int int
ibcs2_stime(p, uap, retval) ibcs2_stime(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_stime_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_stime_args *uap = v;
int error; int error;
struct settimeofday_args sa; struct settimeofday_args sa;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -852,11 +877,12 @@ ibcs2_stime(p, uap, retval)
} }
int int
ibcs2_utime(p, uap, retval) ibcs2_utime(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_utime_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_utime_args *uap = v;
int error; int error;
struct utimes_args sa; struct utimes_args sa;
struct timeval *tp; struct timeval *tp;
@ -884,11 +910,12 @@ ibcs2_utime(p, uap, retval)
} }
int int
ibcs2_nice(p, uap, retval) ibcs2_nice(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_nice_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_nice_args *uap = v;
int error, cur_nice = p->p_nice; int error, cur_nice = p->p_nice;
struct setpriority_args sa; struct setpriority_args sa;
@ -906,11 +933,12 @@ ibcs2_nice(p, uap, retval)
*/ */
int int
ibcs2_pgrpsys(p, uap, retval) ibcs2_pgrpsys(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_pgrpsys_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_pgrpsys_args *uap = v;
switch (SCARG(uap, type)) { switch (SCARG(uap, type)) {
case 0: /* getpgrp */ case 0: /* getpgrp */
*retval = p->p_pgrp->pg_id; *retval = p->p_pgrp->pg_id;
@ -949,11 +977,12 @@ ibcs2_pgrpsys(p, uap, retval)
*/ */
int int
ibcs2_plock(p, uap, retval) ibcs2_plock(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_plock_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_plock_args *uap = v;
int error; int error;
#define IBCS2_UNLOCK 0 #define IBCS2_UNLOCK 0
#define IBCS2_PROCLOCK 1 #define IBCS2_PROCLOCK 1
@ -974,11 +1003,14 @@ ibcs2_plock(p, uap, retval)
} }
int int
ibcs2_uadmin(p, uap, retval) ibcs2_uadmin(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_uadmin_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_uadmin_args *uap = v;
int error;
#define SCO_A_REBOOT 1 #define SCO_A_REBOOT 1
#define SCO_A_SHUTDOWN 2 #define SCO_A_SHUTDOWN 2
#define SCO_A_REMOUNT 4 #define SCO_A_REMOUNT 4
@ -997,6 +1029,10 @@ ibcs2_uadmin(p, uap, retval)
#define SCO_AD_GETBMAJ 0 #define SCO_AD_GETBMAJ 0
#define SCO_AD_GETCMAJ 1 #define SCO_AD_GETCMAJ 1
/* XXX: is this the right place for this call? */
if (error = suser(p->p_ucred, &p->p_acflag))
return (error);
switch(SCARG(uap, cmd)) { switch(SCARG(uap, cmd)) {
case SCO_A_REBOOT: case SCO_A_REBOOT:
case SCO_A_SHUTDOWN: case SCO_A_SHUTDOWN:
@ -1004,10 +1040,10 @@ ibcs2_uadmin(p, uap, retval)
case SCO_AD_HALT: case SCO_AD_HALT:
case SCO_AD_PWRDOWN: case SCO_AD_PWRDOWN:
case SCO_AD_PWRNAP: case SCO_AD_PWRNAP:
reboot(RB_HALT); boot(RB_HALT);
case SCO_AD_BOOT: case SCO_AD_BOOT:
case SCO_AD_IBOOT: case SCO_AD_IBOOT:
reboot(RB_AUTOBOOT); boot(RB_AUTOBOOT);
} }
return EINVAL; return EINVAL;
case SCO_A_REMOUNT: case SCO_A_REMOUNT:
@ -1021,11 +1057,13 @@ ibcs2_uadmin(p, uap, retval)
} }
int int
ibcs2_sysfs(p, uap, retval) ibcs2_sysfs(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_sysfs_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_sysfs_args *uap = v;
#define IBCS2_GETFSIND 1 #define IBCS2_GETFSIND 1
#define IBCS2_GETFSTYP 2 #define IBCS2_GETFSTYP 2
#define IBCS2_GETNFSTYP 3 #define IBCS2_GETNFSTYP 3
@ -1039,20 +1077,23 @@ ibcs2_sysfs(p, uap, retval)
} }
int int
ibcs2_poll(p, uap, retval) ibcs2_poll(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_poll_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_poll_args *uap = v;
return EINVAL; /* XXX - TODO */ return EINVAL; /* XXX - TODO */
} }
int int
xenix_rdchk(p, uap, retval) xenix_rdchk(p, v, retval)
struct proc *p; struct proc *p;
struct xenix_rdchk_args *uap; void *v;
int *retval; int *retval;
{ {
struct xenix_rdchk_args *uap = v;
int error; int error;
struct ioctl_args sa; struct ioctl_args sa;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -1067,11 +1108,12 @@ xenix_rdchk(p, uap, retval)
} }
int int
xenix_chsize(p, uap, retval) xenix_chsize(p, v, retval)
struct proc *p; struct proc *p;
struct xenix_chsize_args *uap; void *v;
int *retval; int *retval;
{ {
struct xenix_chsize_args *uap = v;
struct ftruncate_args sa; struct ftruncate_args sa;
SCARG(&sa, fd) = SCARG(uap, fd); SCARG(&sa, fd) = SCARG(uap, fd);
@ -1081,20 +1123,23 @@ xenix_chsize(p, uap, retval)
} }
int int
xenix_nap(p, uap, retval) xenix_nap(p, v, retval)
struct proc *p; struct proc *p;
struct xenix_nap_args *uap; void *v;
int *retval; int *retval;
{ {
struct xenix_nap_args *uap = v;
return ENOSYS; return ENOSYS;
} }
int int
ibcs2_unlink(p, uap, retval) ibcs2_unlink(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_unlink_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_unlink_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -1102,11 +1147,12 @@ ibcs2_unlink(p, uap, retval)
} }
int int
ibcs2_chdir(p, uap, retval) ibcs2_chdir(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_chdir_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_chdir_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -1114,11 +1160,12 @@ ibcs2_chdir(p, uap, retval)
} }
int int
ibcs2_chmod(p, uap, retval) ibcs2_chmod(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_chmod_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_chmod_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -1126,11 +1173,12 @@ ibcs2_chmod(p, uap, retval)
} }
int int
ibcs2_chown(p, uap, retval) ibcs2_chown(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_chown_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_chown_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -1138,11 +1186,12 @@ ibcs2_chown(p, uap, retval)
} }
int int
ibcs2_rmdir(p, uap, retval) ibcs2_rmdir(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_rmdir_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_rmdir_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -1150,11 +1199,12 @@ ibcs2_rmdir(p, uap, retval)
} }
int int
ibcs2_mkdir(p, uap, retval) ibcs2_mkdir(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_mkdir_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_mkdir_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
@ -1162,11 +1212,12 @@ ibcs2_mkdir(p, uap, retval)
} }
int int
ibcs2_symlink(p, uap, retval) ibcs2_symlink(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_symlink_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_symlink_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -1175,11 +1226,12 @@ ibcs2_symlink(p, uap, retval)
} }
int int
ibcs2_rename(p, uap, retval) ibcs2_rename(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_rename_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_rename_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
@ -1188,11 +1240,12 @@ ibcs2_rename(p, uap, retval)
} }
int int
ibcs2_readlink(p, uap, retval) ibcs2_readlink(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_readlink_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_readlink_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_signal.c,v 1.5 1995/08/14 01:11:52 mycroft Exp $ */ /* $NetBSD: ibcs2_signal.c,v 1.6 1995/09/19 22:19:07 thorpej Exp $ */
/* /*
* Copyright (c) 1995 Scott Bartram * Copyright (c) 1995 Scott Bartram
@ -186,15 +186,16 @@ bsd_to_ibcs2_sigaction(bsa, isa)
} }
int int
ibcs2_sigaction(p, uap, retval) ibcs2_sigaction(p, v, retval)
register struct proc *p; register struct proc *p;
void *v;
register_t *retval;
{
struct ibcs2_sigaction_args /* { struct ibcs2_sigaction_args /* {
syscallarg(int) sig; syscallarg(int) sig;
syscallarg(struct ibcs2_sigaction *) act; syscallarg(struct ibcs2_sigaction *) act;
syscallarg(struct ibcs2_sigaction *) oact; syscallarg(struct ibcs2_sigaction *) oact;
} */ *uap; } */ *uap = v;
register_t *retval;
{
struct ibcs2_sigaction *nisa, *oisa, tmpisa; struct ibcs2_sigaction *nisa, *oisa, tmpisa;
struct sigaction *nbsa, *obsa, tmpbsa; struct sigaction *nbsa, *obsa, tmpbsa;
struct sigaction_args sa; struct sigaction_args sa;
@ -239,14 +240,15 @@ ibcs2_sigaction(p, uap, retval)
} }
int int
ibcs2_sigsys(p, uap, retval) ibcs2_sigsys(p, v, retval)
register struct proc *p; register struct proc *p;
void *v;
register_t *retval;
{
struct ibcs2_sigsys_args /* { struct ibcs2_sigsys_args /* {
syscallarg(int) sig; syscallarg(int) sig;
syscallarg(ibcs2_sig_t) fp; syscallarg(ibcs2_sig_t) fp;
} */ *uap; } */ *uap = v;
register_t *retval;
{
int signum = ibcs2_to_bsd_sig[IBCS2_SIGNO(SCARG(uap, sig))]; int signum = ibcs2_to_bsd_sig[IBCS2_SIGNO(SCARG(uap, sig))];
int error; int error;
caddr_t sg = stackgap_init(p->p_emul); caddr_t sg = stackgap_init(p->p_emul);
@ -364,15 +366,16 @@ ibcs2_sigsys(p, uap, retval)
} }
int int
ibcs2_sigprocmask(p, uap, retval) ibcs2_sigprocmask(p, v, retval)
register struct proc *p; register struct proc *p;
void *v;
register_t *retval;
{
struct ibcs2_sigprocmask_args /* { struct ibcs2_sigprocmask_args /* {
syscallarg(int) how; syscallarg(int) how;
syscallarg(ibcs2_sigset_t *) set; syscallarg(ibcs2_sigset_t *) set;
syscallarg(ibcs2_sigset_t *) oset; syscallarg(ibcs2_sigset_t *) oset;
} */ *uap; } */ *uap = v;
register_t *retval;
{
ibcs2_sigset_t iss; ibcs2_sigset_t iss;
sigset_t bss; sigset_t bss;
int error = 0; int error = 0;
@ -419,13 +422,14 @@ ibcs2_sigprocmask(p, uap, retval)
} }
int int
ibcs2_sigpending(p, uap, retval) ibcs2_sigpending(p, v, retval)
register struct proc *p; register struct proc *p;
struct ibcs2_sigpending_args /* { void *v;
syscallarg(ibcs2_sigset_t *) mask;
} */ *uap;
register_t *retval; register_t *retval;
{ {
struct ibcs2_sigpending_args /* {
syscallarg(ibcs2_sigset_t *) mask;
} */ *uap = v;
sigset_t bss; sigset_t bss;
ibcs2_sigset_t iss; ibcs2_sigset_t iss;
@ -436,13 +440,14 @@ ibcs2_sigpending(p, uap, retval)
} }
int int
ibcs2_sigsuspend(p, uap, retval) ibcs2_sigsuspend(p, v, retval)
register struct proc *p; register struct proc *p;
struct ibcs2_sigsuspend_args /* { void *v;
syscallarg(ibcs2_sigset_t *) mask;
} */ *uap;
register_t *retval; register_t *retval;
{ {
struct ibcs2_sigsuspend_args /* {
syscallarg(ibcs2_sigset_t *) mask;
} */ *uap = v;
ibcs2_sigset_t sss; ibcs2_sigset_t sss;
sigset_t bss; sigset_t bss;
struct sigsuspend_args sa; struct sigsuspend_args sa;
@ -470,14 +475,15 @@ ibcs2_pause(p, uap, retval)
} }
int int
ibcs2_kill(p, uap, retval) ibcs2_kill(p, v, retval)
register struct proc *p; register struct proc *p;
void *v;
register_t *retval;
{
struct ibcs2_kill_args /* { struct ibcs2_kill_args /* {
syscallarg(int) pid; syscallarg(int) pid;
syscallarg(int) signo; syscallarg(int) signo;
} */ *uap; } */ *uap = v;
register_t *retval;
{
struct kill_args ka; struct kill_args ka;
SCARG(&ka, pid) = SCARG(uap, pid); SCARG(&ka, pid) = SCARG(uap, pid);

View File

@ -48,11 +48,12 @@ struct ibcs2_socksys_args {
}; };
int int
ibcs2_socksys(p, uap, retval) ibcs2_socksys(p, v, retval)
register struct proc *p; register struct proc *p;
register struct ibcs2_socksys_args *uap; void *v;
int *retval; int *retval;
{ {
register struct ibcs2_socksys_args *uap = v;
register struct filedesc *fdp = p->p_fd; register struct filedesc *fdp = p->p_fd;
register struct file *fp; register struct file *fp;
int error; int error;

View File

@ -93,11 +93,12 @@ cvt_statfs(sp, buf, len)
} }
int int
ibcs2_statfs(p, uap, retval) ibcs2_statfs(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_statfs_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_statfs_args *uap = v;
register struct mount *mp; register struct mount *mp;
register struct statfs *sp; register struct statfs *sp;
int error; int error;
@ -118,11 +119,12 @@ ibcs2_statfs(p, uap, retval)
} }
int int
ibcs2_fstatfs(p, uap, retval) ibcs2_fstatfs(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_fstatfs_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_fstatfs_args *uap = v;
struct file *fp; struct file *fp;
struct mount *mp; struct mount *mp;
register struct statfs *sp; register struct statfs *sp;
@ -139,11 +141,12 @@ ibcs2_fstatfs(p, uap, retval)
} }
int int
ibcs2_stat(p, uap, retval) ibcs2_stat(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_stat_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_stat_args *uap = v;
struct ostat st; struct ostat st;
struct ibcs2_stat ibcs2_st; struct ibcs2_stat ibcs2_st;
struct compat_43_stat_args cup; struct compat_43_stat_args cup;
@ -163,11 +166,12 @@ ibcs2_stat(p, uap, retval)
} }
int int
ibcs2_lstat(p, uap, retval) ibcs2_lstat(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_lstat_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_lstat_args *uap = v;
struct ostat st; struct ostat st;
struct ibcs2_stat ibcs2_st; struct ibcs2_stat ibcs2_st;
struct compat_43_lstat_args cup; struct compat_43_lstat_args cup;
@ -187,11 +191,12 @@ ibcs2_lstat(p, uap, retval)
} }
int int
ibcs2_fstat(p, uap, retval) ibcs2_fstat(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_fstat_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_fstat_args *uap = v;
struct ostat st; struct ostat st;
struct ibcs2_stat ibcs2_st; struct ibcs2_stat ibcs2_st;
struct compat_43_fstat_args cup; struct compat_43_fstat_args cup;
@ -210,11 +215,13 @@ ibcs2_fstat(p, uap, retval)
} }
int int
ibcs2_utssys(p, uap, retval) ibcs2_utssys(p, v, retval)
struct proc *p; struct proc *p;
struct ibcs2_utssys_args *uap; void *v;
int *retval; int *retval;
{ {
struct ibcs2_utssys_args *uap = v;
switch (SCARG(uap, flag)) { switch (SCARG(uap, flag)) {
case 0: /* uname(2) */ case 0: /* uname(2) */
{ {