diff options
-rw-r--r-- | sys/compat/hpux/hpux.h | 6 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_compat.c | 86 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_file.c | 15 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_net.c | 41 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_sig.c | 53 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_sig.h | 55 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_termio.h | 17 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_tty.c | 30 |
8 files changed, 197 insertions, 106 deletions
diff --git a/sys/compat/hpux/hpux.h b/sys/compat/hpux/hpux.h index 92da34ae5da..d467c4d1815 100644 --- a/sys/compat/hpux/hpux.h +++ b/sys/compat/hpux/hpux.h @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux.h,v 1.3 1996/08/02 20:34:53 niklas Exp $ */ -/* $NetBSD: hpux.h,v 1.10 1995/12/08 07:54:43 thorpej Exp $ */ +/* $OpenBSD: hpux.h,v 1.4 1997/04/16 09:17:59 downsj Exp $ */ +/* $NetBSD: hpux.h,v 1.11 1997/04/01 19:58:58 scottr Exp $ */ /* * Copyright (c) 1995 Jason R. Thorpe. All rights reserved. @@ -282,7 +282,7 @@ struct hpux_shmid_ds { /* HP-UX POSIX signal stuff implementation */ typedef struct __hpux_sigset_t { long sigset[8]; } hpux_sigset_t; struct hpux_sigaction { - void (*sa_handler)(); + void (*sa_handler) __P((int)); hpux_sigset_t sa_mask; int sa_flags; }; diff --git a/sys/compat/hpux/hpux_compat.c b/sys/compat/hpux/hpux_compat.c index 1146a725a05..28bfa011be6 100644 --- a/sys/compat/hpux/hpux_compat.c +++ b/sys/compat/hpux/hpux_compat.c @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux_compat.c,v 1.8 1997/03/26 08:11:04 downsj Exp $ */ -/* $NetBSD: hpux_compat.c,v 1.30 1997/03/16 10:13:12 thorpej Exp $ */ +/* $OpenBSD: hpux_compat.c,v 1.9 1997/04/16 09:18:02 downsj Exp $ */ +/* $NetBSD: hpux_compat.c,v 1.31 1997/04/01 19:58:59 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -80,6 +80,7 @@ #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> +#include <compat/hpux/hpux_sig.h> #include <compat/hpux/hpux_util.h> #include <compat/hpux/hpux_termio.h> #include <compat/hpux/hpux_syscall.h> @@ -111,7 +112,11 @@ extern char sigcode[], esigcode[]; extern struct sysent hpux_sysent[]; extern char *hpux_syscallnames[]; -static int hpux_scale __P((struct timeval *)); +int hpux_shmctl1 __P((struct proc *, struct hpux_sys_shmctl_args *, + register_t *, int)); +int hpuxtobsdioctl __P((u_long)); + +static int hpux_scale __P((struct timeval *)); /* * HP-UX fork and vfork need to map the EAGAIN return value appropriately. @@ -122,7 +127,7 @@ hpux_sys_fork(p, v, retval) void *v; register_t *retval; { - struct hpux_sys_fork_args *uap = v; + /* struct hpux_sys_fork_args *uap = v; */ int error; error = sys_fork(p, v, retval); @@ -137,7 +142,7 @@ hpux_sys_vfork(p, v, retval) void *v; register_t *retval; { - struct hpux_sys_vfork_args *uap = v; + /* struct hpux_sys_vfork_args *uap = v; */ int error; error = sys_vfork(p, v, retval); @@ -174,11 +179,11 @@ hpux_sys_wait3(p, v, retval) int hpux_sys_wait(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { - register struct hpux_sys_wait_args *uap = v; + struct hpux_sys_wait_args *uap = v; struct sys_wait4_args w4; int error; int sig; @@ -381,15 +386,15 @@ hpux_sys_dup(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_dup_args *uap = v; - register struct filedesc *fdp = p->p_fd; + struct hpux_sys_dup_args *uap = v; + struct filedesc *fdp = p->p_fd; struct file *fp; int fd, error; if (((unsigned)SCARG(uap, fd)) >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL) return (EBADF); - if (error = fdalloc(p, 0, &fd)) + if ((error = fdalloc(p, 0, &fd))) return (error); fdp->fd_ofiles[fd] = fp; fdp->fd_ofileflags[fd] = @@ -407,11 +412,11 @@ hpux_sys_utssys(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_utssys_args *uap = v; - register int i; + struct hpux_sys_utssys_args *uap = v; + int i; int error; struct hpux_utsname ut; - extern char ostype[], hostname[], osrelease[], version[], machine[]; + extern char ostype[], hostname[], osrelease[], version[]; switch (SCARG(uap, request)) { /* uname */ @@ -497,7 +502,7 @@ hpux_sys_ulimit(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_ulimit_args *uap = v; + struct hpux_sys_ulimit_args *uap = v; struct rlimit *limp; int error = 0; @@ -537,7 +542,7 @@ hpux_sys_rtprio(cp, v, retval) void *v; register_t *retval; { - register struct hpux_sys_rtprio_args *uap = v; + struct hpux_sys_rtprio_args *uap = v; struct proc *p; int nice, error; @@ -584,8 +589,11 @@ hpux_sys_ptrace(p, v, retval) register_t *retval; { struct hpux_sys_ptrace_args *uap = v; - int error, isps = 0; + int error; +#if defined(PT_READ_U) || defined(PT_WRITE_U) + int isps = 0; struct proc *cp; +#endif switch (SCARG(uap, req)) { /* map signal */ @@ -662,7 +670,7 @@ hpux_sys_shmctl(p, v, retval) { struct hpux_sys_shmctl_args *uap = v; - return (hpux_shmctl1(p, (struct hpux_shmctl_args *) uap, retval, 0)); + return (hpux_shmctl1(p, (struct hpux_sys_shmctl_args *)uap, retval, 0)); } int @@ -673,7 +681,7 @@ hpux_sys_nshmctl(p, v, retval) { struct hpux_sys_nshmctl_args *uap = v; - return (hpux_shmctl1(p, (struct hpux_shmctl_args *) uap, retval, 1)); + return (hpux_shmctl1(p, (struct hpux_sys_shmctl_args *)uap, retval, 1)); } /* @@ -686,8 +694,8 @@ hpux_shmctl1(p, uap, retval, isnew) register_t *retval; int isnew; { - register struct shmid_ds *shp; - register struct ucred *cred = p->p_ucred; + struct shmid_ds *shp; + struct ucred *cred = p->p_ucred; struct hpux_shmid_ds sbuf; int error; extern struct shmid_ds *shm_find_segment_by_shmid __P((int)); @@ -827,15 +835,15 @@ hpux_sys_ioctl(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_ioctl_args /* { + struct hpux_sys_ioctl_args /* { syscallarg(int) fd; syscallarg(int) com; syscallarg(caddr_t) data; } */ *uap = v; - register struct filedesc *fdp = p->p_fd; - register struct file *fp; - register int com, error; - register u_int size; + struct filedesc *fdp = p->p_fd; + struct file *fp; + int com, error = 0; + u_int size; caddr_t memp = 0; #define STK_PARAMS 128 char stkbuf[STK_PARAMS]; @@ -976,8 +984,8 @@ hpux_sys_getpgrp2(cp, v, retval) void *v; register_t *retval; { - register struct hpux_sys_getpgrp2_args *uap = v; - register struct proc *p; + struct hpux_sys_getpgrp2_args *uap = v; + struct proc *p; if (SCARG(uap, pid) == 0) SCARG(uap, pid) = cp->p_pid; @@ -1083,22 +1091,22 @@ hpux_sys_lockf(p, v, retval) void *v; register_t *retval; { - struct hpux_sys_lockf_args *uap = v; + /* struct hpux_sys_lockf_args *uap = v; */ return (0); } int hpux_sys_getaccess(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { - register struct hpux_sys_getaccess_args *uap = v; + struct hpux_sys_getaccess_args *uap = v; int lgroups[NGROUPS]; int error = 0; - register struct ucred *cred; - register struct vnode *vp; + struct ucred *cred; + struct vnode *vp; struct nameidata nd; /* @@ -1204,7 +1212,7 @@ hpux_sys_getaccess(p, v, retval) */ int hpux_sys_setpgrp_6x(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { @@ -1249,7 +1257,7 @@ hpux_sys_stime_6x(p, v, retval) tv.tv_sec = SCARG(uap, time); tv.tv_usec = 0; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); /* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */ @@ -1282,7 +1290,7 @@ hpux_sys_ftime_6x(p, v, retval) int hpux_sys_alarm_6x(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { @@ -1311,7 +1319,7 @@ hpux_sys_alarm_6x(p, v, retval) int hpux_sys_nice_6x(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { @@ -1359,7 +1367,7 @@ hpux_sys_times_6x(p, v, retval) */ static int hpux_scale(tvp) - register struct timeval *tvp; + struct timeval *tvp; { return (tvp->tv_sec * HPUX_HZ + tvp->tv_usec * HPUX_HZ / 1000000); } @@ -1378,7 +1386,7 @@ hpux_sys_utime_6x(p, v, retval) syscallarg(char *) fname; syscallarg(time_t *) tptr; } */ *uap = v; - register struct vnode *vp; + struct vnode *vp; struct vattr vattr; time_t tv[2]; int error; @@ -1398,7 +1406,7 @@ hpux_sys_utime_6x(p, v, retval) vattr.va_mtime.tv_nsec = 0; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, fname), p); - if (error = namei(&nd)) + if ((error = namei(&nd))) return (error); vp = nd.ni_vp; if (vp->v_mount->mnt_flag & MNT_RDONLY) diff --git a/sys/compat/hpux/hpux_file.c b/sys/compat/hpux/hpux_file.c index edca32dbf3d..4c59f528e43 100644 --- a/sys/compat/hpux/hpux_file.c +++ b/sys/compat/hpux/hpux_file.c @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux_file.c,v 1.4 1997/01/27 00:18:36 downsj Exp $ */ -/* $NetBSD: hpux_file.c,v 1.3 1996/01/06 12:44:14 thorpej Exp $ */ +/* $OpenBSD: hpux_file.c,v 1.5 1997/04/16 09:18:05 downsj Exp $ */ +/* $NetBSD: hpux_file.c,v 1.4 1997/04/01 19:59:01 scottr Exp $ */ /* * Copyright (c) 1995 Jason R. Thorpe. All rights reserved. @@ -83,9 +83,11 @@ #include <compat/hpux/hpux_syscall.h> #include <compat/hpux/hpux_syscallargs.h> -static int hpux_stat1 __P((struct proc *, void *, register_t *, int)); -static void bsd_to_hpux_stat __P((struct stat *, struct hpux_stat *)); -static void bsd_to_hpux_ostat __P((struct stat *, struct hpux_ostat *)); +#include <machine/hpux_machdep.h> + +static int hpux_stat1 __P((struct proc *, void *, register_t *, int)); +static void bsd_to_hpux_stat __P((struct stat *, struct hpux_stat *)); +static void bsd_to_hpux_ostat __P((struct stat *, struct hpux_ostat *)); /* * HP-UX creat(2) system call. @@ -317,7 +319,8 @@ hpux_sys_fcntl(p, v, retval) if (fl.l_whence == SEEK_CUR) fl.l_start += fp->f_offset; - if (error = VOP_ADVLOCK(vp, (caddr_t)p, F_GETLK, &fl, F_POSIX)) + if ((error = + VOP_ADVLOCK(vp, (caddr_t)p, F_GETLK, &fl, F_POSIX))) return (error); hfl.hl_start = fl.l_start; diff --git a/sys/compat/hpux/hpux_net.c b/sys/compat/hpux/hpux_net.c index 3896a05e04c..574f459fec3 100644 --- a/sys/compat/hpux/hpux_net.c +++ b/sys/compat/hpux/hpux_net.c @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux_net.c,v 1.2 1996/08/02 20:34:56 niklas Exp $ */ -/* $NetBSD: hpux_net.c,v 1.12 1995/10/07 06:26:37 mycroft Exp $ */ +/* $OpenBSD: hpux_net.c,v 1.3 1997/04/16 09:18:07 downsj Exp $ */ +/* $NetBSD: hpux_net.c,v 1.14 1997/04/01 19:59:02 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -54,6 +54,7 @@ #include <sys/errno.h> #include <sys/proc.h> #include <sys/file.h> +#include <sys/filedesc.h> #include <sys/mbuf.h> #include <sys/mount.h> #include <sys/socket.h> @@ -88,6 +89,8 @@ struct hpux_sys_getsockopt_args { int hpux_sys_setsockopt __P((struct proc *, void *, register_t *)); int hpux_sys_getsockopt __P((struct proc *, void *, register_t *)); +void socksetsize __P((int, struct mbuf *)); + #define MINBSDIPCCODE 0x3EE #define NUMBSDIPC 32 @@ -98,7 +101,7 @@ int hpux_sys_getsockopt __P((struct proc *, void *, register_t *)); */ struct hpuxtobsdipc { - int (*rout)(); + int (*rout) __P((struct proc *, void *, register_t *)); int nargs; } hpuxtobsdipc[NUMBSDIPC] = { { sys_socket, 3 }, /* 3ee */ @@ -147,7 +150,7 @@ hpux_sys_netioctl(p, v, retval) { struct hpux_sys_netioctl_args *uap = v; int *args, i; - register int code; + int code; int error; args = SCARG(uap, args); @@ -173,12 +176,12 @@ hpux_sys_netioctl(p, v, retval) return ((*hpuxtobsdipc[code].rout)(p, uap, retval)); } -int +void socksetsize(size, m) int size; struct mbuf *m; { - register int tmp; + int tmp; if (size < sizeof(int)) { switch(size) { @@ -189,6 +192,7 @@ socksetsize(size, m) tmp = (int) *mtod(m, short *); break; case 3: + default: /* XXX uh, what if sizeof(int) > 4? */ tmp = (((int) *mtod(m, int *)) >> 8) & 0xffffff; break; } @@ -200,6 +204,7 @@ socksetsize(size, m) } /* ARGSUSED */ +int hpux_sys_setsockopt(p, v, retval) struct proc *p; void *v; @@ -210,7 +215,7 @@ hpux_sys_setsockopt(p, v, retval) struct mbuf *m = NULL; int tmp, error; - if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) + if ((error = getsock(p->p_fd, SCARG(uap, s), &fp))) return (error); if (SCARG(uap, valsize) > MLEN) return (EINVAL); @@ -218,8 +223,8 @@ hpux_sys_setsockopt(p, v, retval) m = m_get(M_WAIT, MT_SOOPTS); if (m == NULL) return (ENOBUFS); - if (error = copyin(SCARG(uap, val), mtod(m, caddr_t), - (u_int)SCARG(uap, valsize))) { + if ((error = copyin(SCARG(uap, val), mtod(m, caddr_t), + (u_int)SCARG(uap, valsize)))) { (void) m_free(m); return (error); } @@ -249,12 +254,12 @@ hpux_sys_setsockopt2(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_setsockopt2_args *uap = v; + struct hpux_sys_setsockopt2_args *uap = v; struct file *fp; struct mbuf *m = NULL; int error; - if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) + if ((error = getsock(p->p_fd, SCARG(uap, s), &fp))) return (error); if (SCARG(uap, valsize) > MLEN) return (EINVAL); @@ -262,8 +267,8 @@ hpux_sys_setsockopt2(p, v, retval) m = m_get(M_WAIT, MT_SOOPTS); if (m == NULL) return (ENOBUFS); - if (error = copyin(SCARG(uap, val), mtod(m, caddr_t), - (u_int)SCARG(uap, valsize))) { + if ((error = copyin(SCARG(uap, val), mtod(m, caddr_t), + (u_int)SCARG(uap, valsize)))) { (void) m_free(m); return (error); } @@ -284,16 +289,16 @@ hpux_sys_getsockopt(p, v, retval) struct mbuf *m = NULL; int valsize, error; - if (error = getsock(p->p_fd, SCARG(uap, s), &fp)) + if ((error = getsock(p->p_fd, SCARG(uap, s), &fp))) return (error); if (SCARG(uap, val)) { - if (error = copyin((caddr_t)SCARG(uap, avalsize), - (caddr_t)&valsize, sizeof (valsize))) + if ((error = copyin((caddr_t)SCARG(uap, avalsize), + (caddr_t)&valsize, sizeof (valsize)))) return (error); } else valsize = 0; - if (error = sogetopt((struct socket *)fp->f_data, SCARG(uap, level), - SCARG(uap, name), &m)) + if ((error = sogetopt((struct socket *)fp->f_data, SCARG(uap, level), + SCARG(uap, name), &m))) goto bad; if (SCARG(uap, val) && valsize && m != NULL) { if (SCARG(uap, name) == SO_LINGER) { diff --git a/sys/compat/hpux/hpux_sig.c b/sys/compat/hpux/hpux_sig.c index 565bda747da..8bb6589a4c6 100644 --- a/sys/compat/hpux/hpux_sig.c +++ b/sys/compat/hpux/hpux_sig.c @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux_sig.c,v 1.3 1996/08/02 20:34:56 niklas Exp $ */ -/* $NetBSD: hpux_sig.c,v 1.15 1995/11/28 08:39:50 thorpej Exp $ */ +/* $OpenBSD: hpux_sig.c,v 1.4 1997/04/16 09:18:09 downsj Exp $ */ +/* $NetBSD: hpux_sig.c,v 1.16 1997/04/01 19:59:02 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,10 +50,13 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/mount.h> #include <sys/proc.h> #include <sys/signalvar.h> +#include <sys/syscallargs.h> #include <compat/hpux/hpux.h> +#include <compat/hpux/hpux_sig.h> #include <compat/hpux/hpux_syscallargs.h> /* indexed by HPUX signal number - 1 */ @@ -87,11 +90,11 @@ hpux_sys_sigvec(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_sigvec_args *uap = v; + struct hpux_sys_sigvec_args *uap = v; struct sigvec vec; - register struct sigacts *ps = p->p_sigacts; - register struct sigvec *sv; - register int sig; + struct sigacts *ps = p->p_sigacts; + struct sigvec *sv; + int sig; int bit, error; sig = hpuxtobsdsig(SCARG(uap, signo)); @@ -135,7 +138,7 @@ hpux_sys_sigvec(p, v, retval) int hpux_sys_sigblock(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { @@ -206,7 +209,7 @@ hpux_sys_kill(p, v, retval) */ int hpux_sys_sigprocmask(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { @@ -252,7 +255,7 @@ hpux_sys_sigprocmask(p, v, retval) int hpux_sys_sigpending(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { @@ -266,12 +269,12 @@ hpux_sys_sigpending(p, v, retval) int hpux_sys_sigsuspend(p, v, retval) - register struct proc *p; + struct proc *p; void *v; register_t *retval; { struct hpux_sys_sigsuspend_args *uap = v; - register struct sigacts *ps = p->p_sigacts; + struct sigacts *ps = p->p_sigacts; hpux_sigset_t sigset; int mask; @@ -292,11 +295,11 @@ hpux_sys_sigaction(p, v, retval) void *v; register_t *retval; { - register struct hpux_sys_sigaction_args *uap = v; + struct hpux_sys_sigaction_args *uap = v; struct hpux_sigaction action; - register struct sigacts *ps = p->p_sigacts; - register struct hpux_sigaction *sa; - register int sig; + struct sigacts *ps = p->p_sigacts; + struct hpux_sigaction *sa; + int sig; int bit; sig = hpuxtobsdsig(SCARG(uap, signo)); @@ -333,7 +336,7 @@ hpux_sys_sigaction(p, v, retval) */ act.sa_handler = sa->sa_handler; act.sa_mask = hpuxtobsdmask(sa->sa_mask.sigset[0]); - act.sa_flags == SA_RESTART; + act.sa_flags = SA_RESTART; if (sa->sa_flags & HPUXSA_ONSTACK) act.sa_flags |= SA_ONSTACK; if (sa->sa_flags & HPUXSA_NOCLDSTOP) @@ -358,9 +361,9 @@ hpux_sys_ssig_6x(p, v, retval) syscallarg(int) signo; syscallarg(sig_t) fun; } */ *uap = v; - register int a; + int a; struct sigaction vec; - register struct sigaction *sa = &vec; + struct sigaction *sa = &vec; a = hpuxtobsdsig(SCARG(uap, signo)); sa->sa_handler = SCARG(uap, fun); @@ -375,7 +378,7 @@ hpux_sys_ssig_6x(p, v, retval) return (0); } if (a <= 0 || a >= NSIG || a == SIGKILL || a == SIGSTOP || - a == SIGCONT && sa->sa_handler == SIG_IGN) + (a == SIGCONT && sa->sa_handler == SIG_IGN)) return (EINVAL); sa->sa_mask = 0; sa->sa_flags = 0; @@ -390,7 +393,7 @@ hpux_sys_ssig_6x(p, v, retval) /* signal numbers: convert from HPUX to BSD */ int hpuxtobsdsig(sig) - register int sig; + int sig; { if (--sig < 0 || sig >= NSIG) return(0); @@ -400,7 +403,7 @@ hpuxtobsdsig(sig) /* signal numbers: convert from BSD to HPUX */ int bsdtohpuxsig(sig) - register int sig; + int sig; { if (--sig < 0 || sig >= NSIG) return(0); @@ -410,9 +413,9 @@ bsdtohpuxsig(sig) /* signal masks: convert from HPUX to BSD (not pretty or fast) */ int hpuxtobsdmask(mask) - register int mask; + int mask; { - register int nmask, sig, nsig; + int nmask, sig, nsig; if (mask == 0 || mask == -1) return(mask); @@ -425,9 +428,9 @@ hpuxtobsdmask(mask) int bsdtohpuxmask(mask) - register int mask; + int mask; { - register int nmask, sig, nsig; + int nmask, sig, nsig; if (mask == 0 || mask == -1) return(mask); diff --git a/sys/compat/hpux/hpux_sig.h b/sys/compat/hpux/hpux_sig.h new file mode 100644 index 00000000000..dce3d1a428d --- /dev/null +++ b/sys/compat/hpux/hpux_sig.h @@ -0,0 +1,55 @@ +/* $OpenBSD: hpux_sig.h,v 1.1 1997/04/16 09:18:11 downsj Exp $ */ +/* $NetBSD: hpux_sig.h,v 1.1 1997/04/01 19:59:03 scottr Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Derived from: Utah $Hdr: hpux_sig.c 1.4 92/01/20$ + * + * @(#)hpux_sig.c 8.2 (Berkeley) 9/23/93 + */ + +/* + * Signal-related HPUX compatibility routines + */ + +#ifdef _KERNEL +int hpuxtobsdsig __P((int)); +int bsdtohpuxsig __P((int)); +int hpuxtobsdmask __P((int)); +int bsdtohpuxmask __P((int)); +#endif /* _KERNEL */ diff --git a/sys/compat/hpux/hpux_termio.h b/sys/compat/hpux/hpux_termio.h index d659cd5c85f..23fae62e7ae 100644 --- a/sys/compat/hpux/hpux_termio.h +++ b/sys/compat/hpux/hpux_termio.h @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux_termio.h,v 1.2 1996/08/02 20:34:59 niklas Exp $ */ -/* $NetBSD: hpux_termio.h,v 1.6 1994/10/26 02:45:20 cgd Exp $ */ +/* $OpenBSD: hpux_termio.h,v 1.3 1997/04/16 09:18:14 downsj Exp $ */ +/* $NetBSD: hpux_termio.h,v 1.7 1997/04/01 19:59:04 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -191,3 +191,16 @@ struct hpux_termios { #define HPUXTCSETATTR _IOW('T', 17, struct hpux_termios) #define HPUXTCSETATTRD _IOW('T', 18, struct hpux_termios) #define HPUXTCSETATTRF _IOW('T', 19, struct hpux_termios) + +#ifdef _KERNEL +struct termio; +struct termios; + +int hpux_termio __P((int, int, caddr_t, struct proc *)); +void termiototermios __P((struct hpux_termio *, struct hpux_termios *, + struct termios *)); +void termiostotermio __P((struct hpux_termios *, struct hpux_termio *)); +int bsdtohpuxbaud __P((long)); +int hpuxtobsdbaud __P((int)); +int getsettty __P((struct proc *, int, int, caddr_t)); +#endif /* _KERNEL */ diff --git a/sys/compat/hpux/hpux_tty.c b/sys/compat/hpux/hpux_tty.c index 47f07bd68cf..29f723af781 100644 --- a/sys/compat/hpux/hpux_tty.c +++ b/sys/compat/hpux/hpux_tty.c @@ -1,5 +1,5 @@ -/* $OpenBSD: hpux_tty.c,v 1.3 1996/08/02 20:35:00 niklas Exp $ */ -/* $NetBSD: hpux_tty.c,v 1.13 1995/12/11 16:32:46 thorpej Exp $ */ +/* $OpenBSD: hpux_tty.c,v 1.4 1997/04/16 09:18:17 downsj Exp $ */ +/* $NetBSD: hpux_tty.c,v 1.14 1997/04/01 19:59:05 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -78,8 +78,11 @@ hpux_termio(fd, com, data, p) struct file *fp; struct termios tios; struct hpux_termios htios; - int line, error, (*ioctlrout)(); + int line, error; int newi = 0; + int (*ioctlrout) __P((struct file *fp, u_long com, + caddr_t data, struct proc *p)); + fp = p->p_fd->fd_ofiles[fd]; ioctlrout = fp->f_ops->fo_ioctl; @@ -91,7 +94,7 @@ hpux_termio(fd, com, data, p) /* * Get BSD terminal state */ - if (error = (*ioctlrout)(fp, TIOCGETA, (caddr_t)&tios, p)) + if ((error = (*ioctlrout)(fp, TIOCGETA, (caddr_t)&tios, p))) break; bzero((char *)&htios, sizeof htios); /* @@ -219,12 +222,13 @@ hpux_termio(fd, com, data, p) /* * Get old characteristics and determine if we are a tty. */ - if (error = (*ioctlrout)(fp, TIOCGETA, (caddr_t)&tios, p)) + if ((error = (*ioctlrout)(fp, TIOCGETA, (caddr_t)&tios, p))) break; if (newi) bcopy(data, (char *)&htios, sizeof htios); else - termiototermios((struct termio *)data, &htios, &tios); + termiototermios((struct hpux_termio *)data, + &htios, &tios); /* * Set iflag. * Same through ICRNL, no HP-UX equiv for IMAXBEL @@ -351,8 +355,8 @@ hpux_termio(fd, com, data, p) nbio = (htios.c_cc[HPUXVMINS] == 0 && htios.c_cc[HPUXVTIMES] == 0); - if (nbio && (fp->f_flag & FNONBLOCK) == 0 || - !nbio && (fp->f_flag & FNONBLOCK)) { + if ((nbio && (fp->f_flag & FNONBLOCK) == 0) || + (!nbio && (fp->f_flag & FNONBLOCK))) { args.fdes = fd; args.cmd = F_GETFL; args.arg = 0; @@ -376,7 +380,7 @@ hpux_termio(fd, com, data, p) return(error); } -int +void termiototermios(tio, tios, bsdtios) struct hpux_termio *tio; struct hpux_termios *tios; @@ -408,7 +412,7 @@ termiototermios(tio, tios, bsdtios) tios->c_cc[HPUXVSTOP] = bsdtios->c_cc[VSTOP]; } -int +void termiostotermio(tios, tio) struct hpux_termios *tios; struct hpux_termio *tio; @@ -508,8 +512,8 @@ getsettty(p, fdes, com, cmarg) int fdes, com; caddr_t cmarg; { - register struct filedesc *fdp = p->p_fd; - register struct file *fp; + struct filedesc *fdp = p->p_fd; + struct file *fp; struct hpux_sgttyb hsb; struct sgttyb sb; int error; @@ -520,7 +524,7 @@ getsettty(p, fdes, com, cmarg) if ((fp->f_flag & (FREAD|FWRITE)) == 0) return (EBADF); if (com == HPUXTIOCSETP) { - if (error = copyin(cmarg, (caddr_t)&hsb, sizeof hsb)) + if ((error = copyin(cmarg, (caddr_t)&hsb, sizeof hsb))) return (error); sb.sg_ispeed = hsb.sg_ispeed; sb.sg_ospeed = hsb.sg_ospeed; |