latest Utah version
authorMike Hibler <hibler@ucbvax.Berkeley.EDU>
Mon, 28 Dec 1992 01:06:23 +0000 (17:06 -0800)
committerMike Hibler <hibler@ucbvax.Berkeley.EDU>
Mon, 28 Dec 1992 01:06:23 +0000 (17:06 -0800)
SCCS-vsn: sys/hp/hpux/syscalls.master 7.2
SCCS-vsn: sys/hp/hpux/hpux.h 7.8
SCCS-vsn: sys/hp/hpux/hpux_compat.c 7.33
SCCS-vsn: sys/hp/hpux/hpux_exec.h 7.4
SCCS-vsn: sys/hp/hpux/hpux_net.c 7.9
SCCS-vsn: sys/hp/hpux/hpux_tty.c 7.14

usr/src/sys/hp/hpux/hpux.h
usr/src/sys/hp/hpux/hpux_compat.c
usr/src/sys/hp/hpux/hpux_exec.h
usr/src/sys/hp/hpux/hpux_net.c
usr/src/sys/hp/hpux/hpux_tty.c
usr/src/sys/hp/hpux/syscalls.master

index 4367b63..b855ea4 100644 (file)
@@ -9,9 +9,9 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- * from: Utah $Hdr: hpux.h 1.19 92/01/20$
+ * from: Utah $Hdr: hpux.h 1.27 92/12/23$
  *
  *
