-/* $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.
/* 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;
};
-/* $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.
#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>
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.
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);
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);
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;
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] =
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 */
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;
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;
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 */
{
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
{
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));
}
/*
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));
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];
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;
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;
/*
*/
int
hpux_sys_setpgrp_6x(p, v, retval)
- register struct proc *p;
+ struct proc *p;
void *v;
register_t *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??? */
int
hpux_sys_alarm_6x(p, v, retval)
- register struct proc *p;
+ struct proc *p;
void *v;
register_t *retval;
{
int
hpux_sys_nice_6x(p, v, retval)
- register struct proc *p;
+ struct proc *p;
void *v;
register_t *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);
}
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;
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)
-/* $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.
#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.
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;
-/* $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.
#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>
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
*/
struct hpuxtobsdipc {
- int (*rout)();
+ int (*rout) __P((struct proc *, void *, register_t *));
int nargs;
} hpuxtobsdipc[NUMBSDIPC] = {
{ sys_socket, 3 }, /* 3ee */
{
struct hpux_sys_netioctl_args *uap = v;
int *args, i;
- register int code;
+ int code;
int error;
args = SCARG(uap, args);
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) {
tmp = (int) *mtod(m, short *);
break;
case 3:
+ default: /* XXX uh, what if sizeof(int) > 4? */
tmp = (((int) *mtod(m, int *)) >> 8) & 0xffffff;
break;
}
}
/* ARGSUSED */
+int
hpux_sys_setsockopt(p, v, retval)
struct proc *p;
void *v;
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);
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);
}
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);
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);
}
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) {
-/* $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.
#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 */
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));
int
hpux_sys_sigblock(p, v, retval)
- register struct proc *p;
+ struct proc *p;
void *v;
register_t *retval;
{
*/
int
hpux_sys_sigprocmask(p, v, retval)
- register struct proc *p;
+ struct proc *p;
void *v;
register_t *retval;
{
int
hpux_sys_sigpending(p, v, retval)
- register struct proc *p;
+ struct proc *p;
void *v;
register_t *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;
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));
*/
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)
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);
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;
/* signal numbers: convert from HPUX to BSD */
int
hpuxtobsdsig(sig)
- register int sig;
+ int sig;
{
if (--sig < 0 || sig >= NSIG)
return(0);
/* signal numbers: convert from BSD to HPUX */
int
bsdtohpuxsig(sig)
- register int sig;
+ int sig;
{
if (--sig < 0 || sig >= NSIG)
return(0);
/* 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);
int
bsdtohpuxmask(mask)
- register int mask;
+ int mask;
{
- register int nmask, sig, nsig;
+ int nmask, sig, nsig;
if (mask == 0 || mask == -1)
return(mask);
--- /dev/null
+/* $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 */
-/* $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.
#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 */
-/* $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.
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;
/*
* 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);
/*
/*
* 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
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;
return(error);
}
-int
+void
termiototermios(tio, tios, bsdtios)
struct hpux_termio *tio;
struct hpux_termios *tios;
tios->c_cc[HPUXVSTOP] = bsdtios->c_cc[VSTOP];
}
-int
+void
termiostotermio(tios, tio)
struct hpux_termios *tios;
struct hpux_termio *tio;
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;
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;