BSD 4_4_Lite2 release
[unix-history] / usr / src / sys / hp / hpux / hpux_sig.c
index 3d35bd8..c2d8bec 100644 (file)
@@ -1,17 +1,43 @@
 /*
  * Copyright (c) 1988 University of Utah.
 /*
  * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * 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.
  *
  *
  * This code is derived from software contributed to Berkeley by
  * the Systems Programming Group of the University of Utah Computer
  * Science Department.
  *
- * %sccs.include.redist.c%
+ * 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_sig.c 1.4 92/01/20$
  *
  *
  * from: Utah $Hdr: hpux_sig.c 1.4 92/01/20$
  *
- *     @(#)hpux_sig.c  7.10 (Berkeley) %G%
+ *     @(#)hpux_sig.c  8.3 (Berkeley) 2/19/95
  */
 
 /*
  */
 
 /*
 
 #ifdef HPUXCOMPAT
 
 
 #ifdef HPUXCOMPAT
 
-#include "param.h"
-#include "systm.h"
-#include "kernel.h"
-#include "proc.h"
-#include "signalvar.h"
-#include "hpux.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/signalvar.h>
+
+#include <hp/hpux/hpux.h>
 
 /* indexed by HPUX signal number - 1 */
 char hpuxtobsdsigmap[NSIG] = {
 
 /* indexed by HPUX signal number - 1 */
 char hpuxtobsdsigmap[NSIG] = {
@@ -52,13 +79,14 @@ char bsdtohpuxsigmap[NSIG] = {
  * swell foop.  I suspect we can get away with this since I
  * doubt any program of interest mixes the two semantics.
  */
  * swell foop.  I suspect we can get away with this since I
  * doubt any program of interest mixes the two semantics.
  */
+struct hpuxsigvec_args {
+       int     signo;
+       struct  sigvec *nsv;
+       struct  sigvec *osv;
+};
 hpuxsigvec(p, uap, retval)
        struct proc *p;
 hpuxsigvec(p, uap, retval)
        struct proc *p;
-       register struct args {
-               int     signo;
-               struct  sigvec *nsv;
-               struct  sigvec *osv;
-       } *uap;
+       register struct hpuxsigvec_args *uap;
        int *retval;
 {
        struct sigvec vec;
        int *retval;
 {
        struct sigvec vec;
@@ -106,11 +134,12 @@ hpuxsigvec(p, uap, retval)
        return (0);
 }
 
        return (0);
 }
 
+struct hpuxsigblock_args {
+       int     mask;
+};
 hpuxsigblock(p, uap, retval)
        register struct proc *p;
 hpuxsigblock(p, uap, retval)
        register struct proc *p;
-       struct args {
-               int     mask;
-       } *uap;
+       struct hpuxsigblock_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
@@ -121,11 +150,12 @@ hpuxsigblock(p, uap, retval)
        return (0);
 }
 
        return (0);
 }
 
+struct hpuxsigsetmask_args {
+       int     mask;
+};
 hpuxsigsetmask(p, uap, retval)
        struct proc *p;
 hpuxsigsetmask(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     mask;
-       } *uap;
+       struct hpuxsigsetmask_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
@@ -136,11 +166,12 @@ hpuxsigsetmask(p, uap, retval)
        return (0);
 }
 
        return (0);
 }
 
+struct hpuxsigpause_args {
+       int     mask;
+};
 hpuxsigpause(p, uap, retval)
        struct proc *p;
 hpuxsigpause(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     mask;
-       } *uap;
+       struct hpuxsigpause_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
@@ -149,12 +180,13 @@ hpuxsigpause(p, uap, retval)
 }
 
 /* not totally correct, but close enuf' */
 }
 
 /* not totally correct, but close enuf' */
+struct hpuxkill_args {
+       int     pid;
+       int     signo;
+};
 hpuxkill(p, uap, retval)
        struct proc *p;
 hpuxkill(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     pid;
-               int     signo;
-       } *uap;
+       struct hpuxkill_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
@@ -178,13 +210,14 @@ hpuxkill(p, uap, retval)
  * and return old mask as return value;
  * the library stub does the rest.
  */
  * and return old mask as return value;
  * the library stub does the rest.
  */
+struct hpuxsigprocmask_args {
+       int             how;
+       hpuxsigset_t    *set;
+       hpuxsigset_t    *oset;
+};
 hpuxsigprocmask(p, uap, retval)
        register struct proc *p;
 hpuxsigprocmask(p, uap, retval)
        register struct proc *p;