- *     @(#)hpux.h      7.7 (Berkeley) %G%
+ *     @(#)hpux.h      7.8 (Berkeley) %G%
  */
 
 #include <hp/hpux/hpux_exec.h>
  */
 
 #include <hp/hpux/hpux_exec.h>
@@ -193,3 +193,11 @@ struct hpuxsigaction {
 #define HPUX_SYSCONF_CPUM040   0x20E
 #define HPUX_SYSCONF_CPUPA10   0x20B
 #define HPUX_SYSCONF_CPUPA11   0x210
 #define HPUX_SYSCONF_CPUM040   0x20E
 #define HPUX_SYSCONF_CPUPA10   0x20B
 #define HPUX_SYSCONF_CPUPA11   0x210
+
+/* mmap stuff */
+#define HPUXMAP_FIXED  0x04
+#define HPUXMAP_REPLACE        0x08
+#define HPUXMAP_ANON   0x10
+
+/* rlimit stuff */
+#define HPUXRLIMIT_NOFILE      6
index ee41fb6..c1c92e1 100644 (file)
@@ -9,9 +9,9 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- * from: Utah $Hdr: hpux_compat.c 1.43 92/04/23$
+ * from: Utah $Hdr: hpux_compat.c 1.55 92/12/26$
  *
  *
- *     @(#)hpux_compat.c       7.32 (Berkeley) %G%
+ *     @(#)hpux_compat.c       7.33 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #include <sys/mount.h>
 #include <sys/ipc.h>
 #include <sys/user.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 <machine/cpu.h>
 #include <machine/reg.h>
 #include <machine/psl.h>
 #include <machine/vmparam.h>
-
 #include <hp/hpux/hpux.h>
 #include <hp/hpux/hpux_termio.h>
 
 #include <hp/hpux/hpux.h>
 #include <hp/hpux/hpux_termio.h>
 
@@ -54,7 +54,7 @@ int unimpresponse = 0;
 
 /* SYS5 style UTSNAME info */
 struct hpuxutsname protoutsname = {
 
 /* SYS5 style UTSNAME info */
 struct hpuxutsname protoutsname = {
-       "4.4bsd", "", "2.0", "B", "9000/3?0", ""
+       "4.4bsd", "", "0.5", "B", "9000/3?0", ""
 };
 
 /* 6.0 and later style context */
 };
 
 /* 6.0 and later style context */
@@ -521,6 +521,11 @@ hpuxutssys(p, uap, retval)
                case HP_380:
                        protoutsname.machine[6] = '8';
                        break;
                case HP_380:
                        protoutsname.machine[6] = '8';
                        break;
+               case HP_433:
+                       protoutsname.machine[5] = '4';
+                       protoutsname.machine[6] = '3';
+                       protoutsname.machine[7] = '3';
+                       break;
                }
                /* copy hostname (sans domain) to nodename */
                for (i = 0; i < 8 && hostname[i] != '.'; i++)
                }
                /* copy hostname (sans domain) to nodename */
                for (i = 0; i < 8 && hostname[i] != '.'; i++)
@@ -580,6 +585,7 @@ hpuxsysconf(p, uap, retval)
                        *retval = HPUX_SYSCONF_CPUM030;
                        break;
                case HP_380:
                        *retval = HPUX_SYSCONF_CPUM030;
                        break;
                case HP_380:
+               case HP_433:
                        *retval = HPUX_SYSCONF_CPUM040;
                        break;
                }
                        *retval = HPUX_SYSCONF_CPUM040;
                        break;
                }
@@ -752,7 +758,7 @@ hpuxadvise(p, uap, retval)
 
        switch (uap->arg) {
        case 0:
 
        switch (uap->arg) {
        case 0:
-               p->p_addr->u_pcb.pcb_flags |= PCB_HPUXMMAP;
+               p->p_md.md_flags |= MDP_HPUXMMAP;
                break;
        case 1:
                ICIA();
                break;
        case 1:
                ICIA();
@@ -778,16 +784,54 @@ hpuxptrace(p, uap, retval)
        struct hpuxptrace_args *uap;
        int *retval;
 {
        struct hpuxptrace_args *uap;
        int *retval;
 {
-       int error;
+       int error, isps = 0;
+       struct proc *cp;
 
 
-       if (uap->req == PT_STEP || uap->req == PT_CONTINUE) {
+       switch (uap->req) {
+       /* map signal */
+       case PT_STEP:
+       case PT_CONTINUE:
                if (uap->data) {
                        uap->data = hpuxtobsdsig(uap->data);
                        if (uap->data == 0)
                                uap->data = NSIG;
                }
                if (uap->data) {
                        uap->data = hpuxtobsdsig(uap->data);
                        if (uap->data == 0)
                                uap->data = NSIG;
                }
+               break;
+       /* map u-area offset */
+       case PT_READ_U:
+       case PT_WRITE_U:
+               /*
+                * Big, cheezy hack: hpuxtobsduoff is really intended
+                * to be called in the child context (procxmt) but we
+                * do it here in the parent context to avoid hacks in
+                * the MI sys_process.c file.  This works only because
+                * we can access the child's md_regs pointer and it
+                * has the correct value (the child has already trapped
+                * into the kernel).
+                */
+               if ((cp = pfind(uap->pid)) == 0)
+                       return (ESRCH);
+               uap->addr = (int *) hpuxtobsduoff(uap->addr, &isps, cp);
+
+               /*
+                * Since HP-UX PS is only 16-bits in ar0, requests
+                * to write PS actually contain the PS in the high word
+                * and the high half of the PC (the following register)
+                * in the low word.  Move the PS value to where BSD
+                * expects it.
+                */
+               if (isps && uap->req == PT_WRITE_U)
+                       uap->data >>= 16;
+               break;
        }
        error = ptrace(p, uap, retval);
        }
        error = ptrace(p, uap, retval);
+       /*
+        * Align PS as HP-UX expects it (see WRITE_U comment above).
+        * Note that we do not return the high part of PC like HP-UX
+        * would, but the HP-UX debuggers don't require it.
+        */
+       if (isps && error == 0 && uap->req == PT_READ_U)
+               *retval <<= 16;
        return (error);
 }
 
        return (error);
 }
 
@@ -928,6 +972,46 @@ hpuxsemop(p, uap, retval)
        return (0);
 }
 
        return (0);
 }
 
+/*
+ * HP-UX mmap() emulation (mainly for shared library support).
+ */
+struct hpuxmmap_args {
+       caddr_t addr;
+       int     len;
+       int     prot;
+       int     flags;
+       int     fd;
+       long    pos;
+};
+hpuxmmap(p, uap, retval)
+       struct proc *p;
+       struct hpuxmmap_args *uap;
+       int *retval;
+{
+       struct mmap_args {
+               caddr_t addr;
+               int     len;
+               int     prot;
+               int     flags;
+               int     fd;
+               long    pad;
+               off_t   pos;
+       } nargs;
+
+       nargs.addr = uap->addr;
+       nargs.len = uap->len;
+       nargs.prot = uap->prot;
+       nargs.flags = uap->flags &
+               ~(HPUXMAP_FIXED|HPUXMAP_REPLACE|HPUXMAP_ANON);
+       if (uap->flags & HPUXMAP_FIXED)
+               nargs.flags |= MAP_FIXED;
+       if (uap->flags & HPUXMAP_ANON)
+               nargs.flags |= MAP_ANON;
+       nargs.fd = (nargs.flags & MAP_ANON) ? -1 : uap->fd;
+       nargs.pos = uap->pos;
+       return (smmap(p, &nargs, retval));
+}
+
 /* convert from BSD to HP-UX errno */
 bsdtohpuxerrno(err)
        int err;
 /* convert from BSD to HP-UX errno */
 bsdtohpuxerrno(err)
        int err;
@@ -990,6 +1074,8 @@ bsdtohpuxstat(sb, hsb)
        ds.hst_nlink = sb->st_nlink;
        ds.hst_uid = (u_short)sb->st_uid;
        ds.hst_gid = (u_short)sb->st_gid;
        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
        /* XXX: I don't want to talk about it... */
        if ((sb->st_mode & S_IFMT) == S_IFCHR) {
 #if NGRF > 0
@@ -1001,8 +1087,7 @@ bsdtohpuxstat(sb, hsb)
                        ds.hst_rdev = hildevno(sb->st_rdev);
 #endif
                ;
                        ds.hst_rdev = hildevno(sb->st_rdev);
 #endif
                ;
-       } else
-               ds.hst_rdev = bsdtohpuxdev(sb->st_rdev);
+       }
        if (sb->st_size < (quad_t)1 << 32)
                ds.hst_size = (long)sb->st_size;
        else
        if (sb->st_size < (quad_t)1 << 32)
                ds.hst_size = (long)sb->st_size;
        else
