Make system calls conform to a standard prototype and bring those

prototypes into scope.
This commit is contained in:
thorpej 1995-09-19 22:10:11 +00:00
parent c8aae0e18a
commit eecd40e854
6 changed files with 167 additions and 118 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_fcntl.c,v 1.9 1995/06/24 20:29:21 christos Exp $ */
/* $NetBSD: svr4_fcntl.c,v 1.10 1995/09/19 22:10:11 thorpej Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -48,7 +48,6 @@
#include <compat/svr4/svr4_fcntl.h>
#include <compat/svr4/svr4_poll.h>
static int
svr4_to_bsd_cmd(cmd)
int cmd;
@ -175,11 +174,12 @@ svr4_to_bsd_flock(iflp, oflp)
}
int
svr4_open(p, uap, retval)
svr4_open(p, v, retval)
register struct proc *p;
register struct svr4_open_args *uap;
void *v;
register_t *retval;
{
struct svr4_open_args *uap = v;
int error;
struct open_args cup;
@ -208,11 +208,12 @@ svr4_open(p, uap, retval)
int
svr4_creat(p, uap, retval)
svr4_creat(p, v, retval)
register struct proc *p;
register struct svr4_creat_args *uap;
void *v;
register_t *retval;
{
struct svr4_creat_args *uap = v;
struct open_args cup;
caddr_t sg = stackgap_init(p->p_emul);
@ -227,11 +228,12 @@ svr4_creat(p, uap, retval)
int
svr4_access(p, uap, retval)
svr4_access(p, v, retval)
register struct proc *p;
register struct svr4_access_args *uap;
void *v;
register_t *retval;
{
struct svr4_access_args *uap = v;
struct access_args cup;
caddr_t sg = stackgap_init(p->p_emul);
@ -245,11 +247,12 @@ svr4_access(p, uap, retval)
int
svr4_fcntl(p, uap, retval)
svr4_fcntl(p, v, retval)
register struct proc *p;
register struct svr4_fcntl_args *uap;
void *v;
register_t *retval;
{
struct svr4_fcntl_args *uap;
int error;
struct fcntl_args fa;
@ -359,11 +362,12 @@ svr4_pollscan(p, pl, nfd, retval)
* differently.
*/
int
svr4_poll(p, uap, retval)
svr4_poll(p, v, retval)
register struct proc *p;
register struct svr4_poll_args *uap;
void *v;
register_t *retval;
{
struct svr4_poll_args *uap = v;
int i, s;
int error, error2;
size_t sz = sizeof(struct svr4_pollfd) * SCARG(uap, nfds);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_ioctl.c,v 1.10 1995/07/04 19:47:02 christos Exp $ */
/* $NetBSD: svr4_ioctl.c,v 1.11 1995/09/19 22:10:12 thorpej Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -82,11 +82,12 @@ svr4_decode_cmd(cmd, dir, c, num, argsiz)
#endif
int
svr4_ioctl(p, uap, retval)
svr4_ioctl(p, v, retval)
register struct proc *p;
register struct svr4_ioctl_args *uap;
void *v;
register_t *retval;
{
struct svr4_ioctl_args *uap = v;
struct file *fp;
struct filedesc *fdp;
u_long cmd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_misc.c,v 1.25 1995/08/14 02:07:57 mycroft Exp $ */
/* $NetBSD: svr4_misc.c,v 1.26 1995/09/19 22:10:14 thorpej Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -92,11 +92,12 @@ static void bsd_statfs_to_svr4_statvfs __P((const struct statfs *,
static struct proc *svr4_pfind __P((pid_t pid));
int
svr4_wait(p, uap, retval)
svr4_wait(p, v, retval)
register struct proc *p;
register struct svr4_wait_args *uap;
void *v;
register_t *retval;
{
struct svr4_wait_args *uap = v;
struct wait4_args w4;
int error;
size_t sz = sizeof(*SCARG(&w4, status));
@ -126,11 +127,12 @@ svr4_wait(p, uap, retval)
int
svr4_execv(p, uap, retval)
svr4_execv(p, v, retval)
register struct proc *p;
register struct svr4_execv_args *uap;
void *v;
register_t *retval;
{
struct svr4_execv_args *uap = v;
struct execve_args ex;
caddr_t sg = stackgap_init(p->p_emul);
@ -145,11 +147,12 @@ svr4_execv(p, uap, retval)
int
svr4_execve(p, uap, retval)
svr4_execve(p, v, retval)
register struct proc *p;
register struct execve_args *uap;
void *v;
register_t *retval;
{
struct execve_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul);
SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -158,11 +161,12 @@ svr4_execve(p, uap, retval)
int
svr4_time(p, uap, retval)
svr4_time(p, v, retval)
register struct proc *p;
register struct svr4_time_args *uap;
void *v;
register_t *retval;
{
struct svr4_time_args *uap = v;
int error = 0;
struct timeval tv;
@ -184,11 +188,12 @@ svr4_time(p, uap, retval)
* This is quite ugly, but what do you expect from compatibility code?
*/
int
svr4_getdents(p, uap, retval)
svr4_getdents(p, v, retval)
register struct proc *p;
register struct svr4_getdents_args *uap;
void *v;
register_t *retval;
{
struct svr4_getdents_args *uap = v;
struct vnode *vp;
caddr_t inp, buf; /* BSD-format */
int len, reclen; /* BSD-format */
@ -299,11 +304,12 @@ out:
}
int
svr4_mmap(p, uap, retval)
svr4_mmap(p, v, retval)
register struct proc *p;
register struct svr4_mmap_args *uap;
void *v;
register_t *retval;
{
struct svr4_mmap_args *uap = v;
struct filedesc *fdp;
struct file *fp;
struct vnode *vp;
@ -332,11 +338,12 @@ svr4_mmap(p, uap, retval)
}
int
svr4_fchroot(p, uap, retval)
svr4_fchroot(p, v, retval)
register struct proc *p;
register struct svr4_fchroot_args *uap;
void *v;
register_t *retval;
{
struct svr4_fchroot_args *uap = v;
struct filedesc *fdp = p->p_fd;
struct vnode *vp;
struct file *fp;
@ -364,11 +371,12 @@ svr4_fchroot(p, uap, retval)
int
svr4_mknod(p, uap, retval)
svr4_mknod(p, v, retval)
register struct proc *p;
register struct svr4_mknod_args *uap;
void *v;
register_t *retval;
{
struct svr4_mknod_args *uap = v;
caddr_t sg = stackgap_init(p->p_emul);
SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
@ -397,11 +405,12 @@ svr4_vhangup(p, uap, retval)
int
svr4_sysconfig(p, uap, retval)
svr4_sysconfig(p, v, retval)
register struct proc *p;
register struct svr4_sysconfig_args *uap;
void *v;
register_t *retval;
{
struct svr4_sysconfig_args *uap = v;
extern int maxfiles;
switch (SCARG(uap, name)) {
@ -488,11 +497,12 @@ svr4_sysconfig(p, uap, retval)
#define SVR4_RLIM_NLIMITS 7
int
svr4_getrlimit(p, uap, retval)
svr4_getrlimit(p, v, retval)
register struct proc *p;
register struct svr4_getrlimit_args *uap;
void *v;
register_t *retval;
{
struct svr4_getrlimit_args *uap = v;
struct compat_43_getrlimit_args ap;
if (SCARG(uap, which) >= SVR4_RLIM_NLIMITS)
@ -510,11 +520,12 @@ svr4_getrlimit(p, uap, retval)
}
int
svr4_setrlimit(p, uap, retval)
svr4_setrlimit(p, v, retval)
register struct proc *p;
register struct svr4_setrlimit_args *uap;
void *v;
register_t *retval;
{
struct svr4_setrlimit_args *uap = v;
struct compat_43_setrlimit_args ap;
if (SCARG(uap, which) >= SVR4_RLIM_NLIMITS)
@ -534,11 +545,12 @@ svr4_setrlimit(p, uap, retval)
/* ARGSUSED */
int
svr4_break(p, uap, retval)
svr4_break(p, v, retval)
register struct proc *p;
register struct svr4_break_args *uap;
void *v;
register_t *retval;
{
struct svr4_break_args *uap = v;
register struct vmspace *vm = p->p_vmspace;
vm_offset_t new, old;
int rv;
@ -587,11 +599,12 @@ timeval_to_clock_t(tv)
}
int
svr4_times(p, uap, retval)
svr4_times(p, v, retval)
register struct proc *p;
register struct svr4_times_args *uap;
void *v;
register_t *retval;
{
struct svr4_times_args *uap = v;
int error;
struct tms tms;
struct timeval t;
@ -634,11 +647,13 @@ svr4_times(p, uap, retval)
int
svr4_ulimit(p, uap, retval)
svr4_ulimit(p, v, retval)
register struct proc *p;
register struct svr4_ulimit_args *uap;
void *v;
register_t *retval;
{
struct svr4_ulimit_args *uap = v;
switch (SCARG(uap, cmd)) {
case SVR4_GFILLIM:
*retval = p->p_rlimit[RLIMIT_FSIZE].rlim_cur / 512;
@ -709,11 +724,12 @@ svr4_pfind(pid)
int
svr4_pgrpsys(p, uap, retval)
svr4_pgrpsys(p, v, retval)
register struct proc *p;
register struct svr4_pgrpsys_args *uap;
void *v;
register_t *retval;
{
struct svr4_pgrpsys_args *uap = v;
int error;
switch (SCARG(uap, cmd)) {
@ -826,11 +842,12 @@ svr4_hrtcntl(p, uap, retval)
}
int
svr4_hrtsys(p, uap, retval)
svr4_hrtsys(p, v, retval)
register struct proc *p;
register struct svr4_hrtsys_args *uap;
void *v;
register_t *retval;
{
struct svr4_hrtsys_args *uap = v;
int error;
struct timeval tv;
@ -904,11 +921,12 @@ svr4_setinfo(p, st, s)
int
svr4_waitsys(p, uap, retval)
svr4_waitsys(p, v, retval)
register struct proc *p;
register struct svr4_waitsys_args *uap;
void *v;
register_t *retval;
{
struct svr4_waitsys_args *uap = v;
int nfound;
int error;
struct proc *q, *t;
@ -1068,11 +1086,12 @@ bsd_statfs_to_svr4_statvfs(bfs, sfs)
int
svr4_statvfs(p, uap, retval)
svr4_statvfs(p, v, retval)
register struct proc *p;
register struct svr4_statvfs_args *uap;
void *v;
register_t *retval;
{
struct svr4_statvfs_args *uap = v;
struct statfs_args fs_args;
caddr_t sg = stackgap_init(p->p_emul);
struct statfs *fs = stackgap_alloc(&sg, sizeof(struct statfs));
@ -1097,11 +1116,12 @@ svr4_statvfs(p, uap, retval)
int
svr4_fstatvfs(p, uap, retval)
svr4_fstatvfs(p, v, retval)
register struct proc *p;
register struct svr4_fstatvfs_args *uap;
void *v;
register_t *retval;
{
struct svr4_fstatvfs_args *uap = v;
struct fstatfs_args fs_args;
caddr_t sg = stackgap_init(p->p_emul);
struct statfs *fs = stackgap_alloc(&sg, sizeof(struct statfs));
@ -1124,11 +1144,12 @@ svr4_fstatvfs(p, uap, retval)
}
int
svr4_alarm(p, uap, retval)
svr4_alarm(p, v, retval)
register struct proc *p;
register struct svr4_alarm_args *uap;
void *v;
register_t *retval;
{
struct svr4_alarm_args *uap = v;
int error;
struct itimerval *ntp, *otp, tp;
struct setitimer_args sa;
@ -1164,11 +1185,13 @@ svr4_alarm(p, uap, retval)
int
svr4_gettimeofday(p, uap, retval)
svr4_gettimeofday(p, v, retval)
register struct proc *p;
register struct svr4_gettimeofday_args *uap;
void *v;
register_t *retval;
{
struct svr4_gettimeofday_args *uap = v;
if (SCARG(uap, tp)) {
struct timeval atv;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_signal.c,v 1.17 1995/08/19 04:04:50 cgd Exp $ */
/* $NetBSD: svr4_signal.c,v 1.18 1995/09/19 22:10:16 thorpej Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -251,15 +251,16 @@ bsd_to_svr4_sigaltstack(bss, sss)
}
int
svr4_sigaction(p, uap, retval)
svr4_sigaction(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_sigaction_args /* {
syscallarg(int) signum;
syscallarg(struct svr4_sigaction *) nsa;
syscallarg(struct svr4_sigaction *) osa;
} */ *uap;
register_t *retval;
{
} */ *uap = v;
struct svr4_sigaction *nssa, *ossa, tmpssa;
struct sigaction *nbsa, *obsa, tmpbsa;
struct sigaction_args sa;
@ -304,14 +305,15 @@ svr4_sigaction(p, uap, retval)
}
int
svr4_sigaltstack(p, uap, retval)
svr4_sigaltstack(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_sigaltstack_args /* {
syscallarg(struct svr4_sigaltstack *) nss;
syscallarg(struct svr4_sigaltstack *) oss;
} */ *uap;
register_t *retval;
{
} */ *uap = v;
struct svr4_sigaltstack *nsss, *osss, tmpsss;
struct sigaltstack *nbss, *obss, tmpbss;
struct sigaltstack_args sa;
@ -358,14 +360,15 @@ svr4_sigaltstack(p, uap, retval)
* Stolen from the ibcs2 one
*/
int
svr4_signal(p, uap, retval)
svr4_signal(p, v, retval)
register struct proc *p;
struct svr4_signal_args /* {
syscallarg(int) signum;
syscallarg(svr4_sig_t) handler;
} */ *uap;
void *v;
register_t *retval;
{
struct svr4_signal_args /* {
syscallarg(int) signum;
syscallarg(svr4_sig_t) handler;
} */ *uap = v;
int signum = svr4_to_bsd_sig[SVR4_SIGNO(SCARG(uap, signum))];
int error;
caddr_t sg = stackgap_init(p->p_emul);
@ -479,15 +482,16 @@ svr4_signal(p, uap, retval)
}
int
svr4_sigprocmask(p, uap, retval)
svr4_sigprocmask(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_sigprocmask_args /* {
syscallarg(int) how;
syscallarg(svr4_sigset_t *) set;
syscallarg(svr4_sigset_t *) oset;
} */ *uap;
register_t *retval;
{
} */ *uap = v;
svr4_sigset_t sss;
sigset_t bss;
int error = 0;
@ -534,14 +538,15 @@ svr4_sigprocmask(p, uap, retval)
}
int
svr4_sigpending(p, uap, retval)
svr4_sigpending(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_sigpending_args /* {
syscallarg(int) what;
syscallarg(svr4_sigset_t *) mask;
} */ *uap;
register_t *retval;
{
} */ *uap = v;
sigset_t bss;
svr4_sigset_t sss;
@ -565,13 +570,14 @@ svr4_sigpending(p, uap, retval)
}
int
svr4_sigsuspend(p, uap, retval)
svr4_sigsuspend(p, v, retval)
register struct proc *p;
struct svr4_sigsuspend_args /* {
syscallarg(svr4_sigset_t *) ss;
} */ *uap;
void *v;
register_t *retval;
{
struct svr4_sigsuspend_args /* {
syscallarg(svr4_sigset_t *) ss;
} */ *uap = v;
svr4_sigset_t sss;
sigset_t bss;
struct sigsuspend_args sa;
@ -587,14 +593,15 @@ svr4_sigsuspend(p, uap, retval)
}
int
svr4_kill(p, uap, retval)
svr4_kill(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_kill_args /* {
syscallarg(int) pid;
syscallarg(int) signum;
} */ *uap;
register_t *retval;
{
} */ *uap = v;
struct kill_args ka;
SCARG(&ka, pid) = SCARG(uap, pid);
@ -603,14 +610,15 @@ svr4_kill(p, uap, retval)
}
int
svr4_context(p, uap, retval)
svr4_context(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
struct svr4_context_args /* {
syscallarg(int) func;
syscallarg(struct svr4_ucontext *) uc;
} */ *uap;
register_t *retval;
{
} */ *uap = v;
struct svr4_ucontext uc;
int error;
*retval = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_stat.c,v 1.11 1995/06/27 22:12:54 christos Exp $ */
/* $NetBSD: svr4_stat.c,v 1.12 1995/09/19 22:10:18 thorpej Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -110,11 +110,12 @@ bsd_to_svr4_xstat(st, st4)
int
svr4_stat(p, uap, retval)
svr4_stat(p, v, retval)
register struct proc *p;
register struct svr4_stat_args *uap;
void *v;
register_t *retval;
{
struct svr4_stat_args *uap = v;
#ifdef SVR4_NO_OSTAT
struct svr4_xstat_args cup;
@ -151,11 +152,12 @@ svr4_stat(p, uap, retval)
}
int
svr4_lstat(p, uap, retval)
svr4_lstat(p, v, retval)
register struct proc *p;
register struct svr4_lstat_args *uap;
void *v;
register_t *retval;
{
struct svr4_lstat_args *uap = v;
#ifdef SVR4_NO_OSTAT
struct svr4_lxstat_args cup;
@ -191,11 +193,12 @@ svr4_lstat(p, uap, retval)
}
int
svr4_fstat(p, uap, retval)
svr4_fstat(p, v, retval)
register struct proc *p;
register struct svr4_fstat_args *uap;
void *v;
register_t *retval;
{
struct svr4_fstat_args *uap = v;
#ifdef SVR4_NO_OSTAT
struct svr4_fxstat_args cup;
@ -231,11 +234,12 @@ svr4_fstat(p, uap, retval)
int
svr4_xstat(p, uap, retval)
svr4_xstat(p, v, retval)
register struct proc *p;
register struct svr4_xstat_args *uap;
void *v;
register_t *retval;
{
struct svr4_xstat_args *uap = v;
struct stat st;
struct svr4_xstat svr4_st;
struct stat_args cup;
@ -262,11 +266,12 @@ svr4_xstat(p, uap, retval)
}
int
svr4_lxstat(p, uap, retval)
svr4_lxstat(p, v, retval)
register struct proc *p;
register struct svr4_lxstat_args *uap;
void *v;
register_t *retval;
{
struct svr4_lxstat_args *uap = v;
struct stat st;
struct svr4_xstat svr4_st;
struct lstat_args cup;
@ -293,11 +298,12 @@ svr4_lxstat(p, uap, retval)
}
int
svr4_fxstat(p, uap, retval)
svr4_fxstat(p, v, retval)
register struct proc *p;
register struct svr4_fxstat_args *uap;
void *v;
register_t *retval;
{
struct svr4_fxstat_args *uap = v;
struct stat st;
struct svr4_xstat svr4_st;
struct fstat_args cup;
@ -328,11 +334,12 @@ struct svr4_ustat_args {
};
int
svr4_ustat(p, uap, retval)
svr4_ustat(p, v, retval)
register struct proc *p;
register struct svr4_ustat_args *uap;
void *v;
register_t *retval;
{
struct svr4_ustat_args *uap = v;
struct svr4_ustat us;
int error;
@ -351,11 +358,12 @@ svr4_ustat(p, uap, retval)
int
svr4_uname(p, uap, retval)
svr4_uname(p, v, retval)
register struct proc *p;
register struct svr4_uname_args *uap;
void *v;
register_t *retval;
{
struct svr4_uname_args *uap = v;
struct svr4_utsname sut;
extern char ostype[], hostname[], osrelease[], version[], machine[];
@ -382,11 +390,12 @@ svr4_uname(p, uap, retval)
}
int
svr4_systeminfo(p, uap, retval)
svr4_systeminfo(p, v, retval)
register struct proc *p;
register struct svr4_systeminfo_args *uap;
void *v;
register_t *retval;
{
struct svr4_systeminfo_args *uap = v;
char *str;
int name;
int error;
@ -459,11 +468,13 @@ svr4_systeminfo(p, uap, retval)
int
svr4_utssys(p, uap, retval)
svr4_utssys(p, v, retval)
register struct proc *p;
register struct svr4_utssys_args *uap;
void *v;
register_t *retval;
{
struct svr4_utssys_args *uap = v;
switch (SCARG(uap, sel)) {
case 0: /* uname(2) */
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_stream.c,v 1.7 1995/06/24 20:29:27 christos Exp $ */
/* $NetBSD: svr4_stream.c,v 1.8 1995/09/19 22:10:20 thorpej Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -635,11 +635,12 @@ svr4_showmsg(str, fd, ctl, dat, flags)
int
svr4_putmsg(p, uap, retval)
svr4_putmsg(p, v, retval)
register struct proc *p;
register struct svr4_putmsg_args *uap;
void *v;
register_t *retval;
{
struct svr4_putmsg_args *uap = v;
struct filedesc *fdp = p->p_fd;
struct file *fp;
struct svr4_strbuf dat, ctl;
@ -756,11 +757,12 @@ svr4_putmsg(p, uap, retval)
int
svr4_getmsg(p, uap, retval)
svr4_getmsg(p, v, retval)
register struct proc *p;
register struct svr4_getmsg_args *uap;
void *v;
register_t *retval;
{
struct svr4_getmsg_args *uap = v;
struct filedesc *fdp = p->p_fd;
struct file *fp;
struct getpeername_args ga;