-       struct args {
-               int             how;
-               hpuxsigset_t    *set;
-               hpuxsigset_t    *oset;
-       } *uap;
+       struct hpuxsigprocmask_args *uap;
        int *retval;
 {
        int mask, error = 0;
        int *retval;
 {
        int mask, error = 0;
@@ -224,24 +257,26 @@ hpuxsigprocmask(p, uap, retval)
        return (error);
 }
 
        return (error);
 }
 
+struct hpuxsigpending_args {
+       hpuxsigset_t    *set;
+};
 hpuxsigpending(p, uap, retval)
        register struct proc *p;
 hpuxsigpending(p, uap, retval)
        register struct proc *p;
-       struct args {
-               hpuxsigset_t    *set;
-       } *uap;
+       struct hpuxsigpending_args *uap;
        int *retval;
 {
        hpuxsigset_t sigset;
 
        int *retval;
 {
        hpuxsigset_t sigset;
 
-       sigset.sigset[0] = bsdtohpuxmask(p->p_sig);
+       sigset.sigset[0] = bsdtohpuxmask(p->p_siglist);
        return (copyout((caddr_t)&sigset, (caddr_t)uap->set, sizeof(sigset)));
 }
 
        return (copyout((caddr_t)&sigset, (caddr_t)uap->set, sizeof(sigset)));
 }
 
+struct hpuxsigsuspend_args {
+       hpuxsigset_t    *set;
+};
 hpuxsigsuspend(p, uap, retval)
        register struct proc *p;
 hpuxsigsuspend(p, uap, retval)
        register struct proc *p;
-       struct args {
-               hpuxsigset_t    *set;
-       } *uap;
+       struct hpuxsigsuspend_args *uap;
        int *retval;
 {
        register struct sigacts *ps = p->p_sigacts;
        int *retval;
 {
        register struct sigacts *ps = p->p_sigacts;
@@ -259,13 +294,14 @@ hpuxsigsuspend(p, uap, retval)
        return (EINTR);
 }
 
        return (EINTR);
 }
 
+struct hpuxsigaction_args {
+       int     signo;
+       struct  hpuxsigaction *nsa;
+       struct  hpuxsigaction *osa;
+};
 hpuxsigaction(p, uap, retval)
        struct proc *p;
 hpuxsigaction(p, uap, retval)
        struct proc *p;
-       register struct args {
-               int     signo;
-               struct  hpuxsigaction *nsa;
-               struct  hpuxsigaction *osa;
-       } *uap;
+       register struct hpuxsigaction_args *uap;
        int *retval;
 {
        struct hpuxsigaction action;
        int *retval;
 {
        struct hpuxsigaction action;
@@ -292,7 +328,7 @@ hpuxsigaction(p, uap, retval)
                if (p->p_flag & SOUSIG)
                        sa->sa_flags |= HPUXSA_RESETHAND;       /* XXX */
 #endif
                if (p->p_flag & SOUSIG)
                        sa->sa_flags |= HPUXSA_RESETHAND;       /* XXX */
 #endif
-               if (p->p_flag & SNOCLDSTOP)
+               if (p->p_flag & P_NOCLDSTOP)
                        sa->sa_flags |= HPUXSA_NOCLDSTOP;
                if (copyout((caddr_t)sa, (caddr_t)uap->osa, sizeof (action)))
                        return (EFAULT);
                        sa->sa_flags |= HPUXSA_NOCLDSTOP;
                if (copyout((caddr_t)sa, (caddr_t)uap->osa, sizeof (action)))
                        return (EFAULT);
@@ -324,12 +360,14 @@ hpuxsigaction(p, uap, retval)
        return (0);
 }
 
        return (0);
 }
 
-ohpuxssig(p, uap, retval)
+#ifdef COMPAT_OHPUX
+struct ohpuxssig_args {
+       int     signo;
+       sig_t   fun;
+};
+compat_43_hpuxssig(p, uap, retval)
        struct proc *p;
        struct proc *p;
-       struct args {
-               int     signo;
-               sig_t   fun;
-       } *uap;
+       struct ohpuxssig_args *uap;
        int *retval;
 {
        register int a;
        int *retval;
 {
        register int a;
@@ -360,6 +398,7 @@ ohpuxssig(p, uap, retval)
 #endif
        return (0);
 }
 #endif
        return (0);
 }
+#endif
 
 /* signal numbers: convert from HPUX to BSD */
 hpuxtobsdsig(sig)
 
 /* signal numbers: convert from HPUX to BSD */
 hpuxtobsdsig(sig)