@@ -1355,6 +1440,34 @@ hpuxsetresgid(p, uap, retval)
        return (0);
 }
 
        return (0);
 }
 
+struct hpuxrlimit_args {
+       u_int   which;
+       struct  orlimit *rlp;
+};
+hpuxgetrlimit(p, uap, retval)
+       struct proc *p;
+       struct hpuxrlimit_args *uap;
+       int *retval;
+{
+       if (uap->which > HPUXRLIMIT_NOFILE)
+               return (EINVAL);
+       if (uap->which == HPUXRLIMIT_NOFILE)
+               uap->which = RLIMIT_NOFILE;
+       return (getrlimit(p, uap, retval));
+}
+
+hpuxsetrlimit(p, uap, retval)
+       struct proc *p;
+       struct hpuxrlimit_args *uap;
+       int *retval;
+{
+       if (uap->which > HPUXRLIMIT_NOFILE)
+               return (EINVAL);
+       if (uap->which == HPUXRLIMIT_NOFILE)
+               uap->which = RLIMIT_NOFILE;
+       return (setrlimit(p, uap, retval));
+}
+
 /*
  * XXX: simple recognition hack to see if we can make grmd work.
  */
 /*
  * XXX: simple recognition hack to see if we can make grmd work.
  */
@@ -1477,11 +1590,6 @@ hpuxgetaccess(p, uap, retval)
        return (error);
 }
 
        return (error);
 }
 
