summaryrefslogtreecommitdiff
path: root/sys/compat/hpux
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 04:47:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 04:47:45 +0000
commit9043b73586e8eff30f33a97a5b1802f1032c3288 (patch)
tree5238a6096e950295682af33b86d1ed58fe4b596e /sys/compat/hpux
parentdd79441110b3311ff76301f49a0a640d84ead876 (diff)
update from netbsd
Diffstat (limited to 'sys/compat/hpux')
-rw-r--r--sys/compat/hpux/files.hpux4
-rw-r--r--sys/compat/hpux/hpux.h62
-rw-r--r--sys/compat/hpux/hpux_compat.c567
-rw-r--r--sys/compat/hpux/hpux_exec.c343
-rw-r--r--sys/compat/hpux/hpux_exec.h76
-rw-r--r--sys/compat/hpux/hpux_file.c892
-rw-r--r--sys/compat/hpux/hpux_sig.c11
-rw-r--r--sys/compat/hpux/hpux_syscall.h30
-rw-r--r--sys/compat/hpux/hpux_syscallargs.h138
-rw-r--r--sys/compat/hpux/hpux_syscalls.c30
-rw-r--r--sys/compat/hpux/hpux_sysent.c111
-rw-r--r--sys/compat/hpux/hpux_tty.c21
-rw-r--r--sys/compat/hpux/hpux_util.h10
-rw-r--r--sys/compat/hpux/syscalls.conf4
-rw-r--r--sys/compat/hpux/syscalls.master58
15 files changed, 1657 insertions, 700 deletions
diff --git a/sys/compat/hpux/files.hpux b/sys/compat/hpux/files.hpux
index a95e7509382..ef39e01b8a3 100644
--- a/sys/compat/hpux/files.hpux
+++ b/sys/compat/hpux/files.hpux
@@ -1,4 +1,4 @@
-# $NetBSD: files.hpux,v 1.1 1995/05/10 16:45:27 christos Exp $
+# $NetBSD: files.hpux,v 1.2 1995/11/28 08:39:52 thorpej Exp $
#
# Config.new file description for machine-independent HPUX compat code.
# Included by ports that need it.
@@ -7,6 +7,8 @@
# own file lists.
file compat/hpux/hpux_compat.c compat_hpux
+file compat/hpux/hpux_file.c compat_hpux
+file compat/hpux/hpux_exec.c compat_hpux
file compat/hpux/hpux_net.c compat_hpux
file compat/hpux/hpux_sig.c compat_hpux
file compat/hpux/hpux_syscalls.c compat_hpux
diff --git a/sys/compat/hpux/hpux.h b/sys/compat/hpux/hpux.h
index b4ec592f366..f5d7a67f99c 100644
--- a/sys/compat/hpux/hpux.h
+++ b/sys/compat/hpux/hpux.h
@@ -1,6 +1,7 @@
-/* $NetBSD: hpux.h,v 1.8 1995/05/10 16:45:29 christos Exp $ */
+/* $NetBSD: hpux.h,v 1.10 1995/12/08 07:54:43 thorpej Exp $ */
/*
+ * Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -95,28 +96,40 @@ struct hpux_sgttyb {
#define bsdtohpuxdev(d) ((major(d) << 24) | minor(d))
struct hpux_stat {
- long hst_dev;
- u_long hst_ino;
- u_short hst_mode;
- short hst_nlink;
- u_short hst_uid;
- u_short hst_gid;
- long hst_rdev;
- long hst_size;
- time_t hst_atime;
- int hst_spare1;
- time_t hst_mtime;
- int hst_spare2;
- time_t hst_ctime;
- int hst_spare3;
- long hst_blksize;
- long hst_blocks;
- u_int hst_remote;
- long hst_netdev;
- u_long hst_netino;
- long hst_spare4[9];
+ long hst_dev;
+ u_long hst_ino;
+ u_short hst_mode;
+ short hst_nlink;
+ u_short hst_old_uid; /* these have since moved */
+ u_short hst_old_gid; /* ... */
+ long hst_rdev;
+ long hst_size;
+ long hst_atime;
+ int hst_spare1;
+ long hst_mtime;
+ int hst_spare2;
+ long hst_ctime;
+ int hst_spare3;
+ long hst_blksize;
+ long hst_blocks;
+ u_int hst_remote;
+ long hst_netdev;
+ u_long hst_netino;
+ u_short hst_cnode;
+ u_short hst_rcnode;
+ u_short hst_netsite;
+ short hst_fstype;
+ long hst_realdev;
+ u_short hst_basemode;
+ u_short hst_spareshort1;
+ long hst_uid;
+ long hst_gid;
+ long hst_spare4[3];
};
+#define HST_REMOTE_REMOTE 0x01 /* set if file is remote */
+#define HST_REMOTE_ACL 0x02 /* set if file has ACL entries */
+
/* from old timeb.h */
struct hpux_otimeb {
time_t time;
@@ -308,3 +321,10 @@ struct hpux_sigaction {
* code to the HP-UX EAGAIN value.
*/
#define OEAGAIN 82
+
+/*
+ * Extensions to the fd_ofileflags flags.
+ */
+#define HPUX_UF_NONBLOCK_ON 0x10
+#define HPUX_UF_FNDELAY_ON 0x20
+#define HPUX_UF_FIONBIO_ON 0x40
diff --git a/sys/compat/hpux/hpux_compat.c b/sys/compat/hpux/hpux_compat.c
index bc127ad804c..8ec3ddde6b7 100644
--- a/sys/compat/hpux/hpux_compat.c
+++ b/sys/compat/hpux/hpux_compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpux_compat.c,v 1.19 1995/10/07 06:26:34 mycroft Exp $ */
+/* $NetBSD: hpux_compat.c,v 1.22 1995/12/09 04:05:52 mycroft Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -121,20 +121,7 @@ extern char sigcode[], esigcode[];
extern struct sysent hpux_sysent[];
extern char *hpux_syscallnames[];
-struct emul emul_hpux = {
- "hpux",
- bsdtohpuxerrnomap,
- sendsig,
- HPUX_SYS_syscall,
- HPUX_SYS_MAXSYSCALL,
- hpux_sysent,
- hpux_syscallnames,
- 0,
- copyargs,
- setregs,
- sigcode,
- esigcode,
-};
+static int hpux_scale __P((struct timeval *));
/*
* HP-UX fork and vfork need to map the EAGAIN return value appropriately.
@@ -148,7 +135,7 @@ hpux_sys_fork(p, v, retval)
struct hpux_sys_fork_args *uap = v;
int error;
- error = sys_fork(p, (struct fork_args *) uap, retval);
+ error = sys_fork(p, v, retval);
if (error == EAGAIN)
error = OEAGAIN;
return (error);
@@ -163,28 +150,12 @@ hpux_sys_vfork(p, v, retval)
struct hpux_sys_vfork_args *uap = v;
int error;
- error = sys_vfork(p, (struct vfork_args *) uap, retval);
+ error = sys_vfork(p, v, retval);
if (error == EAGAIN)
error = OEAGAIN;
return (error);
}
-int
-hpux_sys_execv(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct hpux_sys_execv_args *uap = v;
- struct sys_execve_args ap;
-
- SCARG(&ap, path) = SCARG(uap, path);
- SCARG(&ap, argp) = SCARG(uap, argp);
- SCARG(&ap, envp) = NULL;
-
- return sys_execve(p, &ap, retval);
-}
-
/*
* HP-UX versions of wait and wait3 actually pass the parameters
* (status pointer, options, rusage) into the kernel rather than
@@ -306,209 +277,6 @@ hpux_sys_waitpid(p, v, retval)
}
/*
- * Old creat system call.
- */
-int
-hpux_sys_creat(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct hpux_sys_creat_args *uap = v;
- struct sys_open_args oap;
-
- SCARG(&oap, path) = SCARG(uap, path);
- SCARG(&oap, flags) = O_WRONLY | O_CREAT | O_TRUNC;
- SCARG(&oap, mode) = SCARG(uap, mode);
-
- return sys_open(p, &oap, retval);
-}
-
-/*
- * XXX extensions to the fd_ofileflags flags.
- * Hate to put this there, but they do need to be per-file.
- */
-#define UF_NONBLOCK_ON 0x10
-#define UF_FNDELAY_ON 0x20
-#define UF_FIONBIO_ON 0x40
-
-/*
- * Must remap some bits in the mode mask.
- * O_CREAT, O_TRUNC, and O_EXCL must be remapped,
- * O_NONBLOCK is remapped and remembered,
- * O_FNDELAY is remembered,
- * O_SYNCIO is removed entirely.
- */
-int
-hpux_sys_open(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct hpux_sys_open_args *uap = v;
- int mode, error;
-
- mode = SCARG(uap, mode);
- SCARG(uap, mode) &=
- ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFEXCL|HPUXFTRUNC|HPUXFCREAT);
- if (mode & HPUXFCREAT) {
- /*
- * simulate the pre-NFS behavior that opening a
- * file for READ+CREATE ignores the CREATE (unless
- * EXCL is set in which case we will return the
- * proper error).
- */
- if ((mode & HPUXFEXCL) || (FFLAGS(mode) & FWRITE))
- SCARG(uap, mode) |= O_CREAT;
- }
- if (mode & HPUXFTRUNC)
- SCARG(uap, mode) |= O_TRUNC;
- if (mode & HPUXFEXCL)
- SCARG(uap, mode) |= O_EXCL;
- if (mode & HPUXNONBLOCK)
- SCARG(uap, mode) |= O_NDELAY;
- error = sys_open(p, (struct open_args *) uap, retval);
- /*
- * Record non-blocking mode for fcntl, read, write, etc.
- */
- if (error == 0 && (SCARG(uap, mode) & O_NDELAY))
- p->p_fd->fd_ofileflags[*retval] |=
- (mode & HPUXNONBLOCK) ? UF_NONBLOCK_ON : UF_FNDELAY_ON;
- return (error);
-}
-
-int
-hpux_sys_fcntl(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct hpux_sys_fcntl_args *uap = v;
- int mode, error, flg = F_POSIX;
- struct file *fp;
- char *pop;
- struct hpux_flock hfl;
- struct flock fl;
- struct vnode *vp;
-
- if ((unsigned)SCARG(uap, fd) >= p->p_fd->fd_nfiles ||
- (fp = p->p_fd->fd_ofiles[SCARG(uap, fd)]) == NULL)
- return (EBADF);
- pop = &p->p_fd->fd_ofileflags[SCARG(uap, fd)];
- switch (SCARG(uap, cmd)) {
- case F_SETFL:
- if (SCARG(uap, arg) & HPUXNONBLOCK)
- *pop |= UF_NONBLOCK_ON;
- else
- *pop &= ~UF_NONBLOCK_ON;
- if (SCARG(uap, arg) & HPUXNDELAY)
- *pop |= UF_FNDELAY_ON;
- else
- *pop &= ~UF_FNDELAY_ON;
- if (*pop & (UF_NONBLOCK_ON|UF_FNDELAY_ON|UF_FIONBIO_ON))
- SCARG(uap, arg) |= FNONBLOCK;
- else
- SCARG(uap, arg) &= ~FNONBLOCK;
- SCARG(uap, arg) &= ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFREMOTE);
- break;
- case F_GETFL:
- case F_DUPFD:
- case F_GETFD:
- case F_SETFD:
- break;
-
- case HPUXF_SETLKW:
- flg |= F_WAIT;
- /* Fall into F_SETLK */
-
- case HPUXF_SETLK:
- if (fp->f_type != DTYPE_VNODE)
- return (EBADF);
- vp = (struct vnode *)fp->f_data;
- /* Copy in the lock structure */
- error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&hfl,
- sizeof (hfl));
- if (error)
- return (error);
- fl.l_start = hfl.hl_start;
- fl.l_len = hfl.hl_len;
- fl.l_pid = hfl.hl_pid;
- fl.l_type = hfl.hl_type;
- fl.l_whence = hfl.hl_whence;
- if (fl.l_whence == SEEK_CUR)
- fl.l_start += fp->f_offset;
- switch (fl.l_type) {
-
- case F_RDLCK:
- if ((fp->f_flag & FREAD) == 0)
- return (EBADF);
- p->p_flag |= P_ADVLOCK;
- return (VOP_ADVLOCK(vp, (caddr_t)p, F_SETLK, &fl, flg));
-
- case F_WRLCK:
- if ((fp->f_flag & FWRITE) == 0)
- return (EBADF);
- p->p_flag |= P_ADVLOCK;
- return (VOP_ADVLOCK(vp, (caddr_t)p, F_SETLK, &fl, flg));
-
- case F_UNLCK:
- return (VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &fl,
- F_POSIX));
-
- default:
- return (EINVAL);
- }
-
- case F_GETLK:
- if (fp->f_type != DTYPE_VNODE)
- return (EBADF);
- vp = (struct vnode *)fp->f_data;
- /* Copy in the lock structure */
- error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&hfl,
- sizeof (hfl));
- if (error)
- return (error);
- fl.l_start = hfl.hl_start;
- fl.l_len = hfl.hl_len;
- fl.l_pid = hfl.hl_pid;
- fl.l_type = hfl.hl_type;
- fl.l_whence = hfl.hl_whence;
- 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))
- return (error);
- hfl.hl_start = fl.l_start;
- hfl.hl_len = fl.l_len;
- hfl.hl_pid = fl.l_pid;
- hfl.hl_type = fl.l_type;
- hfl.hl_whence = fl.l_whence;
- return (copyout((caddr_t)&hfl, (caddr_t)SCARG(uap, arg),
- sizeof (hfl)));
-
- default:
- return (EINVAL);
- }
- error = sys_fcntl(p, uap, retval);
- if (error == 0 && SCARG(uap, cmd) == F_GETFL) {
- mode = *retval;
- *retval &= ~(O_CREAT|O_TRUNC|O_EXCL);
- if (mode & FNONBLOCK) {
- if (*pop & UF_NONBLOCK_ON)
- *retval |= HPUXNONBLOCK;
- if ((*pop & UF_FNDELAY_ON) == 0)
- *retval &= ~HPUXNDELAY;
- }
- if (mode & O_CREAT)
- *retval |= HPUXFCREAT;
- if (mode & O_TRUNC)
- *retval |= HPUXFTRUNC;
- if (mode & O_EXCL)
- *retval |= HPUXFEXCL;
- }
- return (error);
-}
-
-/*
* Read and write calls. Same as BSD except for non-blocking behavior.
* There are three types of non-blocking reads/writes in HP-UX checked
* in the following order:
@@ -530,10 +298,10 @@ hpux_sys_read(p, v, retval)
if (error == EWOULDBLOCK) {
char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)];
- if (*fp & UF_NONBLOCK_ON) {
+ if (*fp & HPUX_UF_NONBLOCK_ON) {
*retval = -1;
error = OEAGAIN;
- } else if (*fp & UF_FNDELAY_ON) {
+ } else if (*fp & HPUX_UF_FNDELAY_ON) {
*retval = 0;
error = 0;
}
@@ -554,10 +322,10 @@ hpux_sys_write(p, v, retval)
if (error == EWOULDBLOCK) {
char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)];
- if (*fp & UF_NONBLOCK_ON) {
+ if (*fp & HPUX_UF_NONBLOCK_ON) {
*retval = -1;
error = OEAGAIN;
- } else if (*fp & UF_FNDELAY_ON) {
+ } else if (*fp & HPUX_UF_FNDELAY_ON) {
*retval = 0;
error = 0;
}
@@ -578,10 +346,10 @@ hpux_sys_readv(p, v, retval)
if (error == EWOULDBLOCK) {
char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)];
- if (*fp & UF_NONBLOCK_ON) {
+ if (*fp & HPUX_UF_NONBLOCK_ON) {
*retval = -1;
error = OEAGAIN;
- } else if (*fp & UF_FNDELAY_ON) {
+ } else if (*fp & HPUX_UF_FNDELAY_ON) {
*retval = 0;
error = 0;
}
@@ -602,10 +370,10 @@ hpux_sys_writev(p, v, retval)
if (error == EWOULDBLOCK) {
char *fp = &p->p_fd->fd_ofileflags[SCARG(uap, fd)];
- if (*fp & UF_NONBLOCK_ON) {
+ if (*fp & HPUX_UF_NONBLOCK_ON) {
*retval = -1;
error = OEAGAIN;
- } else if (*fp & UF_FNDELAY_ON) {
+ } else if (*fp & HPUX_UF_FNDELAY_ON) {
*retval = 0;
error = 0;
}
@@ -798,64 +566,6 @@ hpux_sys_sysconf(p, v, retval)
}
int
-hpux_sys_stat(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct hpux_sys_stat_args *uap = v;
-
- return (hpux_stat1(SCARG(uap, path), SCARG(uap, sb), FOLLOW, p));
-}
-
-int
-hpux_sys_lstat(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct hpux_sys_lstat_args *uap = v;
-
- return (hpux_stat1(SCARG(uap, path), SCARG(uap, sb), NOFOLLOW, p));
-}
-
-int
-hpux_sys_fstat(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct hpux_sys_fstat_args *uap = v;
- register struct filedesc *fdp = p->p_fd;
- register struct file *fp;
- struct stat sb;
- int error;
-
- if (((unsigned)SCARG(uap, fd)) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL)
- return (EBADF);
-
- switch (fp->f_type) {
-
- case DTYPE_VNODE:
- error = vn_stat((struct vnode *)fp->f_data, &sb, p);
- break;
-
- case DTYPE_SOCKET:
- error = soo_stat((struct socket *)fp->f_data, &sb, p);
- break;
-
- default:
- panic("fstat");
- /*NOTREACHED*/
- }
- /* is this right for sockets?? */
- if (error == 0)
- error = bsdtohpuxstat(&sb, SCARG(uap, sb));
- return (error);
-}
-
-int
hpux_sys_ulimit(p, v, retval)
struct proc *p;
void *v;
@@ -1179,81 +889,6 @@ hpux_sys_mmap(p, v, retval)
return (sys_mmap(p, &nargs, retval));
}
-hpux_stat1(fname, hsb, follow, p)
- char *fname;
- struct hpux_stat *hsb;
- int follow;
- struct proc *p;
-{
- int error;
- struct stat sb;
- struct nameidata nd;
-
- NDINIT(&nd, LOOKUP, follow | LOCKLEAF, UIO_USERSPACE, fname, p);
- if (error = namei(&nd))
- return (error);
- error = vn_stat(nd.ni_vp, &sb, p);
- vput(nd.ni_vp);
- if (error == 0)
- error = bsdtohpuxstat(&sb, hsb);
- return (error);
-}
-
-#ifdef hp300
-#include "grf.h"
-#define NHIL 1 /* XXX */
-#endif
-
-#if NGRF > 0
-extern int grfopen __P((dev_t dev, int oflags, int devtype, struct proc *p));
-#endif
-
-#if NHIL > 0
-extern int hilopen __P((dev_t dev, int oflags, int devtype, struct proc *p));
-#endif
-
-#include <sys/conf.h>
-
-int
-bsdtohpuxstat(sb, hsb)
- struct stat *sb;
- struct hpux_stat *hsb;
-{
- struct hpux_stat ds;
-
- bzero((caddr_t)&ds, sizeof(ds));
- ds.hst_dev = (u_short)sb->st_dev;
- ds.hst_ino = (u_long)sb->st_ino;
- ds.hst_mode = sb->st_mode;
- ds.hst_nlink = sb->st_nlink;
- ds.hst_uid = (u_short)sb->st_uid;
- ds.hst_gid = (u_short)sb->st_gid;
- ds.hst_rdev = bsdtohpuxdev(sb->st_rdev);
-
- /* XXX: I don't want to talk about it... */
- if ((sb->st_mode & S_IFMT) == S_IFCHR)
-#if NGRF > 0
- if (cdevsw[major(sb->st_rdev)].d_open == grfopen)
- ds.hst_rdev = grfdevno(sb->st_rdev);
- else
-#endif
-#if NHIL > 0
- if (cdevsw[major(sb->st_rdev)].d_open == hilopen)
- ds.hst_rdev = hildevno(sb->st_rdev);
-#endif
-
- if (sb->st_size < (quad_t)1 << 32)
- ds.hst_size = (long)sb->st_size;
- else
- ds.hst_size = -2;
- ds.hst_atime = sb->st_atime;
- ds.hst_mtime = sb->st_mtime;
- ds.hst_ctime = sb->st_ctime;
- ds.hst_blksize = sb->st_blksize;
- ds.hst_blocks = sb->st_blocks;
- return(copyout((caddr_t)&ds, (caddr_t)hsb, sizeof(ds)));
-}
-
int
hpuxtobsdioctl(com)
u_long com;
@@ -1358,14 +993,14 @@ hpux_sys_ioctl(p, v, retval)
int tmp;
if (*(int *)dt)
- *ofp |= UF_FIONBIO_ON;
+ *ofp |= HPUX_UF_FIONBIO_ON;
else
- *ofp &= ~UF_FIONBIO_ON;
+ *ofp &= ~HPUX_UF_FIONBIO_ON;
/*
* Only set/clear if O_NONBLOCK/FNDELAY not in effect
*/
- if ((*ofp & (UF_NONBLOCK_ON|UF_FNDELAY_ON)) == 0) {
- tmp = *ofp & UF_FIONBIO_ON;
+ if ((*ofp & (HPUX_UF_NONBLOCK_ON|HPUX_UF_FNDELAY_ON)) == 0) {
+ tmp = *ofp & HPUX_UF_FIONBIO_ON;
error = (*fp->f_ops->fo_ioctl)(fp, FIONBIO,
(caddr_t)&tmp, p);
}
@@ -1690,7 +1325,6 @@ hpux_sys_getaccess(p, v, retval)
/*
* XXX: This needs to be in hpux_machdep.c !!
*/
-extern char kstack[];
#define UOFF(f) ((int)&((struct user *)0)->f)
#define HPUOFF(f) ((int)&((struct hpux_user *)0)->f)
@@ -1703,7 +1337,10 @@ struct bsdfp {
/*
* Brutal hack! Map HP-UX u-area offsets into BSD k-stack offsets.
+ *
+ * XXX move to hpux_machdep.c
*/
+int
hpuxtobsduoff(off, isps, p)
int *off, *isps;
struct proc *p;
@@ -1736,7 +1373,7 @@ hpuxtobsduoff(off, isps, p)
* for simplicity.
*/
if (off < (int *)ctob(UPAGES))
- off = (int *)((u_int)off + (u_int)kstack);
+ off = (int *)((u_int)off + (u_int)p->p_addr); /* XXX */
/*
* General registers.
@@ -1773,7 +1410,7 @@ hpuxtobsduoff(off, isps, p)
*/
else
raddr = (u_int) &ar0[(int)(off - ar0)];
- return((int)(raddr - (u_int)kstack));
+ return((int)(raddr - (u_int)p->p_addr)); /* XXX */
}
#endif
/* everything else */
@@ -1784,6 +1421,8 @@ hpuxtobsduoff(off, isps, p)
* Kludge up a uarea dump so that HP-UX debuggers can find out
* what they need. IMPORTANT NOTE: we do not EVEN attempt to
* convert the entire user struct.
+ *
+ * XXX move to hpux_machdep.c
*/
int
hpux_dumpu(vp, cred)
@@ -1852,9 +1491,10 @@ hpux_dumpu(vp, cred)
(int *)NULL, p);
/*
* Dump the remaining UPAGES-1 pages normally
+ * XXX Spot the wild guess.
*/
if (!error)
- error = vn_rdwr(UIO_WRITE, vp, kstack + ctob(1),
+ error = vn_rdwr(UIO_WRITE, vp, (caddr_t)p->p_addr + ctob(1),
ctob(UPAGES-1), (off_t)ctob(1), UIO_SYSSPACE,
IO_NODELOCKED|IO_UNIT, cred, (int *)NULL, p);
free((caddr_t)faku, M_TEMP);
@@ -1863,30 +1503,22 @@ hpux_dumpu(vp, cred)
}
/*
- * The remaining routines are essentially the same as those in kern_xxx.c
- * and vfs_xxx.c as defined under "#ifdef COMPAT". We replicate them here
- * to avoid COMPAT_HPUX dependencies in those files and to make sure that
- * HP-UX compatibility still works even when COMPAT is not defined.
- *
- * These are still needed as of HP-UX 7.05.
+ * Ancient HP-UX system calls. Some 9.x executables even use them!
*/
-#ifdef COMPAT_HPUX_6X
-
#define HPUX_HZ 50
-#include "sys/times.h"
+#include <sys/times.h>
/*
* SYS V style setpgrp()
*/
int
-compat_hpux_6x_sys_setpgrp(p, v, retval)
+hpux_sys_setpgrp_6x(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
- struct compat_hpux_6x_sys_setpgrp_args *uap = v;
if (p->p_pid != p->p_pgid)
enterpgrp(p, p->p_pid, 0);
@@ -1895,32 +1527,34 @@ compat_hpux_6x_sys_setpgrp(p, v, retval)
}
int
-compat_hpux_6x_sys_time(p, v, retval)
+hpux_sys_time_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_time_args *uap = v;
-
+ struct hpux_sys_time_6x_args /* {
+ syscallarg(time_t *) t;
+ } */ *uap = v;
int error = 0;
struct timeval tv;
microtime(&tv);
- if (SCARG(uap, t))
- error = copyout(&tv.tv_sec, SCARG(uap, t),
- sizeof(*(SCARG(uap, t))));
+ if (SCARG(uap, t) != NULL)
+ error = copyout(&tv.tv_sec, SCARG(uap, t), sizeof(time_t));
- *retval = (int) tv.tv_sec;
- return error;
+ *retval = (register_t)tv.tv_sec;
+ return (error);
}
int
-compat_hpux_6x_sys_stime(p, v, retval)
+hpux_sys_stime_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_stime_args *uap = v;
+ struct hpux_sys_stime_6x_args /* {
+ syscallarg(int) time;
+ } */ *uap = v;
struct timeval tv;
int s, error;
@@ -1937,12 +1571,14 @@ compat_hpux_6x_sys_stime(p, v, retval)
}
int
-compat_hpux_6x_sys_ftime(p, v, retval)
+hpux_sys_ftime_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_ftime_args *uap = v;
+ struct hpux_sys_ftime_6x_args /* {
+ syscallarg(struct hpux_timeb *) tp;
+ } */ *uap = v;
struct hpux_otimeb tb;
int s;
@@ -1956,12 +1592,14 @@ compat_hpux_6x_sys_ftime(p, v, retval)
}
int
-compat_hpux_6x_sys_alarm(p, v, retval)
+hpux_sys_alarm_6x(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_alarm_args *uap = v;
+ struct hpux_sys_alarm_6x_args /* {
+ syscallarg(int) deltat;
+ } */ *uap = v;
int s = splhigh();
untimeout(realitexpire, (caddr_t)p);
@@ -1983,12 +1621,14 @@ compat_hpux_6x_sys_alarm(p, v, retval)
}
int
-compat_hpux_6x_sys_nice(p, v, retval)
+hpux_sys_nice_6x(p, v, retval)
register struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_nice_args *uap = v;
+ struct hpux_sys_nice_6x_args /* {
+ syscallarg(int) nval;
+ } */ *uap = v;
int error;
error = donice(p, p, (p->p_nice-NZERO)+SCARG(uap, nval));
@@ -1998,12 +1638,14 @@ compat_hpux_6x_sys_nice(p, v, retval)
}
int
-compat_hpux_6x_sys_times(p, v, retval)
+hpux_sys_times_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_times_args *uap = v;
+ struct hpux_sys_times_6x_args /* {
+ syscallarg(struct tms *) tms;
+ } */ *uap = v;
struct timeval ru, rs;
struct tms atms;
int error;
@@ -2016,7 +1658,8 @@ compat_hpux_6x_sys_times(p, v, retval)
error = copyout((caddr_t)&atms, (caddr_t)SCARG(uap, tms),
sizeof (atms));
if (error == 0)
- *(time_t *)retval = hpux_scale(&time) - hpux_scale(&boottime);
+ *(time_t *)retval = hpux_scale((struct timeval *)&time) -
+ hpux_scale(&boottime);
return (error);
}
@@ -2025,7 +1668,7 @@ compat_hpux_6x_sys_times(p, v, retval)
* What we really do is return 1/HPUX_HZ-th of a second since that
* is what HP-UX returns.
*/
-int
+static int
hpux_scale(tvp)
register struct timeval *tvp;
{
@@ -2037,12 +1680,15 @@ hpux_scale(tvp)
* Can't set ICHG.
*/
int
-compat_hpux_6x_sys_utime(p, v, retval)
+hpux_sys_utime_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_utime_args *uap = v;
+ struct hpux_sys_utime_6x_args /* {
+ syscallarg(char *) fname;
+ syscallarg(time_t *) tptr;
+ } */ *uap = v;
register struct vnode *vp;
struct vattr vattr;
time_t tv[2];
@@ -2075,90 +1721,13 @@ compat_hpux_6x_sys_utime(p, v, retval)
}
int
-compat_hpux_6x_sys_pause(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct compat_hpux_6x_sys_pause_args *uap = v;
-
- (void) tsleep(kstack, PPAUSE | PCATCH, "pause", 0);
- /* always return EINTR rather than ERESTART... */
- return (EINTR);
-}
-
-/*
- * The old fstat system call.
- */
-int
-compat_hpux_6x_sys_fstat(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct compat_hpux_6x_sys_fstat_args *uap = v;
- register struct filedesc *fdp = p->p_fd;
- struct file *fp;
-
- if (((unsigned)SCARG(uap, fd)) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[SCARG(uap, fd)]) == NULL)
- return (EBADF);
- if (fp->f_type != DTYPE_VNODE)
- return (EINVAL);
- return (compat_hpux_6x_stat1((struct vnode *)fp->f_data,
- SCARG(uap, sb), p));
-}
-
-/*
- * Old stat system call. This version follows links.
- */
-int
-compat_hpux_6x_sys_stat(p, v, retval)
+hpux_sys_pause_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- register struct compat_hpux_6x_sys_stat_args *uap = v;
- int error;
- struct nameidata nd;
-
- NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
- SCARG(uap, path), p);
- if (error = namei(&nd))
- return (error);
- error = compat_hpux_6x_stat1(nd.ni_vp, SCARG(uap, sb), p);
- vput(nd.ni_vp);
- return (error);
-}
-
-int
-compat_hpux_6x_stat1(vp, ub, p)
- struct vnode *vp;
- struct hpux_ostat *ub;
- struct proc *p;
-{
- struct hpux_ostat ohsb;
- struct stat sb;
- int error;
-
- error = vn_stat(vp, &sb, p);
- if (error)
- return (error);
+ struct sys_sigsuspend_args bsa;
- ohsb.hst_dev = sb.st_dev;
- ohsb.hst_ino = sb.st_ino;
- ohsb.hst_mode = sb.st_mode;
- ohsb.hst_nlink = sb.st_nlink;
- ohsb.hst_uid = sb.st_uid;
- ohsb.hst_gid = sb.st_gid;
- ohsb.hst_rdev = sb.st_rdev;
- if (sb.st_size < (quad_t)1 << 32)
- ohsb.hst_size = sb.st_size;
- else
- ohsb.hst_size = -2;
- ohsb.hst_atime = sb.st_atime;
- ohsb.hst_mtime = sb.st_mtime;
- ohsb.hst_ctime = sb.st_ctime;
- return (copyout((caddr_t)&ohsb, (caddr_t)ub, sizeof(ohsb)));
+ SCARG(&bsa, mask) = p->p_sigmask;
+ return (sys_sigsuspend(p, &bsa, retval));
}
-#endif
diff --git a/sys/compat/hpux/hpux_exec.c b/sys/compat/hpux/hpux_exec.c
new file mode 100644
index 00000000000..e9102e9cbb9
--- /dev/null
+++ b/sys/compat/hpux/hpux_exec.c
@@ -0,0 +1,343 @@
+/* $NetBSD: hpux_exec.c,v 1.2 1995/12/08 07:54:50 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
+ * Copyright (c) 1993, 1994 Christopher G. Demetriou
+ *
+ * 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
+ * This product includes software developed by Christopher G. Demetriou.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+/*
+ * Glue for exec'ing HP-UX executables and the HP-UX execv() system call.
+ * Based on sys/kern/exec_aout.c
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/namei.h>
+#include <sys/user.h>
+#include <sys/vnode.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/vm_map.h>
+
+#include <machine/cpu.h>
+#include <machine/reg.h>
+
+#include <sys/syscallargs.h>
+
+#include <compat/hpux/hpux.h>
+#include <compat/hpux/hpux_util.h>
+#include <compat/hpux/hpux_syscall.h>
+#include <compat/hpux/hpux_syscallargs.h>
+
+const char hpux_emul_path[] = "/emul/hpux";
+extern char sigcode[], esigcode[];
+extern struct sysent hpux_sysent[];
+extern char *hpux_syscallnames[];
+extern int bsdtohpuxerrnomap[];
+
+static int exec_hpux_prep_nmagic __P((struct proc *, struct exec_package *));
+static int exec_hpux_prep_zmagic __P((struct proc *, struct exec_package *));
+static int exec_hpux_prep_omagic __P((struct proc *, struct exec_package *));
+static int vmcmd_hpux_copy_exec __P((struct proc *, struct exec_vmcmd *));
+
+struct emul emul_hpux = {
+ "hpux",
+ bsdtohpuxerrnomap,
+ sendsig,
+ HPUX_SYS_syscall,
+ HPUX_SYS_MAXSYSCALL,
+ hpux_sysent,
+ hpux_syscallnames,
+ 0,
+ copyargs,
+ setregs,
+ sigcode,
+ esigcode,
+};
+
+int
+exec_hpux_makecmds(p, epp)
+ struct proc *p;
+ struct exec_package *epp;
+{
+ struct hpux_exec *hpux_ep = epp->ep_hdr;
+ short sysid, magic;
+ int error = ENOEXEC;
+
+ magic = HPUX_MAGIC(hpux_ep);
+ sysid = HPUX_SYSID(hpux_ep);
+
+ /*
+ * XXX This will lose if there's ever an hp700 port.
+ */
+ if (sysid != MID_HPUX)
+ return (ENOEXEC);
+
+ switch (magic) {
+ case OMAGIC:
+ error = exec_hpux_prep_omagic(p, epp);
+ break;
+
+ case NMAGIC:
+ error = exec_hpux_prep_nmagic(p, epp);
+ break;
+
+ case ZMAGIC:
+ error = exec_hpux_prep_zmagic(p, epp);
+ break;
+ }
+
+ if (error == 0) {
+ /* set up command for exec header */
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_hpux_copy_exec,
+ sizeof(struct hpux_exec), (long)epp->ep_hdr, NULLVP, 0, 0);
+
+ /* set up our emulation information */
+ epp->ep_emul = &emul_hpux;
+ } else
+ kill_vmcmds(&epp->ep_vmcmds);
+
+ return (error);
+}
+
+static int
+exec_hpux_prep_nmagic(p, epp)
+ struct proc *p;
+ struct exec_package *epp;
+{
+ struct hpux_exec *execp = epp->ep_hdr;
+ long bsize, baddr;
+
+ epp->ep_taddr = 0;
+ epp->ep_tsize = execp->ha_text;
+ epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX__LDPGSZ);
+ epp->ep_dsize = execp->ha_data + execp->ha_bss;
+ epp->ep_entry = execp->ha_entry;
+
+ /* set up command for text segment */
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, execp->ha_text,
+ epp->ep_taddr, epp->ep_vp, HPUX_TXTOFF(*execp, NMAGIC),
+ VM_PROT_READ|VM_PROT_EXECUTE);
+
+ /* set up command for data segment */
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, execp->ha_data,
+ epp->ep_daddr, epp->ep_vp, HPUX_DATAOFF(*execp, NMAGIC),
+ VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+
+ /* set up command for bss segment */
+ baddr = roundup(epp->ep_daddr + execp->ha_data, NBPG);
+ bsize = epp->ep_daddr + epp->ep_dsize - baddr;
+ if (bsize > 0)
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
+ NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+
+ return (exec_aout_setup_stack(p, epp));
+}
+
+static int
+exec_hpux_prep_zmagic(p, epp)
+ struct proc *p;
+ struct exec_package *epp;
+{
+ struct hpux_exec *execp = epp->ep_hdr;
+ long bsize, baddr;
+ long nontext;
+ int (*vm_func) __P((struct proc *, struct exec_vmcmd *));
+
+ /*
+ * Check if vnode is in open for writing, because we want to
+ * demand-page out of it. If it is, don't do it, for various
+ * reasons.
+ */
+ if ((execp->ha_text != 0 || execp->ha_data != 0) &&
+ epp->ep_vp->v_writecount != 0)
+ return (ETXTBSY);
+ epp->ep_vp->v_flag |= VTEXT;
+
+ /*
+ * HP-UX ZMAGIC executables need to have their segment
+ * sizes frobbed.
+ */
+ nontext = execp->ha_data + execp->ha_bss;
+ execp->ha_text = ctob(btoc(execp->ha_text));
+ execp->ha_data = ctob(btoc(execp->ha_data));
+ execp->ha_bss = nontext - execp->ha_data;
+ if (execp->ha_bss < 0)
+ execp->ha_bss = 0;
+
+ epp->ep_taddr = 0;
+ epp->ep_tsize = execp->ha_text;
+ epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX__LDPGSZ);
+ epp->ep_dsize = execp->ha_data + execp->ha_bss;
+ epp->ep_entry = execp->ha_entry;
+
+ /*
+ * If our __LDPGSZ doesn't match HP-UX's, we can't demand-page
+ * the executable.
+ */
+ if (__LDPGSZ == HPUX__LDPGSZ)
+ vm_func = vmcmd_map_pagedvn;
+ else
+ vm_func = vmcmd_map_readvn;
+
+ /* set up command for text segment */
+ NEW_VMCMD(&epp->ep_vmcmds, vm_func, execp->ha_text,
+ epp->ep_taddr, epp->ep_vp, HPUX_TXTOFF(*execp, ZMAGIC),
+ VM_PROT_READ|VM_PROT_EXECUTE);
+
+ /* set up command for data segment */
+ NEW_VMCMD(&epp->ep_vmcmds, vm_func, execp->ha_data,
+ epp->ep_daddr, epp->ep_vp, HPUX_DATAOFF(*execp, ZMAGIC),
+ VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+
+ /* set up command for bss segment */
+ baddr = roundup(epp->ep_daddr + execp->ha_data, NBPG);
+ bsize = epp->ep_daddr + epp->ep_dsize - baddr;
+ if (bsize > 0)
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
+ NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+
+ return (exec_aout_setup_stack(p, epp));
+}
+
+/*
+ * HP-UX's version of OMAGIC.
+ */
+static int
+exec_hpux_prep_omagic(p, epp)
+ struct proc *p;
+ struct exec_package *epp;
+{
+ struct hpux_exec *execp = epp->ep_hdr;
+ long dsize, bsize, baddr;
+
+ epp->ep_taddr = 0;
+ epp->ep_tsize = execp->ha_text;
+ epp->ep_daddr = epp->ep_taddr + roundup(execp->ha_text, HPUX__LDPGSZ);
+ epp->ep_dsize = execp->ha_data + execp->ha_bss;
+ epp->ep_entry = execp->ha_entry;
+
+ /* set up command for text and data segments */
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn,
+ execp->ha_text + execp->ha_data, epp->ep_taddr, epp->ep_vp,
+ HPUX_TXTOFF(*execp, OMAGIC),
+ VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+
+ /* set up command for bss segment */
+ baddr = roundup(epp->ep_daddr + execp->ha_data, NBPG);
+ bsize = epp->ep_daddr + epp->ep_dsize - baddr;
+ if (bsize > 0)
+ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr,
+ NULLVP, 0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+
+ /*
+ * Make sure (# of pages) mapped above equals (vm_tsize + vm_dsize);
+ * obreak(2) relies on this fact. Both `vm_tsize' and `vm_dsize' are
+ * computed (in execve(2)) by rounding *up* `ep_tsize' and `ep_dsize'
+ * respectively to page boundaries.
+ * Compensate `ep_dsize' for the amount of data covered by the last
+ * text page.
+ */
+ dsize = epp->ep_dsize + execp->ha_text - roundup(execp->ha_text, NBPG);
+ epp->ep_dsize = (dsize > 0) ? dsize : 0;
+ return (exec_aout_setup_stack(p, epp));
+}
+
+/*
+ * We need to stash the exec header in the pcb, so we define
+ * this vmcmd to do it for us, since vmcmds are executed once
+ * we're committed to the exec (i.e. the old program has been unmapped).
+ *
+ * The address of the header is in ev->ev_addr and the length is
+ * in ev->ev_len.
+ */
+static int
+vmcmd_hpux_copy_exec(p, ev)
+ struct proc *p;
+ struct exec_vmcmd *ev;
+{
+ struct hpux_exec *execp = (struct hpux_exec *)ev->ev_addr;
+
+ /*
+ * In the event some brave soul attempts to use this on a non-hp300,
+ * attempt to ensure that things don't get trashed when copying
+ * the exec header into the pcb.
+ */
+ if (ev->ev_len > sizeof(p->p_addr->u_md.md_exec))
+ return (EINVAL);
+ bcopy((caddr_t)ev->ev_addr, p->p_addr->u_md.md_exec, ev->ev_len);
+
+ /*
+ * Deal with misc. HP-UX process attributes.
+ * XXX move to hpux_machdep.c
+ */
+ if (execp->ha_trsize & HPUXM_VALID) {
+ if (execp->ha_trsize & HPUXM_DATAWT)
+ p->p_md.md_flags &= ~MDP_CCBDATA;
+
+ if (execp->ha_trsize & HPUXM_STKWT)
+ p->p_md.md_flags & ~MDP_CCBSTACK;
+ }
+
+ return (0);
+}
+
+/*
+ * The HP-UX execv(2) system call.
+ *
+ * Just check the alternate emulation path, and pass it on to the NetBSD
+ * execve().
+ */
+int
+hpux_sys_execv(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_execv_args /* {
+ syscallarg(char *) path;
+ syscallarg(char **) argv;
+ } */ *uap = v;
+ struct sys_execve_args ap;
+ caddr_t sg;
+
+ sg = stackgap_init(p->p_emul);
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ SCARG(&ap, path) = SCARG(uap, path);
+ SCARG(&ap, argp) = SCARG(uap, argp);
+ SCARG(&ap, envp) = NULL;
+
+ return sys_execve(p, &ap, retval);
+}
diff --git a/sys/compat/hpux/hpux_exec.h b/sys/compat/hpux/hpux_exec.h
index 3f524c2b9e0..6002d08a263 100644
--- a/sys/compat/hpux/hpux_exec.h
+++ b/sys/compat/hpux/hpux_exec.h
@@ -1,6 +1,7 @@
-/* $NetBSD: hpux_exec.h,v 1.5 1994/10/26 02:45:16 cgd Exp $ */
+/* $NetBSD: hpux_exec.h,v 1.6 1995/11/28 08:39:45 thorpej Exp $ */
/*
+ * Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -42,22 +43,81 @@
* @(#)hpux_exec.h 8.1 (Berkeley) 6/10/93
*/
+#ifndef _HPUX_EXEC_H_
+#define _HPUX_EXEC_H_
+
/*
* HPUX a.out header format
*/
struct hpux_exec {
long ha_magic; /* magic number */
short ha_version; /* version ID */
- short ha_pad0; /* doesn't matter */
+ short ha_shlhw; /* shared lib "highwater" mark */
long ha_misc; /* misc. info */
-unsigned long ha_text; /* size of text segment */
-unsigned long ha_data; /* size of initialized data */
-unsigned long ha_bss; /* size of uninitialized data */
-unsigned long ha_pad2[5]; /* doesn't matter */
-unsigned long ha_entry; /* entry point */
-unsigned long ha_pad3[4]; /* doesn't matter */
+ long ha_text; /* size of text segment */
+ long ha_data; /* size of initialized data */
+ long ha_bss; /* size of uninitialized data */
+ long ha_trsize; /* size of text relocation */
+ long ha_drsize; /* size of data relocation */
+ long ha_pascal; /* pascal section size */
+ long ha_symbols; /* symbol table size */
+ long ha_pad0;
+ long ha_entry; /* entry point */
+ long ha_pad1;
+ long ha_supsyms; /* supplementary symbol table */
+ long ha_drelocs; /* non-PIC relocation info */
+ long ha_extentions; /* file offset of special extensions */
};
+#define HPUX_EXEC_HDR_SIZE (sizeof(struct hpux_exec))
+
+#define HPUX_MAGIC(ha) ((ha)->ha_magic & 0xffff)
+#define HPUX_SYSID(ha) (((ha)->ha_magic >> 16) & 0xffff)
+
+/*
+ * Additional values for HPUX_MAGIC()
+ */
+#define HPUX_MAGIC_RELOC 0x0106 /* relocatable object */
+#define HPUX_MAGIC_DL 0x010d /* dynamic load library */
+#define HPUX_MAGIC_SHL 0x010e /* shared library */
+
+#define HPUX__LDPGSZ 4096 /* align to this */
+#define HPUX__LDPGSHIFT 12 /* log2(HPUX__LDPGSZ) */
+
+#define HPUX__SEGMENT_ROUND(x) \
+ (((x) + HPUX__LDPGSZ - 1) & ~(HPUX__LDPGSZ - 1))
+
+#define HPUX_TXTOFF(x, m) \
+ ((((m) == ZMAGIC) || \
+ ((m) == HPUX_MAGIC_SHL) || \
+ ((m) == HPUX_MAGIC_DL)) ? \
+ HPUX__LDPGSZ : HPUX_EXEC_HDR_SIZE)
+
+#define HPUX_DATAOFF(x, m) \
+ ((((m) == ZMAGIC) || \
+ ((m) == HPUX_MAGIC_SHL) || \
+ ((m) == HPUX_MAGIC_DL)) ? \
+ (HPUX__LDPGSZ + HPUX__SEGMENT_ROUND((x).ha_text)) : \
+ (HPUX_EXEC_HDR_SIZE + (x).ha_text))
+
+#define HPUX_PASOFF(x, m) \
+ ((((m) == ZMAGIC) || \
+ ((m) == HPUX_MAGIC_SHL) || \
+ ((m) == HPUX_MAGIC_DL)) ? \
+ (HPUX__LDPGSZ + HPUX__SEGMENT_ROUND((x).ha_text) + \
+ HPUX__SEGMENT_ROUND((x).ha_data)) : \
+ (HPUX_EXEC_HDR_SIZE + (x).ha_text + (x).ha_data))
+
+#define HPUX_SYMOFF(x, m) (HPUX_PASOFF((x), (m)) + (x).ha_pascal)
+#define HPUX_SUPSYMOFF(x, m) (HPUX_SYMOFF((x), (m)) + (x).ha_symbols)
+#define HPUX_RTEXTOFF(x, m) (HPUX_SUPSYMOFF((x), (m)) + (x).ha_supsyms)
+#define HPUX_RDATAOFF(x, m) (HPUX_RTEXTOFF((x), (m)) + (x).ha_trsize)
+#define HPUX_EXTOFF(x, m) ((x).ha_extentions)
+
#define HPUXM_VALID 0x00000001
#define HPUXM_STKWT 0x02000000
#define HPUXM_DATAWT 0x04000000
+
+int exec_hpux_makecmds __P((struct proc *, struct exec_package *));
+
+#endif /* _HPUX_EXEC_H_ */
diff --git a/sys/compat/hpux/hpux_file.c b/sys/compat/hpux/hpux_file.c
new file mode 100644
index 00000000000..1116c577c91
--- /dev/null
+++ b/sys/compat/hpux/hpux_file.c
@@ -0,0 +1,892 @@
+/* $NetBSD: hpux_file.c,v 1.2 1995/12/08 07:54:53 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1995 Jason R. Thorpe. All rights reserved.
+ * 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.
+ *
+ * from: Utah $Hdr: hpux_compat.c 1.64 93/08/05$
+ *
+ * @(#)hpux_compat.c 8.4 (Berkeley) 2/13/94
+ */
+
+/*
+ * File-related routines for HP-UX binary compatibility. Partially
+ * modeled after sys/compat/linux/linux_file.c
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/signalvar.h>
+#include <sys/kernel.h>
+#include <sys/filedesc.h>
+#include <sys/proc.h>
+#include <sys/buf.h>
+#include <sys/wait.h>
+#include <sys/file.h>
+#include <sys/namei.h>
+#include <sys/vnode.h>
+#include <sys/ioctl.h>
+#include <sys/ptrace.h>
+#include <sys/stat.h>
+#include <sys/syslog.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/ipc.h>
+#include <sys/user.h>
+#include <sys/mman.h>
+
+#include <machine/cpu.h>
+#include <machine/reg.h>
+#include <machine/psl.h>
+#include <machine/vmparam.h>
+
+#include <sys/syscallargs.h>
+
+#include <compat/hpux/hpux.h>
+#include <compat/hpux/hpux_util.h>
+#include <compat/hpux/hpux_termio.h>
+#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 *));
+
+/*
+ * HP-UX creat(2) system call.
+ *
+ * Just call open(2) with the TRUNC, CREAT and WRONLY flags.
+ */
+int
+hpux_sys_creat(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_creat_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+ } */ *uap = v;
+
+ struct sys_open_args oa;
+ caddr_t sg;
+
+ sg = stackgap_init(p->p_emul);
+ HPUX_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+
+ SCARG(&oa, path) = SCARG(uap, path);
+ SCARG(&oa, flags) = O_CREAT | O_TRUNC | O_WRONLY;
+ SCARG(&oa, mode) = SCARG(uap, mode);
+
+ return sys_open(p, &oa, retval);
+}
+
+/*
+ * HP-UX open(2) system call.
+ *
+ * We need to remap some of the bits in the mode mask:
+ *
+ * - O_CREAT, O_TRUNC, and O_EXCL must me remapped.
+ * - O_NONBLOCK is remapped and remembered.
+ * - O_FNDELAY is remembered.
+ * - O_SYNCIO is removed entirely.
+ */
+int
+hpux_sys_open(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_open_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) flags;
+ syscallarg(int) mode;
+ } */ *uap = v;
+ struct sys_open_args oa;
+ int flags, nflags, error;
+ caddr_t sg;
+
+ sg = stackgap_init(p->p_emul);
+
+ /*
+ * Deal with the mode flags first, since they will affect
+ * how we check for the alternate path.
+ */
+ flags = SCARG(uap, flags);
+ nflags =
+ flags & ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFEXCL|HPUXFTRUNC|HPUXFCREAT);
+ if (flags & HPUXFCREAT) {
+ /*
+ * Simulate the pre-NFS behavior that opening a
+ * file for READ+CREATE ignores the CREATE (unless
+ * EXCL is set in which case we will return the
+ * proper error).
+ */
+ if ((flags & HPUXFEXCL) || (FFLAGS(flags) & FWRITE))
+ nflags |= O_CREAT;
+ }
+ if (flags & HPUXFTRUNC)
+ nflags |= O_TRUNC;
+ if (flags & HPUXFEXCL)
+ nflags |= O_EXCL;
+ if (flags & HPUXNONBLOCK)
+ nflags |= O_NDELAY;
+
+ /*
+ * Do the alternate pathname check.
+ */
+ if (SCARG(&oa, flags) & O_CREAT)
+ HPUX_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ else
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ /*
+ * Fill in the new arguments and call the NetBSD open(2).
+ */
+ SCARG(&oa, path) = SCARG(uap, path);
+ SCARG(&oa, flags) = nflags;
+ SCARG(&oa, mode) = SCARG(uap, mode);
+
+ error = sys_open(p, &oa, retval);
+
+ /*
+ * Record non-blocking mode for fcntl, read, write, etc.
+ */
+ if ((error == 0) && (nflags & O_NDELAY))
+ p->p_fd->fd_ofileflags[*retval] |=
+ (flags & HPUXNONBLOCK) ?
+ HPUX_UF_NONBLOCK_ON : HPUX_UF_FNDELAY_ON;
+
+ return (error);
+}
+
+/*
+ * HP-UX fcntl(2) system call.
+ */
+int
+hpux_sys_fcntl(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_fcntl_args /* {
+ syscallarg(int) fd;
+ syscallarg(int) cmd;
+ syscallarg(int) arg;
+ } */ *uap = v;
+ int arg, mode, error, flg = F_POSIX;
+ struct file *fp;
+ char *pop;
+ struct hpux_flock hfl;
+ struct flock fl;
+ struct vnode *vp;
+ struct sys_fcntl_args fa;
+
+ if ((u_int)SCARG(uap, fd) > p->p_fd->fd_nfiles ||
+ (fp = p->p_fd->fd_ofiles[SCARG(uap, fd)]) == NULL)
+ return (EBADF);
+
+ pop = &p->p_fd->fd_ofileflags[SCARG(uap, fd)];
+ arg = SCARG(uap, arg);
+
+ switch (SCARG(uap, cmd)) {
+ case F_SETFL:
+ if (arg & HPUXNONBLOCK)
+ *pop |= HPUX_UF_NONBLOCK_ON;
+ else
+ *pop &= ~HPUX_UF_NONBLOCK_ON;
+
+ if (arg & HPUXNDELAY)
+ *pop |= HPUX_UF_FNDELAY_ON;
+ else
+ *pop &= ~HPUX_UF_FNDELAY_ON;
+
+ if (*pop & (HPUX_UF_NONBLOCK_ON|HPUX_UF_FNDELAY_ON|HPUX_UF_FIONBIO_ON))
+ arg |= FNONBLOCK;
+ else
+ arg &= ~FNONBLOCK;
+
+ arg &= ~(HPUXNONBLOCK|HPUXFSYNCIO|HPUXFREMOTE);
+ break;
+
+ case F_GETFL:
+ case F_DUPFD:
+ case F_GETFD:
+ case F_SETFD:
+ break;
+
+ case HPUXF_SETLKW:
+ flg |= F_WAIT;
+ /* Fall into F_SETLK */
+
+ case HPUXF_SETLK:
+ if (fp->f_type != DTYPE_VNODE)
+ return (EBADF);
+
+ vp = (struct vnode *)fp->f_data;
+
+ /* Copy in the lock structure */
+ error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&hfl,
+ sizeof (hfl));
+ if (error)
+ return (error);
+
+ fl.l_start = hfl.hl_start;
+ fl.l_len = hfl.hl_len;
+ fl.l_pid = hfl.hl_pid;
+ fl.l_type = hfl.hl_type;
+ fl.l_whence = hfl.hl_whence;
+ if (fl.l_whence == SEEK_CUR)
+ fl.l_start += fp->f_offset;
+
+ switch (fl.l_type) {
+ case F_RDLCK:
+ if ((fp->f_flag & FREAD) == 0)
+ return (EBADF);
+
+ p->p_flag |= P_ADVLOCK;
+ return (VOP_ADVLOCK(vp, (caddr_t)p, F_SETLK, &fl, flg));
+
+ case F_WRLCK:
+ if ((fp->f_flag & FWRITE) == 0)
+ return (EBADF);
+ p->p_flag |= P_ADVLOCK;
+ return (VOP_ADVLOCK(vp, (caddr_t)p, F_SETLK, &fl, flg));
+
+ case F_UNLCK:
+ return (VOP_ADVLOCK(vp, (caddr_t)p, F_UNLCK, &fl,
+ F_POSIX));
+
+ default:
+ return (EINVAL);
+ }
+ /* NOTREACHED */
+
+ case F_GETLK:
+ if (fp->f_type != DTYPE_VNODE)
+ return (EBADF);
+
+ vp = (struct vnode *)fp->f_data;
+
+ /* Copy in the lock structure */
+ error = copyin((caddr_t)SCARG(uap, arg), (caddr_t)&hfl,
+ sizeof (hfl));
+ if (error)
+ return (error);
+
+ fl.l_start = hfl.hl_start;
+ fl.l_len = hfl.hl_len;
+ fl.l_pid = hfl.hl_pid;
+ fl.l_type = hfl.hl_type;
+ fl.l_whence = hfl.hl_whence;
+ 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))
+ return (error);
+
+ hfl.hl_start = fl.l_start;
+ hfl.hl_len = fl.l_len;
+ hfl.hl_pid = fl.l_pid;
+ hfl.hl_type = fl.l_type;
+ hfl.hl_whence = fl.l_whence;
+ return (copyout((caddr_t)&hfl, (caddr_t)SCARG(uap, arg),
+ sizeof (hfl)));
+
+ default:
+ return (EINVAL);
+ }
+
+ /*
+ * Pass whatever's left on to the NetBSD fcntl(2).
+ */
+ SCARG(&fa, fd) = SCARG(uap, fd);
+ SCARG(&fa, cmd) = SCARG(uap, cmd);
+ SCARG(&fa, arg) = (void *)arg;
+
+ error = sys_fcntl(p, &fa, retval);
+
+ if ((error == 0) && (SCARG(&fa, cmd) == F_GETFL)) {
+ mode = *retval;
+ *retval &= ~(O_CREAT|O_TRUNC|O_EXCL);
+ if (mode & FNONBLOCK) {
+ if (*pop & HPUX_UF_NONBLOCK_ON)
+ *retval |= HPUXNONBLOCK;
+
+ if ((*pop & HPUX_UF_FNDELAY_ON) == 0)
+ *retval &= ~HPUXNDELAY;
+ }
+ if (mode & O_CREAT)
+ *retval |= HPUXFCREAT;
+
+ if (mode & O_TRUNC)
+ *retval |= HPUXFTRUNC;
+
+ if (mode & O_EXCL)
+ *retval |= HPUXFEXCL;
+ }
+ return (error);
+}
+
+/*
+ * HP-UX fstat(2) system call.
+ */
+int
+hpux_sys_fstat(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_fstat_args /* {
+ syscallarg(int) fd;
+ syscallarg(struct hpux_stat *) sb;
+ } */ *uap = v;
+ struct sys_fstat_args fsa;
+ struct hpux_stat tmphst;
+ struct stat *st, tmpst;
+ caddr_t sg;
+ int error;
+
+ sg = stackgap_init(p->p_emul);
+
+ st = stackgap_alloc(&sg, sizeof (struct stat));
+
+ SCARG(&fsa, fd) = SCARG(uap, fd);
+ SCARG(&fsa, sb) = st;
+
+ if ((error = sys_fstat(p, &fsa, retval)))
+ return (error);
+
+ if ((error = copyin(st, &tmpst, sizeof(tmpst))))
+ return (error);
+
+ bsd_to_hpux_stat(&tmpst, &tmphst);
+
+ return (copyout(&tmphst, SCARG(uap, sb), sizeof(struct hpux_stat)));
+}
+
+/*
+ * HP-UX stat(2) system call.
+ */
+int
+hpux_sys_stat(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+
+ return (hpux_stat1(p, v, retval, 0));
+}
+
+/*
+ * HP-UX lstat(2) system call.
+ */
+int
+hpux_sys_lstat(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+
+ return (hpux_stat1(p, v, retval, 1));
+}
+
+/*
+ * Do the meat of stat(2) and lstat(2).
+ */
+static int
+hpux_stat1(p, v, retval, dolstat)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+ int dolstat;
+{
+ struct hpux_sys_stat_args /* {
+ syscallarg(char *) path;
+ syscallarg(struct hpux_stat *) sb;
+ } */ *uap = v;
+ struct sys_stat_args sa;
+ struct hpux_stat tmphst;
+ struct stat *st, tmpst;
+ caddr_t sg;
+ int error;
+
+ sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ st = stackgap_alloc(&sg, sizeof (struct stat));
+ SCARG(&sa, ub) = st;
+ SCARG(&sa, path) = SCARG(uap, path);
+
+ if (dolstat)
+ error = sys_lstat(p, &sa, retval);
+ else
+ error = sys_stat(p, &sa, retval);
+
+ if (error)
+ return (error);
+
+ if ((error = copyin(st, &tmpst, sizeof(tmpst))))
+ return (error);
+
+ bsd_to_hpux_stat(&tmpst, &tmphst);
+
+ return (copyout(&tmphst, SCARG(uap, sb), sizeof(struct hpux_stat)));
+}
+
+/*
+ * The old HP-UX fstat(2) system call.
+ */
+int
+hpux_sys_fstat_6x(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_fstat_6x_args /* {
+ syscallarg(int) fd;
+ syscallarg(struct hpux_ostat *) sb;
+ } */ *uap = v;
+ struct sys_fstat_args fsa;
+ struct hpux_ostat tmphst;
+ struct stat *st, tmpst;
+ caddr_t sg;
+ int error;
+
+ sg = stackgap_init(p->p_emul);
+
+ st = stackgap_alloc(&sg, sizeof (struct stat));
+
+ SCARG(&fsa, fd) = SCARG(uap, fd);
+ SCARG(&fsa, sb) = st;
+
+ if ((error = sys_fstat(p, &fsa, retval)))
+ return (error);
+
+ if ((error = copyin(st, &tmpst, sizeof(tmpst))))
+ return (error);
+
+ bsd_to_hpux_ostat(&tmpst, &tmphst);
+
+ return (copyout(&tmphst, SCARG(uap, sb), sizeof(struct hpux_ostat)));
+}
+
+/*
+ * The old HP-UX stat(2) system call.
+ */
+int
+hpux_sys_stat_6x(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_stat_6x_args /* {
+ syscallarg(char *) path;
+ syscallarg(struct hpux_ostat *) sb;
+ } */ *uap = v;
+ struct sys_stat_args sa;
+ struct hpux_ostat tmphst;
+ struct stat *st, tmpst;
+ caddr_t sg;
+ int error;
+
+ sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ st = stackgap_alloc(&sg, sizeof (struct stat));
+ SCARG(&sa, ub) = st;
+ SCARG(&sa, path) = SCARG(uap, path);
+
+ if ((error = sys_stat(p, &sa, retval)))
+ return (error);
+
+ if ((error = copyin(st, &tmpst, sizeof(tmpst))))
+ return (error);
+
+ bsd_to_hpux_ostat(&tmpst, &tmphst);
+
+ return (copyout(&tmphst, SCARG(uap, sb), sizeof(struct hpux_ostat)));
+}
+
+/* XXX: Set up a machdep callback. */
+#ifdef hp300
+#include "grf.h"
+#define NHIL 1 /* XXX */
+#endif
+
+#if NGRF > 0
+extern int grfopen __P((dev_t dev, int oflags, int devtype, struct proc *p));
+#endif
+
+#if NHIL > 0
+extern int hilopen __P((dev_t dev, int oflags, int devtype, struct proc *p));
+#endif
+
+#include <sys/conf.h>
+
+/*
+ * Convert a NetBSD stat structure to an HP-UX stat structure.
+ */
+static void
+bsd_to_hpux_stat(sb, hsb)
+ struct stat *sb;
+ struct hpux_stat *hsb;
+{
+
+ bzero((caddr_t)hsb, sizeof(struct hpux_stat));
+ hsb->hst_dev = (long)sb->st_dev;
+ hsb->hst_ino = (u_long)sb->st_ino;
+ hsb->hst_mode = (u_short)sb->st_mode;
+ hsb->hst_nlink = (u_short)sb->st_nlink;
+ hsb->hst_uid = (u_long)sb->st_uid;
+ hsb->hst_gid = (u_long)sb->st_gid;
+ hsb->hst_rdev = (long)bsdtohpuxdev(sb->st_rdev);
+ /*
+ * XXX Let's just hope that the old binary doesn't lose.
+ */
+ hsb->hst_old_uid = (u_short)sb->st_uid;
+ hsb->hst_old_gid = (u_short)sb->st_gid;
+
+ /* MACHDEP CALLBACK SHOULD GO HERE! */
+ /* XXX: I don't want to talk about it... */
+ if ((sb->st_mode & S_IFMT) == S_IFCHR) {
+#if NGRF > 0
+ if (cdevsw[major(sb->st_rdev)].d_open == grfopen) {
+ hsb->hst_rdev = grfdevno(sb->st_rdev);
+ goto xxx_out;
+ }
+#endif
+#if NHIL > 0
+ if (cdevsw[major(sb->st_rdev)].d_open == hilopen) {
+ hsb->hst_rdev = hildevno(sb->st_rdev);
+ goto xxx_out;
+ }
+#endif
+ }
+
+ xxx_out:
+ if (sb->st_size < (off_t)(((off_t)1) << 32))
+ hsb->hst_size = (long)sb->st_size;
+ else
+ hsb->hst_size = -2;
+ hsb->hst_atime = (long)sb->st_atime;
+ hsb->hst_mtime = (long)sb->st_mtime;
+ hsb->hst_ctime = (long)sb->st_ctime;
+ hsb->hst_blksize = (long)sb->st_blksize;
+ hsb->hst_blocks = (long)sb->st_blocks;
+}
+
+/*
+ * Convert a NetBSD stat structure to an old-style HP-UX stat structure.
+ */
+static void
+bsd_to_hpux_ostat(sb, hsb)
+ struct stat *sb;
+ struct hpux_ostat *hsb;
+{
+
+ bzero(hsb, sizeof(struct hpux_ostat));
+ hsb->hst_dev = (u_short)sb->st_dev;
+ hsb->hst_ino = (u_short)sb->st_ino;
+ hsb->hst_mode = (u_short)sb->st_mode;
+ hsb->hst_nlink = (u_short)sb->st_nlink;
+ hsb->hst_uid = (u_short)sb->st_uid;
+ hsb->hst_gid = (u_short)sb->st_gid;
+ hsb->hst_rdev = (u_short)sb->st_rdev;
+ if (sb->st_size < (off_t)(((off_t)1) << 32))
+ hsb->hst_size = (int)sb->st_size;
+ else
+ hsb->hst_size = -2;
+ hsb->hst_atime = (int)sb->st_atime;
+ hsb->hst_mtime = (int)sb->st_mtime;
+ hsb->hst_ctime = (int)sb->st_ctime;
+}
+
+/*
+ * HP-UX access(2) system call.
+ */
+int
+hpux_sys_access(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_access_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) flags;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (sys_access(p, uap, retval));
+}
+
+/*
+ * HP-UX unlink(2) system call.
+ */
+int
+hpux_sys_unlink(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_unlink_args /* {
+ syscallarg(char *) path;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (sys_unlink(p, uap, retval));
+}
+
+/*
+ * HP-UX chdir(2) system call.
+ */
+int
+hpux_sys_chdir(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_chdir_args /* {
+ syscallarg(char *) path;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (sys_chdir(p, uap, retval));
+}
+
+/*
+ * HP-UX mknod(2) system call.
+ */
+int
+hpux_sys_mknod(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_mknod_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+ syscallarf(int) dev;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+ struct sys_mkfifo_args bma;
+
+ HPUX_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+
+ /*
+ * BSD handles FIFOs separately.
+ */
+ if (SCARG(uap, mode) & S_IFIFO) {
+ SCARG(&bma, path) = SCARG(uap, path);
+ SCARG(&bma, mode) = SCARG(uap, mode);
+ return (sys_mkfifo(p, uap, retval));
+ } else
+ return (sys_mknod(p, uap, retval));
+}
+
+/*
+ * HP-UX chmod(2) system call.
+ */
+int
+hpux_sys_chmod(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_chmod_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (sys_chmod(p, uap, retval));
+}
+
+/*
+ * HP-UX chown(2) system call.
+ */
+int
+hpux_sys_chown(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_chown_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) uid;
+ syscallarg(int) gid;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ /* XXX What about older HP-UX executables? */
+
+ return (sys_chown(p, uap, retval));
+}
+
+/*
+ * HP-UX rename(2) system call.
+ */
+int
+hpux_sys_rename(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_rename_args /* {
+ syscallarg(char *) from;
+ syscallarg(char *) to;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, to));
+
+ return (sys_rename(p, uap, retval));
+}
+
+/*
+ * HP-UX mkdir(2) system call.
+ */
+int
+hpux_sys_mkdir(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_mkdir_args /* {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+
+ return (sys_mkdir(p, uap, retval));
+}
+
+/*
+ * HP-UX rmdir(2) system call.
+ */
+int
+hpux_sys_rmdir(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_rmdir_args /* {
+ syscallarg(char *) path;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (sys_rmdir(p, uap, retval));
+}
+
+/*
+ * HP-UX symlink(2) system call.
+ */
+int
+hpux_sys_symlink(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_symlink_args /* {
+ syscallarg(char *) path;
+ syscallarg(char *) link;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ HPUX_CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
+
+ return (sys_symlink(p, uap, retval));
+}
+
+/*
+ * HP-UX readlink(2) system call.
+ */
+int
+hpux_sys_readlink(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_readlink_args /* {
+ syscallarg(char *) path;
+ syscallarg(char *) buf;
+ syscallarg(int) count;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (sys_readlink(p, uap, retval));
+}
+
+/*
+ * HP-UX truncate(2) system call.
+ */
+int
+hpux_sys_truncate(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct hpux_sys_truncate_args /* {
+ syscallarg(char *) path;
+ syscallarg(long) length;
+ } */ *uap = v;
+ caddr_t sg = stackgap_init(p->p_emul);
+
+ HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+
+ return (compat_43_sys_truncate(p, uap, retval));
+}
diff --git a/sys/compat/hpux/hpux_sig.c b/sys/compat/hpux/hpux_sig.c
index 8443e5ae282..07bd6633f7c 100644
--- a/sys/compat/hpux/hpux_sig.c
+++ b/sys/compat/hpux/hpux_sig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpux_sig.c,v 1.14 1995/10/07 06:26:38 mycroft Exp $ */
+/* $NetBSD: hpux_sig.c,v 1.15 1995/11/28 08:39:50 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -347,14 +347,16 @@ hpux_sys_sigaction(p, v, retval)
return (0);
}
-#ifdef COMPAT_HPUX_6X
int
-compat_hpux_6x_sys_ssig(p, v, retval)
+hpux_sys_ssig_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct compat_hpux_6x_sys_ssig_args *uap = v;
+ struct hpux_sys_ssig_6x_args /* {
+ syscallarg(int) signo;
+ syscallarg(sig_t) fun;
+ } */ *uap = v;
register int a;
struct sigaction vec;
register struct sigaction *sa = &vec;
@@ -383,7 +385,6 @@ compat_hpux_6x_sys_ssig(p, v, retval)
#endif
return (0);
}
-#endif
/* signal numbers: convert from HPUX to BSD */
int
diff --git a/sys/compat/hpux/hpux_syscall.h b/sys/compat/hpux/hpux_syscall.h
index 9d1924965e4..02d1e7e2eb2 100644
--- a/sys/compat/hpux/hpux_syscall.h
+++ b/sys/compat/hpux/hpux_syscall.h
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.8 1995/10/07 06:26:42 mycroft Exp
+ * created from NetBSD: syscalls.master,v 1.9 1995/11/28 08:39:56 thorpej Exp
*/
#define HPUX_SYS_syscall 0
@@ -18,39 +18,39 @@
#define HPUX_SYS_unlink 10
#define HPUX_SYS_execv 11
#define HPUX_SYS_chdir 12
- /* 13 is compat_hpux_6x time */
+#define HPUX_SYS_time_6x 13
#define HPUX_SYS_mknod 14
#define HPUX_SYS_chmod 15
#define HPUX_SYS_chown 16
#define HPUX_SYS_obreak 17
- /* 18 is compat_hpux_6x stat */
+#define HPUX_SYS_stat_6x 18
#define HPUX_SYS_lseek 19
#define HPUX_SYS_getpid 20
#define HPUX_SYS_setuid 23
#define HPUX_SYS_getuid 24
- /* 25 is compat_hpux_6x stime */
+#define HPUX_SYS_stime_6x 25
#define HPUX_SYS_ptrace 26
- /* 27 is compat_hpux_6x alarm */
- /* 28 is compat_hpux_6x fstat */
- /* 29 is compat_hpux_6x pause */
- /* 30 is compat_hpux_6x utime */
- /* 31 is compat_hpux_6x stty */
- /* 32 is compat_hpux_6x gtty */
+#define HPUX_SYS_alarm_6x 27
+#define HPUX_SYS_fstat_6x 28
+#define HPUX_SYS_pause_6x 29
+#define HPUX_SYS_utime_6x 30
+#define HPUX_SYS_stty_6x 31
+#define HPUX_SYS_gtty_6x 32
#define HPUX_SYS_access 33
- /* 34 is compat_hpux_6x nice */
- /* 35 is compat_hpux_6x ftime */
+#define HPUX_SYS_nice_6x 34
+#define HPUX_SYS_ftime_6x 35
#define HPUX_SYS_sync 36
#define HPUX_SYS_kill 37
#define HPUX_SYS_stat 38
- /* 39 is compat_hpux_6x setpgrp */
+#define HPUX_SYS_setpgrp_6x 39
#define HPUX_SYS_lstat 40
#define HPUX_SYS_dup 41
#define HPUX_SYS_pipe 42
- /* 43 is compat_hpux_6x times */
+#define HPUX_SYS_times_6x 43
#define HPUX_SYS_profil 44
#define HPUX_SYS_setgid 46
#define HPUX_SYS_getgid 47
- /* 48 is compat_hpux_6x ssig */
+#define HPUX_SYS_ssig_6x 48
#define HPUX_SYS_ioctl 54
#define HPUX_SYS_symlink 56
#define HPUX_SYS_utssys 57
diff --git a/sys/compat/hpux/hpux_syscallargs.h b/sys/compat/hpux/hpux_syscallargs.h
index 63af42f3115..045caa1396d 100644
--- a/sys/compat/hpux/hpux_syscallargs.h
+++ b/sys/compat/hpux/hpux_syscallargs.h
@@ -2,7 +2,7 @@
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.8 1995/10/07 06:26:42 mycroft Exp
+ * created from NetBSD: syscalls.master,v 1.9 1995/11/28 08:39:56 thorpej Exp
*/
#define syscallarg(x) union { x datum; register_t pad; }
@@ -34,21 +34,46 @@ struct hpux_sys_creat_args {
syscallarg(int) mode;
};
+struct hpux_sys_unlink_args {
+ syscallarg(char *) path;
+};
+
struct hpux_sys_execv_args {
syscallarg(char *) path;
syscallarg(char **) argp;
};
-struct compat_hpux_6x_sys_time_args {
+struct hpux_sys_chdir_args {
+ syscallarg(char *) path;
+};
+
+struct hpux_sys_time_6x_args {
syscallarg(time_t *) t;
};
-struct compat_hpux_6x_sys_stat_args {
+struct hpux_sys_mknod_args {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+ syscallarg(int) dev;
+};
+
+struct hpux_sys_chmod_args {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+};
+
+struct hpux_sys_chown_args {
+ syscallarg(char *) path;
+ syscallarg(int) uid;
+ syscallarg(int) gid;
+};
+
+struct hpux_sys_stat_6x_args {
syscallarg(char *) path;
syscallarg(struct hpux_ostat *) sb;
};
-struct compat_hpux_6x_sys_stime_args {
+struct hpux_sys_stime_6x_args {
syscallarg(int) time;
};
@@ -59,35 +84,40 @@ struct hpux_sys_ptrace_args {
syscallarg(int) data;
};
-struct compat_hpux_6x_sys_alarm_args {
+struct hpux_sys_alarm_6x_args {
syscallarg(int) deltat;
};
-struct compat_hpux_6x_sys_fstat_args {
+struct hpux_sys_fstat_6x_args {
syscallarg(int) fd;
syscallarg(struct hpux_ostat *) sb;
};
-struct compat_hpux_6x_sys_utime_args {
+struct hpux_sys_utime_6x_args {
syscallarg(char *) fname;
syscallarg(time_t *) tptr;
};
-struct compat_hpux_6x_sys_stty_args {
+struct hpux_sys_stty_6x_args {
syscallarg(int) fd;
syscallarg(caddr_t) arg;
};
-struct compat_hpux_6x_sys_gtty_args {
+struct hpux_sys_gtty_6x_args {
syscallarg(int) fd;
syscallarg(caddr_t) arg;
};
-struct compat_hpux_6x_sys_nice_args {
+struct hpux_sys_access_args {
+ syscallarg(char *) path;
+ syscallarg(int) flags;
+};
+
+struct hpux_sys_nice_6x_args {
syscallarg(int) nval;
};
-struct compat_hpux_6x_sys_ftime_args {
+struct hpux_sys_ftime_6x_args {
syscallarg(struct hpux_timeb *) tp;
};
@@ -110,11 +140,11 @@ struct hpux_sys_dup_args {
syscallarg(int) fd;
};
-struct compat_hpux_6x_sys_times_args {
+struct hpux_sys_times_6x_args {
syscallarg(struct tms *) tms;
};
-struct compat_hpux_6x_sys_ssig_args {
+struct hpux_sys_ssig_6x_args {
syscallarg(int) signo;
syscallarg(sig_t) fun;
};
@@ -125,12 +155,23 @@ struct hpux_sys_ioctl_args {
syscallarg(caddr_t) data;
};
+struct hpux_sys_symlink_args {
+ syscallarg(char *) path;
+ syscallarg(char *) link;
+};
+
struct hpux_sys_utssys_args {
syscallarg(struct hpux_utsname *) uts;
syscallarg(int) dev;
syscallarg(int) request;
};
+struct hpux_sys_readlink_args {
+ syscallarg(char *) path;
+ syscallarg(char *) buf;
+ syscallarg(int) count;
+};
+
struct hpux_sys_fcntl_args {
syscallarg(int) fd;
syscallarg(int) cmd;
@@ -213,10 +254,29 @@ struct hpux_sys_setresgid_args {
syscallarg(gid_t) s;
};
+struct hpux_sys_rename_args {
+ syscallarg(char *) from;
+ syscallarg(char *) to;
+};
+
+struct hpux_sys_truncate_args {
+ syscallarg(char *) path;
+ syscallarg(long) length;
+};
+
struct hpux_sys_sysconf_args {
syscallarg(int) name;
};
+struct hpux_sys_mkdir_args {
+ syscallarg(char *) path;
+ syscallarg(int) mode;
+};
+
+struct hpux_sys_rmdir_args {
+ syscallarg(char *) path;
+};
+
struct hpux_sys_getrlimit_args {
syscallarg(u_int) which;
syscallarg(struct ogetrlimit *) rlp;
@@ -322,46 +382,46 @@ int sys_close __P((struct proc *, void *, register_t *));
int hpux_sys_wait __P((struct proc *, void *, register_t *));
int hpux_sys_creat __P((struct proc *, void *, register_t *));
int sys_link __P((struct proc *, void *, register_t *));
-int sys_unlink __P((struct proc *, void *, register_t *));
+int hpux_sys_unlink __P((struct proc *, void *, register_t *));
int hpux_sys_execv __P((struct proc *, void *, register_t *));
-int sys_chdir __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_time __P((struct proc *, void *, register_t *));
-int sys_mknod __P((struct proc *, void *, register_t *));
-int sys_chmod __P((struct proc *, void *, register_t *));
-int sys_chown __P((struct proc *, void *, register_t *));
+int hpux_sys_chdir __P((struct proc *, void *, register_t *));
+int hpux_sys_time_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_mknod __P((struct proc *, void *, register_t *));
+int hpux_sys_chmod __P((struct proc *, void *, register_t *));
+int hpux_sys_chown __P((struct proc *, void *, register_t *));
int sys_obreak __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_stat __P((struct proc *, void *, register_t *));
+int hpux_sys_stat_6x __P((struct proc *, void *, register_t *));
int compat_43_sys_lseek __P((struct proc *, void *, register_t *));
int sys_getpid __P((struct proc *, void *, register_t *));
int sys_setuid __P((struct proc *, void *, register_t *));
int sys_getuid __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_stime __P((struct proc *, void *, register_t *));
+int hpux_sys_stime_6x __P((struct proc *, void *, register_t *));
int hpux_sys_ptrace __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_alarm __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_fstat __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_pause __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_utime __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_stty __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_gtty __P((struct proc *, void *, register_t *));
-int sys_access __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_nice __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_ftime __P((struct proc *, void *, register_t *));
+int hpux_sys_alarm_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_fstat_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_pause_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_utime_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_stty_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_gtty_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_access __P((struct proc *, void *, register_t *));
+int hpux_sys_nice_6x __P((struct proc *, void *, register_t *));
+int hpux_sys_ftime_6x __P((struct proc *, void *, register_t *));
int sys_sync __P((struct proc *, void *, register_t *));
int hpux_sys_kill __P((struct proc *, void *, register_t *));
int hpux_sys_stat __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_setpgrp __P((struct proc *, void *, register_t *));
+int hpux_sys_setpgrp_6x __P((struct proc *, void *, register_t *));
int hpux_sys_lstat __P((struct proc *, void *, register_t *));
int hpux_sys_dup __P((struct proc *, void *, register_t *));
int sys_pipe __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_times __P((struct proc *, void *, register_t *));
+int hpux_sys_times_6x __P((struct proc *, void *, register_t *));
int sys_profil __P((struct proc *, void *, register_t *));
int sys_setgid __P((struct proc *, void *, register_t *));
int sys_getgid __P((struct proc *, void *, register_t *));
-int compat_hpux_6x_sys_ssig __P((struct proc *, void *, register_t *));
+int hpux_sys_ssig_6x __P((struct proc *, void *, register_t *));
int hpux_sys_ioctl __P((struct proc *, void *, register_t *));
-int sys_symlink __P((struct proc *, void *, register_t *));
+int hpux_sys_symlink __P((struct proc *, void *, register_t *));
int hpux_sys_utssys __P((struct proc *, void *, register_t *));
-int sys_readlink __P((struct proc *, void *, register_t *));
+int hpux_sys_readlink __P((struct proc *, void *, register_t *));
int sys_execve __P((struct proc *, void *, register_t *));
int sys_umask __P((struct proc *, void *, register_t *));
int sys_chroot __P((struct proc *, void *, register_t *));
@@ -398,12 +458,12 @@ int sys_fchown __P((struct proc *, void *, register_t *));
int sys_fchmod __P((struct proc *, void *, register_t *));
int hpux_sys_setresuid __P((struct proc *, void *, register_t *));
int hpux_sys_setresgid __P((struct proc *, void *, register_t *));
-int sys_rename __P((struct proc *, void *, register_t *));
-int compat_43_sys_truncate __P((struct proc *, void *, register_t *));
+int hpux_sys_rename __P((struct proc *, void *, register_t *));
+int hpux_sys_truncate __P((struct proc *, void *, register_t *));
int compat_43_sys_ftruncate __P((struct proc *, void *, register_t *));
int hpux_sys_sysconf __P((struct proc *, void *, register_t *));
-int sys_mkdir __P((struct proc *, void *, register_t *));
-int sys_rmdir __P((struct proc *, void *, register_t *));
+int hpux_sys_mkdir __P((struct proc *, void *, register_t *));
+int hpux_sys_rmdir __P((struct proc *, void *, register_t *));
int hpux_sys_getrlimit __P((struct proc *, void *, register_t *));
int hpux_sys_setrlimit __P((struct proc *, void *, register_t *));
int hpux_sys_rtprio __P((struct proc *, void *, register_t *));
diff --git a/sys/compat/hpux/hpux_syscalls.c b/sys/compat/hpux/hpux_syscalls.c
index 58930283148..2ee02aa86f3 100644
--- a/sys/compat/hpux/hpux_syscalls.c
+++ b/sys/compat/hpux/hpux_syscalls.c
@@ -2,7 +2,7 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.8 1995/10/07 06:26:42 mycroft Exp
+ * created from NetBSD: syscalls.master,v 1.9 1995/11/28 08:39:56 thorpej Exp
*/
char *hpux_syscallnames[] = {
@@ -19,42 +19,42 @@ char *hpux_syscallnames[] = {
"unlink", /* 10 = unlink */
"execv", /* 11 = execv */
"chdir", /* 12 = chdir */
- "compat_hpux_6x_time", /* 13 = compat_hpux_6x time */
+ "time_6x", /* 13 = time_6x */
"mknod", /* 14 = mknod */
"chmod", /* 15 = chmod */
"chown", /* 16 = chown */
"obreak", /* 17 = obreak */
- "compat_hpux_6x_stat", /* 18 = compat_hpux_6x stat */
+ "stat_6x", /* 18 = stat_6x */
"lseek", /* 19 = lseek */
"getpid", /* 20 = getpid */
"#21 (unimplemented mount)", /* 21 = unimplemented mount */
"#22 (unimplemented umount)", /* 22 = unimplemented umount */
"setuid", /* 23 = setuid */
"getuid", /* 24 = getuid */
- "compat_hpux_6x_stime", /* 25 = compat_hpux_6x stime */
+ "stime_6x", /* 25 = stime_6x */
"ptrace", /* 26 = ptrace */
- "compat_hpux_6x_alarm", /* 27 = compat_hpux_6x alarm */
- "compat_hpux_6x_fstat", /* 28 = compat_hpux_6x fstat */
- "compat_hpux_6x_pause", /* 29 = compat_hpux_6x pause */
- "compat_hpux_6x_utime", /* 30 = compat_hpux_6x utime */
- "compat_hpux_6x_stty", /* 31 = compat_hpux_6x stty */
- "compat_hpux_6x_gtty", /* 32 = compat_hpux_6x gtty */
+ "alarm_6x", /* 27 = alarm_6x */
+ "fstat_6x", /* 28 = fstat_6x */
+ "pause_6x", /* 29 = pause_6x */
+ "utime_6x", /* 30 = utime_6x */
+ "stty_6x", /* 31 = stty_6x */
+ "gtty_6x", /* 32 = gtty_6x */
"access", /* 33 = access */
- "compat_hpux_6x_nice", /* 34 = compat_hpux_6x nice */
- "compat_hpux_6x_ftime", /* 35 = compat_hpux_6x ftime */
+ "nice_6x", /* 34 = nice_6x */
+ "ftime_6x", /* 35 = ftime_6x */
"sync", /* 36 = sync */
"kill", /* 37 = kill */
"stat", /* 38 = stat */
- "compat_hpux_6x_setpgrp", /* 39 = compat_hpux_6x setpgrp */
+ "setpgrp_6x", /* 39 = setpgrp_6x */
"lstat", /* 40 = lstat */
"dup", /* 41 = dup */
"pipe", /* 42 = pipe */
- "compat_hpux_6x_times", /* 43 = compat_hpux_6x times */
+ "times_6x", /* 43 = times_6x */
"profil", /* 44 = profil */
"#45 (unimplemented ki_syscall)", /* 45 = unimplemented ki_syscall */
"setgid", /* 46 = setgid */
"getgid", /* 47 = getgid */
- "compat_hpux_6x_ssig", /* 48 = compat_hpux_6x ssig */
+ "ssig_6x", /* 48 = ssig_6x */
"#49 (unimplemented reserved for USG)", /* 49 = unimplemented reserved for USG */
"#50 (unimplemented reserved for USG)", /* 50 = unimplemented reserved for USG */
"#51 (unimplemented acct)", /* 51 = unimplemented acct */
diff --git a/sys/compat/hpux/hpux_sysent.c b/sys/compat/hpux/hpux_sysent.c
index bad0ac8abd6..22e9507d10d 100644
--- a/sys/compat/hpux/hpux_sysent.c
+++ b/sys/compat/hpux/hpux_sysent.c
@@ -2,23 +2,18 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.8 1995/10/07 06:26:42 mycroft Exp
+ * created from NetBSD: syscalls.master,v 1.9 1995/11/28 08:39:56 thorpej Exp
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
+#include <sys/exec.h>
#include <sys/syscallargs.h>
#include <compat/hpux/hpux.h>
#include <compat/hpux/hpux_syscallargs.h>
-#ifdef COMPAT_HPUX_6X
-#define compat_hpux_6x(func) __CONCAT(compat_hpux_6x_,func)
-#else
-#define compat_hpux_6x(func) sys_nosys
-#endif
-
#define s(type) sizeof(type)
struct sysent hpux_sysent[] = {
@@ -42,24 +37,24 @@ struct sysent hpux_sysent[] = {
hpux_sys_creat }, /* 8 = creat */
{ 2, s(struct sys_link_args),
sys_link }, /* 9 = link */
- { 1, s(struct sys_unlink_args),
- sys_unlink }, /* 10 = unlink */
+ { 1, s(struct hpux_sys_unlink_args),
+ hpux_sys_unlink }, /* 10 = unlink */
{ 2, s(struct hpux_sys_execv_args),
hpux_sys_execv }, /* 11 = execv */
- { 1, s(struct sys_chdir_args),
- sys_chdir }, /* 12 = chdir */
- { 1, s(struct compat_hpux_6x_sys_time_args),
- compat_hpux_6x(sys_time) }, /* 13 = compat_hpux_6x time */
- { 3, s(struct sys_mknod_args),
- sys_mknod }, /* 14 = mknod */
- { 2, s(struct sys_chmod_args),
- sys_chmod }, /* 15 = chmod */
- { 3, s(struct sys_chown_args),
- sys_chown }, /* 16 = chown */
+ { 1, s(struct hpux_sys_chdir_args),
+ hpux_sys_chdir }, /* 12 = chdir */
+ { 1, s(struct hpux_sys_time_6x_args),
+ hpux_sys_time_6x }, /* 13 = time_6x */
+ { 3, s(struct hpux_sys_mknod_args),
+ hpux_sys_mknod }, /* 14 = mknod */
+ { 2, s(struct hpux_sys_chmod_args),
+ hpux_sys_chmod }, /* 15 = chmod */
+ { 3, s(struct hpux_sys_chown_args),
+ hpux_sys_chown }, /* 16 = chown */
{ 1, s(struct sys_obreak_args),
sys_obreak }, /* 17 = obreak */
- { 2, s(struct compat_hpux_6x_sys_stat_args),
- compat_hpux_6x(sys_stat) }, /* 18 = compat_hpux_6x stat */
+ { 2, s(struct hpux_sys_stat_6x_args),
+ hpux_sys_stat_6x }, /* 18 = stat_6x */
{ 3, s(struct compat_43_sys_lseek_args),
compat_43_sys_lseek }, /* 19 = lseek */
{ 0, 0,
@@ -72,28 +67,28 @@ struct sysent hpux_sysent[] = {
sys_setuid }, /* 23 = setuid */
{ 0, 0,
sys_getuid }, /* 24 = getuid */
- { 1, s(struct compat_hpux_6x_sys_stime_args),
- compat_hpux_6x(sys_stime) }, /* 25 = compat_hpux_6x stime */
+ { 1, s(struct hpux_sys_stime_6x_args),
+ hpux_sys_stime_6x }, /* 25 = stime_6x */
{ 4, s(struct hpux_sys_ptrace_args),
hpux_sys_ptrace }, /* 26 = ptrace */
- { 1, s(struct compat_hpux_6x_sys_alarm_args),
- compat_hpux_6x(sys_alarm) }, /* 27 = compat_hpux_6x alarm */
- { 2, s(struct compat_hpux_6x_sys_fstat_args),
- compat_hpux_6x(sys_fstat) }, /* 28 = compat_hpux_6x fstat */
- { 0, 0,
- compat_hpux_6x(sys_pause) }, /* 29 = compat_hpux_6x pause */
- { 2, s(struct compat_hpux_6x_sys_utime_args),
- compat_hpux_6x(sys_utime) }, /* 30 = compat_hpux_6x utime */
- { 2, s(struct compat_hpux_6x_sys_stty_args),
- compat_hpux_6x(sys_stty) }, /* 31 = compat_hpux_6x stty */
- { 2, s(struct compat_hpux_6x_sys_gtty_args),
- compat_hpux_6x(sys_gtty) }, /* 32 = compat_hpux_6x gtty */
- { 2, s(struct sys_access_args),
- sys_access }, /* 33 = access */
- { 1, s(struct compat_hpux_6x_sys_nice_args),
- compat_hpux_6x(sys_nice) }, /* 34 = compat_hpux_6x nice */
- { 1, s(struct compat_hpux_6x_sys_ftime_args),
- compat_hpux_6x(sys_ftime) }, /* 35 = compat_hpux_6x ftime */
+ { 1, s(struct hpux_sys_alarm_6x_args),
+ hpux_sys_alarm_6x }, /* 27 = alarm_6x */
+ { 2, s(struct hpux_sys_fstat_6x_args),
+ hpux_sys_fstat_6x }, /* 28 = fstat_6x */
+ { 0, 0,
+ hpux_sys_pause_6x }, /* 29 = pause_6x */
+ { 2, s(struct hpux_sys_utime_6x_args),
+ hpux_sys_utime_6x }, /* 30 = utime_6x */
+ { 2, s(struct hpux_sys_stty_6x_args),
+ hpux_sys_stty_6x }, /* 31 = stty_6x */
+ { 2, s(struct hpux_sys_gtty_6x_args),
+ hpux_sys_gtty_6x }, /* 32 = gtty_6x */
+ { 2, s(struct hpux_sys_access_args),
+ hpux_sys_access }, /* 33 = access */
+ { 1, s(struct hpux_sys_nice_6x_args),
+ hpux_sys_nice_6x }, /* 34 = nice_6x */
+ { 1, s(struct hpux_sys_ftime_6x_args),
+ hpux_sys_ftime_6x }, /* 35 = ftime_6x */
{ 0, 0,
sys_sync }, /* 36 = sync */
{ 2, s(struct hpux_sys_kill_args),
@@ -101,15 +96,15 @@ struct sysent hpux_sysent[] = {
{ 2, s(struct hpux_sys_stat_args),
hpux_sys_stat }, /* 38 = stat */
{ 0, 0,
- compat_hpux_6x(sys_setpgrp) }, /* 39 = compat_hpux_6x setpgrp */
+ hpux_sys_setpgrp_6x }, /* 39 = setpgrp_6x */
{ 2, s(struct hpux_sys_lstat_args),
hpux_sys_lstat }, /* 40 = lstat */
{ 1, s(struct hpux_sys_dup_args),
hpux_sys_dup }, /* 41 = dup */
{ 0, 0,
sys_pipe }, /* 42 = pipe */
- { 1, s(struct compat_hpux_6x_sys_times_args),
- compat_hpux_6x(sys_times) }, /* 43 = compat_hpux_6x times */
+ { 1, s(struct hpux_sys_times_6x_args),
+ hpux_sys_times_6x }, /* 43 = times_6x */
{ 4, s(struct sys_profil_args),
sys_profil }, /* 44 = profil */
{ 0, 0,
@@ -118,8 +113,8 @@ struct sysent hpux_sysent[] = {
sys_setgid }, /* 46 = setgid */
{ 0, 0,
sys_getgid }, /* 47 = getgid */
- { 2, s(struct compat_hpux_6x_sys_ssig_args),
- compat_hpux_6x(sys_ssig) }, /* 48 = compat_hpux_6x ssig */
+ { 2, s(struct hpux_sys_ssig_6x_args),
+ hpux_sys_ssig_6x }, /* 48 = ssig_6x */
{ 0, 0,
sys_nosys }, /* 49 = unimplemented reserved for USG */
{ 0, 0,
@@ -134,12 +129,12 @@ struct sysent hpux_sysent[] = {
hpux_sys_ioctl }, /* 54 = ioctl */
{ 0, 0,
sys_nosys }, /* 55 = unimplemented reboot */
- { 2, s(struct sys_symlink_args),
- sys_symlink }, /* 56 = symlink */
+ { 2, s(struct hpux_sys_symlink_args),
+ hpux_sys_symlink }, /* 56 = symlink */
{ 3, s(struct hpux_sys_utssys_args),
hpux_sys_utssys }, /* 57 = utssys */
- { 3, s(struct sys_readlink_args),
- sys_readlink }, /* 58 = readlink */
+ { 3, s(struct hpux_sys_readlink_args),
+ hpux_sys_readlink }, /* 58 = readlink */
{ 3, s(struct sys_execve_args),
sys_execve }, /* 59 = execve */
{ 1, s(struct sys_umask_args),
@@ -278,10 +273,10 @@ struct sysent hpux_sysent[] = {
hpux_sys_setresuid }, /* 126 = setresuid */
{ 3, s(struct hpux_sys_setresgid_args),
hpux_sys_setresgid }, /* 127 = setresgid */
- { 2, s(struct sys_rename_args),
- sys_rename }, /* 128 = rename */
- { 2, s(struct compat_43_sys_truncate_args),
- compat_43_sys_truncate }, /* 129 = truncate */
+ { 2, s(struct hpux_sys_rename_args),
+ hpux_sys_rename }, /* 128 = rename */
+ { 2, s(struct hpux_sys_truncate_args),
+ hpux_sys_truncate }, /* 129 = truncate */
{ 2, s(struct compat_43_sys_ftruncate_args),
compat_43_sys_ftruncate }, /* 130 = ftruncate */
{ 0, 0,
@@ -294,10 +289,10 @@ struct sysent hpux_sysent[] = {
sys_nosys }, /* 134 = unimplemented */
{ 0, 0,
sys_nosys }, /* 135 = unimplemented */
- { 2, s(struct sys_mkdir_args),
- sys_mkdir }, /* 136 = mkdir */
- { 1, s(struct sys_rmdir_args),
- sys_rmdir }, /* 137 = rmdir */
+ { 2, s(struct hpux_sys_mkdir_args),
+ hpux_sys_mkdir }, /* 136 = mkdir */
+ { 1, s(struct hpux_sys_rmdir_args),
+ hpux_sys_rmdir }, /* 137 = rmdir */
{ 0, 0,
sys_nosys }, /* 138 = unimplemented */
{ 0, 0,
diff --git a/sys/compat/hpux/hpux_tty.c b/sys/compat/hpux/hpux_tty.c
index d95e1731b5f..505e00b2481 100644
--- a/sys/compat/hpux/hpux_tty.c
+++ b/sys/compat/hpux/hpux_tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpux_tty.c,v 1.11 1995/10/07 06:26:40 mycroft Exp $ */
+/* $NetBSD: hpux_tty.c,v 1.13 1995/12/11 16:32:46 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -459,7 +459,7 @@ int
hpuxtobsdbaud(hpux_speed)
int hpux_speed;
{
- static char hpuxtobsdbaudtab[32] = {
+ static int hpuxtobsdbaudtab[32] = {
B0, B50, B75, B110, B134, B150, B200, B300,
B600, B0, B1200, B1800, B2400, B0, B4800, B0,
B9600, B19200, B38400, B0, B0, B0, B0, B0,
@@ -469,26 +469,30 @@ hpuxtobsdbaud(hpux_speed)
return(hpuxtobsdbaudtab[hpux_speed & TIO_CBAUD]);
}
-#ifdef COMPAT_HPUX_6X
-
int
-compat_hpux_6x_sys_gtty(p, v, retval)
+hpux_sys_stty_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct compat_hpux_6x_sys_gtty_args *uap = v;
+ struct hpux_sys_stty_6x_args /* {
+ syscallarg(int) fd;
+ syscallarg(caddr_t) arg;
+ } */ *uap = v;
return (getsettty(p, SCARG(uap, fd), HPUXTIOCGETP, SCARG(uap, arg)));
}
int
-compat_hpux_6x_sys_stty(p, v, retval)
+hpux_sys_gtty_6x(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct compat_hpux_6x_sys_stty_args *uap = v;
+ struct hpux_sys_gtty_6x_args /* {
+ syscallarg(int) fd;
+ syscallarg(caddr_t) arg;
+ } */ *uap = v;
return (getsettty(p, SCARG(uap, fd), HPUXTIOCSETP, SCARG(uap, arg)));
}
@@ -545,4 +549,3 @@ getsettty(p, fdes, com, cmarg)
}
return (error);
}
-#endif
diff --git a/sys/compat/hpux/hpux_util.h b/sys/compat/hpux/hpux_util.h
index bd59abddaac..319a2e57923 100644
--- a/sys/compat/hpux/hpux_util.h
+++ b/sys/compat/hpux/hpux_util.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hpux_util.h,v 1.2 1995/06/24 20:17:57 christos Exp $ */
+/* $NetBSD: hpux_util.h,v 1.3 1995/12/08 07:45:34 thorpej Exp $ */
/*
* Copyright (c) 1995 Christos Zoulas
@@ -32,6 +32,14 @@
#include <compat/common/compat_util.h>
+extern const char hpux_emul_path[];
+
+#define HPUX_CHECK_ALT_EXIST(p, sgp, path) \
+ CHECK_ALT_EXIST(p, sgp, hpux_emul_path, path)
+
+#define HPUX_CHECK_ALT_CREAT(p, sgp, path) \
+ CHECK_ALT_CREAT(p, sgp, hpux_emul_path, path)
+
#ifdef DEBUG_HPUX
#define DPRINTF(a) printf a;
#else
diff --git a/sys/compat/hpux/syscalls.conf b/sys/compat/hpux/syscalls.conf
index 27cb8450905..15f32874734 100644
--- a/sys/compat/hpux/syscalls.conf
+++ b/sys/compat/hpux/syscalls.conf
@@ -1,10 +1,10 @@
-# $NetBSD: syscalls.conf,v 1.1 1995/05/10 16:45:46 christos Exp $
+# $NetBSD: syscalls.conf,v 1.2 1995/11/28 08:39:54 thorpej Exp $
sysnames="hpux_syscalls.c"
sysnumhdr="hpux_syscall.h"
syssw="hpux_sysent.c"
sysarghdr="hpux_syscallargs.h"
-compatopts="compat_hpux_6x"
+compatopts=""
libcompatopts=""
switchname="hpux_sysent"
diff --git a/sys/compat/hpux/syscalls.master b/sys/compat/hpux/syscalls.master
index aadc7871f9d..0c5c30f56f1 100644
--- a/sys/compat/hpux/syscalls.master
+++ b/sys/compat/hpux/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.8 1995/10/07 06:26:42 mycroft Exp $
+ $NetBSD: syscalls.master,v 1.9 1995/11/28 08:39:56 thorpej Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -35,6 +35,7 @@
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
+#include <sys/exec.h>
#include <sys/syscallargs.h>
#include <compat/hpux/hpux.h>
@@ -50,15 +51,16 @@
7 STD { int hpux_sys_wait(int *status); }
8 STD { int hpux_sys_creat(char *path, int mode); }
9 NOARGS { int sys_link(char *path, char *link); }
-10 NOARGS { int sys_unlink(char *path); }
+10 STD { int hpux_sys_unlink(char *path); }
11 STD { int hpux_sys_execv(char * path, char * * argp); }
-12 NOARGS { int sys_chdir(char *path); }
-13 COMPAT_HPUX_6X { int sys_time(time_t *t); }
-14 NOARGS { int sys_mknod(char *path, int mode, int dev); }
-15 NOARGS { int sys_chmod(char *path, int mode); }
-16 NOARGS { int sys_chown(char *path, int uid, int gid); }
+12 STD { int hpux_sys_chdir(char *path); }
+13 STD { int hpux_sys_time_6x(time_t *t); }
+14 STD { int hpux_sys_mknod(char *path, int mode, int dev); }
+15 STD { int hpux_sys_chmod(char *path, int mode); }
+16 STD { int hpux_sys_chown(char *path, int uid, int gid); }
17 NOARGS { int sys_obreak(char *nsize); }
-18 COMPAT_HPUX_6X { int sys_stat(char *path, struct hpux_ostat *sb); }
+18 STD { int hpux_sys_stat_6x(char *path, \
+ struct hpux_ostat *sb); }
19 NOARGS { long compat_43_sys_lseek(int fd, long offset, \
int whence); }
20 NOARGS { pid_t sys_getpid(void); }
@@ -66,33 +68,34 @@
22 UNIMPL umount
23 NOARGS { int sys_setuid(uid_t uid); }
24 NOARGS { uid_t sys_getuid(void); }
-25 COMPAT_HPUX_6X { int sys_stime(int time); }
+25 STD { int hpux_sys_stime_6x(int time); }
26 STD { int hpux_sys_ptrace(int req, int pid, int *addr, \
int data); }
-27 COMPAT_HPUX_6X { int sys_alarm(int deltat); }
-28 COMPAT_HPUX_6X { int sys_fstat(int fd, struct hpux_ostat *sb); }
-29 COMPAT_HPUX_6X { int sys_pause(void); }
-30 COMPAT_HPUX_6X { int sys_utime(char *fname, time_t *tptr); }
-31 COMPAT_HPUX_6X { int sys_stty(int fd, caddr_t arg); }
-32 COMPAT_HPUX_6X { int sys_gtty(int fd, caddr_t arg); }
-33 NOARGS { int sys_access(char *path, int flags); }
-34 COMPAT_HPUX_6X { int sys_nice(int nval); }
-35 COMPAT_HPUX_6X { int sys_ftime(struct hpux_timeb *tp); }
+27 STD { int hpux_sys_alarm_6x(int deltat); }
+28 STD { int hpux_sys_fstat_6x(int fd, \
+ struct hpux_ostat *sb); }
+29 STD { int hpux_sys_pause_6x(void); }
+30 STD { int hpux_sys_utime_6x(char *fname, time_t *tptr); }
+31 STD { int hpux_sys_stty_6x(int fd, caddr_t arg); }
+32 STD { int hpux_sys_gtty_6x(int fd, caddr_t arg); }
+33 STD { int hpux_sys_access(char *path, int flags); }
+34 STD { int hpux_sys_nice_6x(int nval); }
+35 STD { int hpux_sys_ftime_6x(struct hpux_timeb *tp); }
36 NOARGS { int sys_sync(void); }
37 STD { int hpux_sys_kill(pid_t pid, int signo); }
38 STD { int hpux_sys_stat(char *path, struct hpux_stat *sb); }
-39 COMPAT_HPUX_6X { int sys_setpgrp(void); }
+39 STD { int hpux_sys_setpgrp_6x(void); }
40 STD { int hpux_sys_lstat(char *path, struct hpux_stat *sb); }
41 STD { int hpux_sys_dup(int fd); }
42 NOARGS { int sys_pipe(void); }
-43 COMPAT_HPUX_6X { int sys_times(struct tms *tms); }
+43 STD { int hpux_sys_times_6x(struct tms *tms); }
44 NOARGS { int sys_profil(caddr_t samples, u_int size, \
u_int offset, u_int scale); }
45 UNIMPL ki_syscall
46 NOARGS { int sys_setgid(gid_t gid); }
47 NOARGS { gid_t sys_getgid(void); }
-48 COMPAT_HPUX_6X { int sys_ssig(int signo, sig_t fun); }
+48 STD { int hpux_sys_ssig_6x(int signo, sig_t fun); }
49 UNIMPL reserved for USG
50 UNIMPL reserved for USG
51 UNIMPL acct
@@ -100,10 +103,11 @@
53 UNIMPL
54 STD { int hpux_sys_ioctl(int fd, int com, caddr_t data); }
55 UNIMPL reboot
-56 NOARGS { int sys_symlink(char *path, char *link); }
+56 STD { int hpux_sys_symlink(char *path, char *link); }
57 STD { int hpux_sys_utssys(struct hpux_utsname *uts, \
int dev, int request); }
-58 NOARGS { int sys_readlink(char *path, char *buf, int count); }
+58 STD { int hpux_sys_readlink(char *path, char *buf, \
+ int count); }
59 NOARGS { int sys_execve(char *path, char **argp, \
char **envp); }
60 NOARGS { int sys_umask(int newmask); }
@@ -185,16 +189,16 @@
125 UNIMPL
126 STD { int hpux_sys_setresuid(uid_t r, uid_t e, uid_t s); }
127 STD { int hpux_sys_setresgid(gid_t r, gid_t e, gid_t s); }
-128 NOARGS { int sys_rename(char *from, char *to); }
-129 NOARGS { int compat_43_sys_truncate(char *path, long length); }
+128 STD { int hpux_sys_rename(char *from, char *to); }
+129 STD { int hpux_sys_truncate(char *path, long length); }
130 NOARGS { int compat_43_sys_ftruncate(int fd, long length); }
131 UNIMPL
132 STD { int hpux_sys_sysconf(int name); }
133 UNIMPL
134 UNIMPL
135 UNIMPL
-136 NOARGS { int sys_mkdir(char *path, int mode); }
-137 NOARGS { int sys_rmdir(char *path); }
+136 STD { int hpux_sys_mkdir(char *path, int mode); }
+137 STD { int hpux_sys_rmdir(char *path); }
138 UNIMPL
139 UNIMPL
140 UNIMPL