ANSI prototypes

This commit is contained in:
dsl 2007-02-18 11:38:15 +00:00
parent c7907fd992
commit 1564fa5d82
1 changed files with 41 additions and 139 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_compat.c,v 1.85 2007/02/10 10:09:01 ad Exp $ */
/* $NetBSD: hpux_compat.c,v 1.86 2007/02/18 11:38:15 dsl Exp $ */
/*
* Copyright (c) 1990, 1993
@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpux_compat.c,v 1.85 2007/02/10 10:09:01 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: hpux_compat.c,v 1.86 2007/02/18 11:38:15 dsl Exp $");
#if defined(_KERNEL_OPT)
#include "opt_sysv.h"
@ -138,17 +138,14 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_compat.c,v 1.85 2007/02/10 10:09:01 ad Exp $");
int unimpresponse = 0;
#endif
static int hpuxtobsdioctl __P((u_long));
static int hpux_scale __P((struct timeval *));
static int hpuxtobsdioctl(u_long);
static int hpux_scale(struct timeval *);
/*
* HP-UX fork and vfork need to map the EAGAIN return value appropriately.
*/
int
hpux_sys_fork(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_fork(struct lwp *l, void *v, register_t *retval)
{
/* struct hpux_sys_fork_args *uap = v; */
int error;
@ -160,10 +157,7 @@ hpux_sys_fork(l, v, retval)
}
int
hpux_sys_vfork(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_vfork(struct lwp *l, void *v, register_t *retval)
{
/* struct hpux_sys_vfork_args *uap = v; */
int error;
@ -181,10 +175,7 @@ hpux_sys_vfork(l, v, retval)
* termination signal from BSD to HP-UX.
*/
int
hpux_sys_wait3(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_wait3(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_wait3_args *uap = v;
@ -201,10 +192,7 @@ hpux_sys_wait3(l, v, retval)
}
int
hpux_sys_wait(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_wait(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
struct hpux_sys_wait_args *uap = v;
@ -255,10 +243,7 @@ hpux_sys_wait(l, v, retval)
}
int
hpux_sys_waitpid(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_waitpid(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_waitpid_args /* {
syscallarg(pid_t) pid;
@ -314,10 +299,7 @@ hpux_sys_waitpid(l, v, retval)
* FIOSNBIO: return -1 and errno == EWOULDBLOCK
*/
int
hpux_sys_read(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_read(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
struct hpux_sys_read_args *uap = v;
@ -340,10 +322,7 @@ hpux_sys_read(l, v, retval)
}
int
hpux_sys_write(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_write(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
struct hpux_sys_write_args *uap = v;
@ -366,10 +345,7 @@ hpux_sys_write(l, v, retval)
}
int
hpux_sys_readv(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_readv(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
struct hpux_sys_readv_args *uap = v;
@ -392,10 +368,7 @@ hpux_sys_readv(l, v, retval)
}
int
hpux_sys_writev(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_writev(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
struct hpux_sys_writev_args *uap = v;
@ -421,10 +394,7 @@ hpux_sys_writev(l, v, retval)
}
int
hpux_sys_utssys(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_utssys(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_utssys_args *uap = v;
int i;
@ -481,10 +451,7 @@ hpux_sys_utssys(l, v, retval)
}
int
hpux_sys_sysconf(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_sysconf(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_sysconf_args *uap = v;
@ -531,10 +498,7 @@ hpux_sys_sysconf(l, v, retval)
}
int
hpux_sys_ulimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_ulimit(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
struct hpux_sys_ulimit_args *uap = v;
@ -575,9 +539,6 @@ hpux_sys_ulimit(l, v, retval)
*/
int
hpux_sys_rtprio(lp, v, retval)
struct lwp *lp;
void *v;
register_t *retval;
{
struct hpux_sys_rtprio_args *uap = v;
struct proc *p;
@ -587,15 +548,18 @@ hpux_sys_rtprio(lp, v, retval)
SCARG(uap, prio) != RTPRIO_NOCHG &&
SCARG(uap, prio) != RTPRIO_RTOFF)
return (EINVAL);
if (SCARG(uap, pid) == 0)
p = lp->l_proc;
else if ((p = pfind(SCARG(uap, pid))) == 0)
return (ESRCH);
nice = p->p_nice - NZERO;
if (nice < 0)
*retval = (nice + 16) << 3;
else
*retval = RTPRIO_RTOFF;
switch (SCARG(uap, prio)) {
case RTPRIO_NOCHG:
@ -623,10 +587,7 @@ hpux_sys_rtprio(lp, v, retval)
#if 0 /* XXX - This really, really doesn't work anymore. --scottr */
int
hpux_sys_ptrace(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_ptrace(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_ptrace_args *uap = v;
int error;
@ -704,10 +665,7 @@ hpux_sys_ptrace(l, v, retval)
* HP-UX mmap() emulation (mainly for shared library support).
*/
int
hpux_sys_mmap(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_mmap(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_mmap_args *uap = v;
struct sys_mmap_args /* {
@ -736,8 +694,7 @@ hpux_sys_mmap(l, v, retval)
}
static int
hpuxtobsdioctl(com)
u_long com;
hpuxtobsdioctl(u_long com)
{
switch (com) {
case HPUXTIOCSLTC:
@ -771,10 +728,7 @@ hpuxtobsdioctl(com)
* the sgttyb struct is 2 bytes longer
*/
int
hpux_sys_ioctl(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_ioctl(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_ioctl_args /* {
syscallarg(int) fd;
@ -927,10 +881,7 @@ out:
* Note we do not check the real uid or "saved" uid.
*/
int
hpux_sys_getpgrp2(lp, v, retval)
struct lwp *lp;
void *v;
register_t *retval;
hpux_sys_getpgrp2(struct lwp *lp, void *v, register_t *retval)
{
struct hpux_sys_getpgrp2_args *uap = v;
struct proc *cp = lp->l_proc;
@ -964,10 +915,7 @@ hpux_sys_getpgrp2(lp, v, retval)
* Note we do not check the real uid or "saved" uid or pgrp.
*/
int
hpux_sys_setpgrp2(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_setpgrp2(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_setpgrp2_args *uap = v;
@ -981,10 +929,7 @@ hpux_sys_setpgrp2(l, v, retval)
* XXX Same as BSD setre[ug]id right now. Need to consider saved ids.
*/
int
hpux_sys_setresuid(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_setresuid(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_setresuid_args *uap = v;
@ -992,10 +937,7 @@ hpux_sys_setresuid(l, v, retval)
}
int
hpux_sys_setresgid(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_setresgid(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_setresgid_args *uap = v;
@ -1003,10 +945,7 @@ hpux_sys_setresgid(l, v, retval)
}
int
hpux_sys_getrlimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_getrlimit(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_getrlimit_args *uap = v;
struct compat_43_sys_getrlimit_args ap;
@ -1023,10 +962,7 @@ hpux_sys_getrlimit(l, v, retval)
}
int
hpux_sys_setrlimit(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_setrlimit(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_setrlimit_args *uap = v;
struct compat_43_sys_setrlimit_args ap;
@ -1046,10 +982,7 @@ hpux_sys_setrlimit(l, v, retval)
* XXX: simple recognition hack to see if we can make grmd work.
*/
int
hpux_sys_lockf(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_lockf(struct lwp *l, void *v, register_t *retval)
{
/* struct hpux_sys_lockf_args *uap = v; */
@ -1057,10 +990,7 @@ hpux_sys_lockf(l, v, retval)
}
int
hpux_sys_getaccess(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_getaccess(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_getaccess_args *uap = v;
int lgroups[NGROUPS];
@ -1167,10 +1097,7 @@ hpux_sys_getaccess(l, v, retval)
* SYS V style setpgrp()
*/
int
hpux_sys_setpgrp_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_setpgrp_6x(struct lwp *l, void *v, register_t *retval)
{
struct proc *p = l->l_proc;
@ -1181,10 +1108,7 @@ hpux_sys_setpgrp_6x(l, v, retval)
}
int
hpux_sys_time_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_time_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_time_6x_args /* {
syscallarg(time_t *) t;
@ -1201,10 +1125,7 @@ hpux_sys_time_6x(l, v, retval)
}
int
hpux_sys_stime_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_stime_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_stime_6x_args /* {
syscallarg(int) time;
@ -1236,10 +1157,7 @@ hpux_sys_stime_6x(l, v, retval)
}
int
hpux_sys_ftime_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_ftime_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_ftime_6x_args /* {
syscallarg(struct hpux_timeb *) tp;
@ -1257,10 +1175,7 @@ hpux_sys_ftime_6x(l, v, retval)
}
int
hpux_sys_alarm_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_alarm_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_alarm_6x_args /* {
syscallarg(int) deltat;
@ -1351,10 +1266,7 @@ hpux_sys_alarm_6x(l, v, retval)
}
int
hpux_sys_nice_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_nice_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_nice_6x_args /* {
syscallarg(int) nval;
@ -1371,10 +1283,7 @@ hpux_sys_nice_6x(l, v, retval)
}
int
hpux_sys_times_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_times_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_times_6x_args /* {
syscallarg(struct tms *) tms;
@ -1407,8 +1316,7 @@ hpux_sys_times_6x(l, v, retval)
* is what HP-UX returns.
*/
static int
hpux_scale(tvp)
struct timeval *tvp;
hpux_scale(struct timeval *tvp)
{
return (tvp->tv_sec * HPUX_HZ + tvp->tv_usec * HPUX_HZ / 1000000);
}
@ -1418,10 +1326,7 @@ hpux_scale(tvp)
* Can't set ICHG.
*/
int
hpux_sys_utime_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_utime_6x(struct lwp *l, void *v, register_t *retval)
{
struct hpux_sys_utime_6x_args /* {
syscallarg(char *) fname;
@ -1459,10 +1364,7 @@ hpux_sys_utime_6x(l, v, retval)
}
int
hpux_sys_pause_6x(l, v, retval)
struct lwp *l;
void *v;
register_t *retval;
hpux_sys_pause_6x(struct lwp *l, void *v, register_t *retval)
{
return (sigsuspend1(l, &l->l_sigmask));