-/*
- * Brutal hack!  Map HP-UX u-area offsets into BSD u offsets.
- * No apologies offered, if you don't like it, rewrite it!
- */
-
 extern char kstack[];
 #define UOFF(f)                ((int)&((struct user *)0)->f)
 #define HPUOFF(f)      ((int)&((struct hpuxuser *)0)->f)
 extern char kstack[];
 #define UOFF(f)                ((int)&((struct user *)0)->f)
 #define HPUOFF(f)      ((int)&((struct hpuxuser *)0)->f)
@@ -1493,20 +1601,26 @@ struct bsdfp {
        int ctrl[3];
 };
 
        int ctrl[3];
 };
 
-hpuxtobsduoff(off)
-       int *off;
+/*
+ * Brutal hack!  Map HP-UX u-area offsets into BSD k-stack offsets.
+ */
+hpuxtobsduoff(off, isps, p)
+       int *off, *isps;
+       struct proc *p;
 {
 {
-       register int *ar0 = curproc->p_md.md_regs;
+       register int *ar0 = p->p_md.md_regs;
        struct hpuxfp *hp;
        struct bsdfp *bp;
        register u_int raddr;
 
        struct hpuxfp *hp;
        struct bsdfp *bp;
        register u_int raddr;
 
+       *isps = 0;
+
        /* u_ar0 field; procxmt puts in U_ar0 */
        if ((int)off == HPUOFF(hpuxu_ar0))
                return(UOFF(U_ar0));
 
 #ifdef FPCOPROC
        /* u_ar0 field; procxmt puts in U_ar0 */
        if ((int)off == HPUOFF(hpuxu_ar0))
                return(UOFF(U_ar0));
 
 #ifdef FPCOPROC
-       /* 68881 registers from PCB */
+       /* FP registers from PCB */
        hp = (struct hpuxfp *)HPUOFF(hpuxu_fp);
        bp = (struct bsdfp *)UOFF(u_pcb.pcb_fpregs);
        if (off >= hp->hpfp_ctrl && off < &hp->hpfp_ctrl[3])
        hp = (struct hpuxfp *)HPUOFF(hpuxu_fp);
        bp = (struct bsdfp *)UOFF(u_pcb.pcb_fpregs);
        if (off >= hp->hpfp_ctrl && off < &hp->hpfp_ctrl[3])
@@ -1524,7 +1638,7 @@ hpuxtobsduoff(off)
                off = (int *)((u_int)off + (u_int)kstack);
 
        /*
                off = (int *)((u_int)off + (u_int)kstack);
 
        /*
-        * 68020 registers.
+        * General registers.
         * We know that the HP-UX registers are in the same order as ours.
         * The only difference is that their PS is 2 bytes instead of a
         * padded 4 like ours throwing the alignment off.
         * We know that the HP-UX registers are in the same order as ours.
         * The only difference is that their PS is 2 bytes instead of a
         * padded 4 like ours throwing the alignment off.
@@ -1533,11 +1647,23 @@ hpuxtobsduoff(off)
                /*
                 * PS: return low word and high word of PC as HP-UX would
                 * (e.g. &u.u_ar0[16.5]).
                /*
                 * PS: return low word and high word of PC as HP-UX would
                 * (e.g. &u.u_ar0[16.5]).
+                *
+                * XXX we don't do this since HP-UX adb doesn't rely on
+                * it and passing such an offset to procxmt will cause
+                * it to fail anyway.  Instead, we just set the offset
+                * to PS and let hpuxptrace() shift up the value returned.
                 */
                 */
-               if (off == &ar0[PS])
+               if (off == &ar0[PS]) {
+#if 0
                        raddr = (u_int) &((short *)ar0)[PS*2+1];
                        raddr = (u_int) &((short *)ar0)[PS*2+1];
+#else
+                       raddr = (u_int) &ar0[(int)(off - ar0)];
+#endif
+                       *isps = 1;
+               }
                /*
                /*
-                * PC: off will be &u.u_ar0[16.5]
+                * PC: off will be &u.u_ar0[16.5] since HP-UX saved PS
+                * is only 16 bits.
                 */
                else if (off == (int *)&(((short *)ar0)[PS*2+1]))
                        raddr = (u_int) &ar0[PC];
                 */
                else if (off == (int *)&(((short *)ar0)[PS*2+1]))
                        raddr = (u_int) &ar0[PC];
@@ -1586,7 +1712,7 @@ hpuxdumpu(vp, cred)
         * only uses this information to verify that a particular
         * core file goes with a particular binary.
         */
         * only uses this information to verify that a particular
         * core file goes with a particular binary.
         */
-       bcopy((caddr_t)p->p_addr->u_pcb.pcb_exec,
+       bcopy((caddr_t)p->p_addr->u_md.md_exec,
              (caddr_t)&faku->hpuxu_exdata, sizeof (struct hpux_exec));
        /*
         * Adjust user's saved registers (on kernel stack) to reflect
              (caddr_t)&faku->hpuxu_exdata, sizeof (struct hpux_exec));
        /*
         * Adjust user's saved registers (on kernel stack) to reflect
@@ -1637,12 +1763,14 @@ hpuxdumpu(vp, cred)
  * and vfs_xxx.c as defined under "#ifdef COMPAT".  We replicate them here
  * to avoid HPUXCOMPAT dependencies in those files and to make sure that
  * HP-UX compatibility still works even when COMPAT is not defined.
  * and vfs_xxx.c as defined under "#ifdef COMPAT".  We replicate them here
  * to avoid HPUXCOMPAT 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.
  */
 #ifdef COMPAT_OHPUX
 
 #define HPUX_HZ        50
 
  */
 #ifdef COMPAT_OHPUX
 
 #define HPUX_HZ        50
 
-#include <sys/times.h>
+#include "sys/times.h"
 
 /* from old timeb.h */
 struct hpuxtimeb {
 
 /* from old timeb.h */
 struct hpuxtimeb {
@@ -1917,32 +2045,33 @@ ohpuxstat(p, uap, retval)
 
 int
 ohpuxstat1(vp, ub, p)
 
 int
 ohpuxstat1(vp, ub, p)
-       register struct vnode *vp;
+       struct vnode *vp;
        struct ohpuxstat *ub;
        struct proc *p;
 {
        struct ohpuxstat *ub;
        struct proc *p;
 {
-       struct ohpuxstat ds;
-       struct vattr vattr;
-       register int error;
+       struct ohpuxstat ohsb;
+       struct stat sb;
+       int error;
 
 
-       error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
+       error = vn_stat(vp, &sb, p);
        if (error)
        if (error)
-               return(error);
-       /*
-        * Copy from inode table
-        */
-       ds.ohst_dev = vattr.va_fsid;
-       ds.ohst_ino = (short)vattr.va_fileid;
-       ds.ohst_mode = (u_short)vattr.va_mode;
-       ds.ohst_nlink = vattr.va_nlink;
-       ds.ohst_uid = (short)vattr.va_uid;
-       ds.ohst_gid = (short)vattr.va_gid;
-       ds.ohst_rdev = (u_short)vattr.va_rdev;
-       ds.ohst_size = (int)vattr.va_size;
-       ds.ohst_atime = (int)vattr.va_atime.ts_sec;
-       ds.ohst_mtime = (int)vattr.va_mtime.ts_sec;
-       ds.ohst_ctime = (int)vattr.va_ctime.ts_sec;
-       return (copyout((caddr_t)&ds, (caddr_t)ub, sizeof(ds)));
+               return (error);
+
+       ohsb.ohst_dev = sb.st_dev;
+       ohsb.ohst_ino = sb.st_ino;
+       ohsb.ohst_mode = sb.st_mode;
+       ohsb.ohst_nlink = sb.st_nlink;
+       ohsb.ohst_uid = sb.st_uid;
+       ohsb.ohst_gid = sb.st_gid;
+       ohsb.ohst_rdev = sb.st_rdev;
+       if (sb.st_size < (quad_t)1 << 32)
+               ohsb.ohst_size = sb.st_size;
+       else
+               ohsb.ohst_size = -2;
+       ohsb.ohst_atime = sb.st_atime;
+       ohsb.ohst_mtime = sb.st_mtime;
+       ohsb.ohst_ctime = sb.st_ctime;
+       return (copyout((caddr_t)&ohsb, (caddr_t)ub, sizeof(ohsb)));
 }
 #endif
 #endif
 }
 #endif
 #endif
index 0490344..2b35859 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: hpux_exec.h 1.6 92/01/20$
  *
  *
  * from: Utah $Hdr: hpux_exec.h 1.6 92/01/20$
  *
- *     @(#)hpux_exec.h 7.3 (Berkeley) %G%
+ *     @(#)hpux_exec.h 7.4 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -33,9 +33,3 @@ unsigned long ha_pad3[4];     /* doesn't matter */
 #define        HPUXM_VALID     0x00000001
 #define HPUXM_STKWT    0x02000000
 #define HPUXM_DATAWT   0x04000000
 #define        HPUXM_VALID     0x00000001
 #define HPUXM_STKWT    0x02000000
 #define HPUXM_DATAWT   0x04000000
-
-/*
- * If the HPUX object file version number is BSDVNUM the file was built
- * with the HPUX SGS but linked with the BSD libraries.
- */
-#define BSDVNUM                0x2BAD
index 8456ebe..88f9ff9 100644 (file)
@@ -9,9 +9,9 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- * from: Utah $Hdr: hpux_net.c 1.33 89/08/23$
+ * from: Utah $Hdr: hpux_net.c 1.6 92/12/26$
  *
  *
- *     @(#)hpux_net.c  7.8 (Berkeley) %G%
+ *     @(#)hpux_net.c  7.9 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -73,12 +73,13 @@ struct hpuxtobsdipc {
  * Single system call entry to BSD style IPC.
  * Gleened from disassembled libbsdipc.a syscall entries.
  */
  * Single system call entry to BSD style IPC.
  * Gleened from disassembled libbsdipc.a syscall entries.
  */
+struct hpuxnetioctl_args {
+       int     call;
+       int     *args;
+};
 hpuxnetioctl(p, uap, retval)
        struct proc *p;
 hpuxnetioctl(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     call;
-               int     *args;
-       } *uap;
+       struct hpuxnetioctl_args *uap;
        int *retval;
 {
        int *args, i;
        int *retval;
 {
        int *args, i;
@@ -106,15 +107,42 @@ hpuxnetioctl(p, uap, retval)
        return ((*hpuxtobsdipc[code].rout)(p, uap, retval));
 }
 
        return ((*hpuxtobsdipc[code].rout)(p, uap, retval));
 }
 
+socksetsize(size, m)
+       int size;
+       struct mbuf *m;
+{
+       register int tmp;
+
+       if (size < sizeof(int)) {
+               switch(size) {
+               case 1:
+                       tmp = (int) *mtod(m, char *);
+                       break;
+               case 2:
+                       tmp = (int) *mtod(m, short *);
+                       break;
+               case 3:
+                       tmp = (((int) *mtod(m, int *)) >> 8) & 0xffffff;
+                       break;
+               }
+               *mtod(m, int *) = tmp;
+               m->m_len = sizeof(int);
+       } else {
+               m->m_len = size;
+       }
+}
+
+struct hpuxsetsockopt_args {
+       int     s;
+       int     level;
+       int     name;
+       caddr_t val;
+       int     valsize;
+};
+/* ARGSUSED */
 hpuxsetsockopt(p, uap, retval)
        struct proc *p;
 hpuxsetsockopt(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     s;
-               int     level;
-               int     name;
-               caddr_t val;
-               int     valsize;
-       } *uap;
+       struct hpuxsetsockopt_args *uap;
        int *retval;
 {
        struct file *fp;
        int *retval;
 {
        struct file *fp;
@@ -140,7 +168,7 @@ hpuxsetsockopt(p, uap, retval)
                        mtod(m, struct linger *)->l_linger = tmp;
                        m->m_len = sizeof(struct linger);
                } else
                        mtod(m, struct linger *)->l_linger = tmp;
                        m->m_len = sizeof(struct linger);
                } else
-                       m->m_len = uap->valsize;
+                       socksetsize(uap->valsize, m);
        } else if (uap->name == ~SO_LINGER) {
                m = m_get(M_WAIT, MT_SOOPTS);
                if (m) {
        } else if (uap->name == ~SO_LINGER) {
                m = m_get(M_WAIT, MT_SOOPTS);
                if (m) {
@@ -153,15 +181,52 @@ hpuxsetsockopt(p, uap, retval)
            uap->name, m));
 }
 
            uap->name, m));
 }
 
+struct hpuxsetsockopt2_args {
+       int     s;
+       int     level;
+       int     name;
+       caddr_t val;
+       int     valsize;
+};
+/* ARGSUSED */
+hpuxsetsockopt2(p, uap, retval)
+       struct proc *p;
+       register struct hpuxsetsockopt2_args *uap;
+       int *retval;
+{
+       struct file *fp;
+       struct mbuf *m = NULL;
+       int error;
+
+       if (error = getsock(p->p_fd, uap->s, &fp))
+               return (error);
+       if (uap->valsize > MLEN)
+               return (EINVAL);
+       if (uap->val) {
+               m = m_get(M_WAIT, MT_SOOPTS);
+               if (m == NULL)
+                       return (ENOBUFS);
+               if (error = copyin(uap->val, mtod(m, caddr_t),
+                   (u_int)uap->valsize)) {
+                       (void) m_free(m);
+                       return (error);
+               }
+               socksetsize(uap->valsize, m);
+       }
+       return (sosetopt((struct socket *)fp->f_data, uap->level,
+           uap->name, m));
+}
+
+struct hpuxgetsockopt_args {
+       int     s;
+       int     level;
+       int     name;
+       caddr_t val;
+       int     *avalsize;
+};
 hpuxgetsockopt(p, uap, retval)
        struct proc *p;
 hpuxgetsockopt(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     s;
-               int     level;
-               int     name;
-               caddr_t val;
-               int     *avalsize;
-       } *uap;
+       struct hpuxgetsockopt_args *uap;
        int *retval;
 {
        struct file *fp;
        int *retval;
 {
        struct file *fp;
index 3c3bb50..96856e4 100644 (file)
@@ -9,9 +9,9 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- * from: Utah $Hdr: hpux_tty.c 1.1 90/07/09$
+ * from: Utah $Hdr: hpux_tty.c 1.12 92/04/15$
  *
  *
- *     @(#)hpux_tty.c  7.13 (Berkeley) %G%
+ *     @(#)hpux_tty.c  7.14 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -397,12 +397,13 @@ hpuxtobsdbaud(hpuxspeed)
 }
 
 #ifdef COMPAT_OHPUX
 }
 
 #ifdef COMPAT_OHPUX
+struct ohpuxsgtty_args {
+       int     fdes;
+       caddr_t cmarg;
+};
 ohpuxgtty(p, uap, retval)
        struct proc *p;
 ohpuxgtty(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     fdes;
-               caddr_t cmarg;
-       } *uap;
+       struct ohpuxsgtty_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
@@ -411,10 +412,7 @@ ohpuxgtty(p, uap, retval)
 
 ohpuxstty(p, uap, retval)
        struct proc *p;
 
 ohpuxstty(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     fdes;
-               caddr_t cmarg;
-       } *uap;
+       struct ohpuxsgtty_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
index 405c5d2..23e7dcc 100644 (file)
@@ -1,6 +1,9 @@
-       @(#)syscalls.master     7.1 (Berkeley) %G%
-; System call name/number master file (or rather, slave, from SunOS).
-; Processed to created sun_sysent.c, sun_syscalls.c and sun_syscall.h.
+       @(#)syscalls.master     7.2 (Berkeley) %G%
+; System call name/number master file (or rather, slave, from HP-UX).
+; Processed to created hpux_sysent.c, hpux_syscalls.c and hpux_syscall.h.
+;
+; from:        Utah $Hdr: hpux_sysent.c 1.26 92/12/26$
+;
 
 ; Columns: number type nargs name altname/comments
 ;      number  system call number, must be in order
 
 ; Columns: number type nargs name altname/comments
 ;      number  system call number, must be in order
@@ -91,7 +94,7 @@
 68     STD     0 hpuxwrite vwrite
 69     UNIMPL  0 nosys
 70     UNIMPL  0 nosys
 68     STD     0 hpuxwrite vwrite
 69     UNIMPL  0 nosys
 70     UNIMPL  0 nosys
-71     UNIMPL  0 nosys
+71     STD     6 hpuxmmap mmap
 72     UNIMPL  0 nosys
 73     UNIMPL  0 nosys
 74     NOTIMPL 3 mprotect
 72     UNIMPL  0 nosys
 73     UNIMPL  0 nosys
 74     NOTIMPL 3 mprotect
 141    UNIMPL  0 nosys
 142    UNIMPL  0 nosys
 143    UNIMPL  0 nosys
 141    UNIMPL  0 nosys
 142    UNIMPL  0 nosys
 143    UNIMPL  0 nosys
-144    UNIMPL  0 nosys
-145    UNIMPL  0 nosys
+144    STD     2 getrlimit
+145    STD     2 setrlimit
 146    UNIMPL  0 nosys
 147    UNIMPL  0 nosys
 148    UNIMPL  0 nosys
 146    UNIMPL  0 nosys
 147    UNIMPL  0 nosys
 148    UNIMPL  0 nosys
 243    NOTIMPL 4 fsctl
 244    UNIMPL  0 nosys
 245    NOTIMPL 3 pstat
 243    NOTIMPL 4 fsctl
 244    UNIMPL  0 nosys
 245    NOTIMPL 3 pstat
+246    UNIMPL  0 nosys
+247    UNIMPL  0 nosys
+248    UNIMPL  0 nosys
+249    UNIMPL  0 nosys
+250    UNIMPL  0 nosys
+251    UNIMPL  0 nosys
+252    UNIMPL  0 nosys
+253    UNIMPL  0 nosys
+254    UNIMPL  0 nosys
+255    UNIMPL  0 nosys
+256    UNIMPL  0 nosys
+257    UNIMPL  0 nosys
+258    UNIMPL  0 nosys
+259    UNIMPL  0 nosys
+260    UNIMPL  0 nosys
+261    UNIMPL  0 nosys
+262    UNIMPL  0 nosys
+263    UNIMPL  0 nosys
+264    UNIMPL  0 nosys
+265    UNIMPL  0 nosys
+266    UNIMPL  0 nosys
+267    UNIMPL  0 nosys
+268    STD     0 getdtablesize getnumfds
+269    UNIMPL  0 nosys
+270    UNIMPL  0 nosys
+271    UNIMPL  0 nosys
+272    UNIMPL  0 nosys
+273    UNIMPL  0 nosys
+274    UNIMPL  0 nosys
+275    COMPAT  3 accept
+276    STD     3 bind
+277    STD     3 connect
+278    COMPAT  3 getpeername
+279    COMPAT  3 getsockname
+280    STD     5 getsockopt
+281    STD     2 listen
+282    COMPAT  4 recv
+283    COMPAT  6 recvfrom
+284    COMPAT  3 recvmsg
+285    COMPAT  4 send
+286    COMPAT  3 sendmsg
+287    STD     6 sendto
+288    STD     5 hpuxsetsockopt2 setsockopt2
+289    STD     2 shutdown
+290    STD     3 socket
+291    STD     4 socketpair