+/*
+ * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @(#)kern_sig.c 7.22 (Berkeley) %G%
+ */
+
+#include "param.h"
+#include "systm.h"
+#include "user.h"
+#include "vnode.h"
+#include "proc.h"
+#include "timeb.h"
+#include "times.h"
+#include "buf.h"
+#include "text.h"
+#include "seg.h"
+#include "vm.h"
+#include "acct.h"
+#include "uio.h"
+#include "file.h"
+#include "kernel.h"
+#include "wait.h"
+#include "ktrace.h"
+
+#include "machine/reg.h"
+#include "machine/pte.h"
+#include "machine/psl.h"
+#include "machine/mtpr.h"
+
+#define ttystopsigmask (sigmask(SIGTSTP)|sigmask(SIGTTIN)|sigmask(SIGTTOU))
+#define stopsigmask (sigmask(SIGSTOP)|ttystopsigmask)
+#define defaultignmask (sigmask(SIGCONT)|sigmask(SIGIO)|sigmask(SIGURG)| \
+ sigmask(SIGCHLD)|sigmask(SIGWINCH)|sigmask(SIGINFO))
+
+/*
+ * Can process p send the signal signo to process q?
+ */
+#define CANSIGNAL(p, q, signo) \
+ ((p)->p_uid == 0 || \
+ (p)->p_ruid == (q)->p_ruid || (p)->p_uid == (q)->p_ruid || \
+ (p)->p_ruid == (q)->p_uid || (p)->p_uid == (q)->p_uid || \
+ ((signo) == SIGCONT && (q)->p_session == (p)->p_session))
+
+/* ARGSUSED */
+sigaction(p, uap, retval)
+ struct proc *p;
+ register struct args {