Index: conf/files
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/conf/files,v
retrieving revision 1.20
diff -u -u -r1.20 files
--- conf/files	21 Oct 2003 01:05:09 -0000	1.20
+++ conf/files	23 Oct 2003 03:23:37 -0000
@@ -1583,3 +1583,4 @@
 emulation/43bsd/43bsd_socket.c		optional compat_43
 emulation/43bsd/43bsd_stats.c		optional compat_43
 emulation/43bsd/43bsd_file.c		optional compat_43
+emulation/43bsd/43bsd_signal.c		optional compat_43
Index: emulation/43bsd/43bsd_signal.c
===================================================================
RCS file: emulation/43bsd/43bsd_signal.c
diff -N emulation/43bsd/43bsd_signal.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ emulation/43bsd/43bsd_signal.c	23 Oct 2003 12:11:46 -0000
@@ -0,0 +1,171 @@
+/*
+ * 43BSD_SIGNAL.C	- 4.3BSD compatibility signal syscalls
+ *
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * $DragonFly$
+ * 	from: DragonFly kern/kern_sig.c,v 1.22
+ *
+ * These syscalls used to live in kern/kern_sig.c.  They are modified
+ * to use the new split syscalls.
+ */
+
+#include "opt_compat.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysproto.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/kern_syscall.h>
+#include <sys/proc.h>
+#include <sys/signal.h>
+#include <sys/signalvar.h>
+
+#define	ONSIG	32		/* NSIG for osig* syscalls.  XXX. */
+
+#define SIG2OSIG(sig, osig)	osig = (sig).__bits[0]
+#define OSIG2SIG(osig, sig)	SIGEMPTYSET(sig); (sig).__bits[0] = osig
+
+#define SIGSETLO(set1, set2)	((set1).__bits[0] = (set2).__bits[0])
+
+/*
+ * These syscalls are unncessary because it is next to impossible to
+ * find 4.3BSD binaries built for i386.  The current libc has routines
+ * which fake the 4.3BSD family of signal syscalls, so anything built
+ * from source won't be using these.
+ *
+ * This file is provided for educational purposes only.  The osigvec()
+ * syscall is probably broken because the current signal code uses
+ * a different signal trampoline.
+ */
+
+int
+osigvec(struct osigvec_args *uap)
+{
+	struct sigvec vec;
+	struct sigaction nsa, osa;
+	struct sigaction *nsap, *osap;
+	int error;
+
+	if (uap->signum <= 0 || uap->signum >= ONSIG)
+		return (EINVAL);
+	nsap = (uap->nsv != NULL) ? &nsa : NULL;
+	osap = (uap->osv != NULL) ? &osa : NULL;
+	if (nsap) {
+		error = copyin(uap->nsv, &vec, sizeof(vec));
+		if (error)
+			return (error);
+		nsap->sa_handler = vec.sv_handler;
+		OSIG2SIG(vec.sv_mask, nsap->sa_mask);
+		nsap->sa_flags = vec.sv_flags;
+		nsap->sa_flags ^= SA_RESTART;	/* opposite of SV_INTERRUPT */
+	}
+
+	error = kern_sigaction(uap->signum, nsap, osap);
+
+	if (osap && !error) {
+		vec.sv_handler = osap->sa_handler;
+		SIG2OSIG(osap->sa_mask, vec.sv_mask);
+		vec.sv_flags = osap->sa_flags;
+		vec.sv_flags &= ~SA_NOCLDWAIT;
+		vec.sv_flags ^= SA_RESTART;
+		error = copyout(&vec, uap->osv, sizeof(vec));
+	}
+	return (error);
+}
+
+int
+osigblock(struct osigblock_args *uap)
+{
+	struct proc *p = curproc;
+	sigset_t set;
+
+	OSIG2SIG(uap->mask, set);
+	SIG_CANTMASK(set);
+	(void) splhigh();
+	SIG2OSIG(p->p_sigmask, uap->sysmsg_result);
+	SIGSETOR(p->p_sigmask, set);
+	(void) spl0();
+	return (0);
+}
+
+int
+osigsetmask(struct osigsetmask_args *uap)
+{
+	struct proc *p = curproc;
+	sigset_t set;
+
+	OSIG2SIG(uap->mask, set);
+	SIG_CANTMASK(set);
+	(void) splhigh();
+	SIG2OSIG(p->p_sigmask, uap->sysmsg_result);
+	SIGSETLO(p->p_sigmask, set);
+	(void) spl0();
+	return (0);
+}
+
+int
+osigstack(struct osigstack_args *uap)
+{
+	struct proc *p = curproc;
+	struct sigstack ss;
+	int error = 0;
+
+	ss.ss_sp = p->p_sigstk.ss_sp;
+	ss.ss_onstack = p->p_sigstk.ss_flags & SS_ONSTACK;
+	if (uap->oss && (error = copyout(&ss, uap->oss,
+	    sizeof(struct sigstack))))
+		return (error);
+	if (uap->nss && (error = copyin(uap->nss, &ss, sizeof(ss))) == 0) {
+		p->p_sigstk.ss_sp = ss.ss_sp;
+		p->p_sigstk.ss_size = 0;
+		p->p_sigstk.ss_flags |= ss.ss_onstack & SS_ONSTACK;
+		p->p_flag |= P_ALTSTACK;
+	}
+	return (error);
+}
+
+int
+okillpg(struct okillpg_args *uap)
+{
+	int error;
+
+	error = kern_kill(uap->signum, -uap->pgid);
+
+	return (error);
+}
Index: emulation/linux/linux_signal.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/emulation/linux/linux_signal.c,v
retrieving revision 1.7
diff -u -u -r1.7 linux_signal.c
--- emulation/linux/linux_signal.c	15 Aug 2003 06:32:51 -0000	1.7
+++ emulation/linux/linux_signal.c	23 Oct 2003 12:03:23 -0000
@@ -35,6 +35,7 @@
 #include <sys/proc.h>
 #include <sys/signalvar.h>
 #include <sys/sysproto.h>
+#include <sys/kern_syscall.h>
 
 #include <arch_linux/linux.h>
 #include <arch_linux/linux_proto.h>
@@ -83,7 +84,7 @@
 	}
 }
 
-static void
+void
 linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa)
 {
 
@@ -106,7 +107,7 @@
 		bsa->sa_flags |= SA_NODEFER;
 }
 
-static void
+void
 bsd_to_linux_sigaction(struct sigaction *bsa, l_sigaction_t *lsa)
 {
 
@@ -130,73 +131,28 @@
 		lsa->lsa_flags |= LINUX_SA_NOMASK;
 }
 
-int
-linux_do_sigaction(int linux_sig, l_sigaction_t *linux_nsa,
-		   l_sigaction_t *linux_osa, int *res)
-{
-	struct sigaction *nsa, *osa;
-	struct sigaction_args sa_args;
-	int error;
-	caddr_t sg = stackgap_init();
-
-	if (linux_sig <= 0 || linux_sig > LINUX_NSIG)
-		return (EINVAL);
-
-	if (linux_osa != NULL)
-		osa = stackgap_alloc(&sg, sizeof(struct sigaction));
-	else
-		osa = NULL;
-
-	if (linux_nsa != NULL) {
-		nsa = stackgap_alloc(&sg, sizeof(struct sigaction));
-		linux_to_bsd_sigaction(linux_nsa, nsa);
-	}
-	else
-		nsa = NULL;
-
-#ifndef __alpha__
-	if (linux_sig <= LINUX_SIGTBLSZ)
-		sa_args.sig = linux_to_bsd_signal[_SIG_IDX(linux_sig)];
-	else
-#endif
-		sa_args.sig = linux_sig;
-
-	sa_args.act = nsa;
-	sa_args.oact = osa;
-	sa_args.sysmsg_result = 0;
-	error = sigaction(&sa_args);
-	if (error)
-		return (error);
-	*res = sa_args.sysmsg_result;
-
-	if (linux_osa != NULL)
-		bsd_to_linux_sigaction(osa, linux_osa);
-
-	return (0);
-}
-
-
 #ifndef __alpha__
 int
 linux_signal(struct linux_signal_args *args)
 {
-	l_sigaction_t nsa, osa;
+	l_sigaction_t linux_nsa, linux_osa;
+	struct sigaction nsa, osa;
 	int error;
-	int dummy;
 
 #ifdef DEBUG
 	if (ldebug(signal))
 		printf(ARGS(signal, "%d, %p"),
 		    args->sig, (void *)args->handler);
 #endif
+	linux_nsa.lsa_handler = args->handler;
+	linux_nsa.lsa_flags = LINUX_SA_ONESHOT | LINUX_SA_NOMASK;
+	LINUX_SIGEMPTYSET(linux_nsa.lsa_mask);
+	linux_to_bsd_sigaction(&linux_nsa, &nsa);
 
-	nsa.lsa_handler = args->handler;
-	nsa.lsa_flags = LINUX_SA_ONESHOT | LINUX_SA_NOMASK;
-	LINUX_SIGEMPTYSET(nsa.lsa_mask);
-
-	error = linux_do_sigaction(args->sig, &nsa, &osa, &dummy);
-	args->sysmsg_result = (int)osa.lsa_handler;
+	error = kern_sigaction(args->sig, &nsa, &osa);
 
+	bsd_to_linux_sigaction(&osa, &linux_osa);
+	args->sysmsg_result = (int) linux_osa.lsa_handler;
 	return (error);
 }
 #endif	/*!__alpha__*/
@@ -204,7 +160,8 @@
 int
 linux_rt_sigaction(struct linux_rt_sigaction_args *args)
 {
-	l_sigaction_t nsa, osa;
+	l_sigaction_t linux_nsa, linux_osa;
+	struct sigaction nsa, osa;
 	int error;
 
 #ifdef DEBUG
@@ -213,63 +170,40 @@
 		    (long)args->sig, (void *)args->act,
 		    (void *)args->oact, (long)args->sigsetsize);
 #endif
-
 	if (args->sigsetsize != sizeof(l_sigset_t))
 		return (EINVAL);
 
-	if (args->act != NULL) {
-		error = copyin(args->act, &nsa, sizeof(l_sigaction_t));
+	if (args->act) {
+		error = copyin(args->act, &linux_nsa, sizeof(linux_nsa));
 		if (error)
 			return (error);
+		linux_to_bsd_sigaction(&linux_nsa, &nsa);
 	}
 
-	error = linux_do_sigaction(args->sig,
-				   args->act ? &nsa : NULL,
-				   args->oact ? &osa : NULL,
-				   &args->sysmsg_result);
+	error = kern_sigaction(args->sig, args->act ? &nsa : NULL,
+	    args->oact ? &osa : NULL);
 
-	if (args->oact != NULL && !error) {
-		error = copyout(&osa, args->oact, sizeof(l_sigaction_t));
+	if (error == 0 && args->oact) {
+		bsd_to_linux_sigaction(&osa, &linux_osa);
+		error = copyout(&linux_osa, args->oact, sizeof(linux_osa));
 	}
 
 	return (error);
 }
 
 static int
-linux_do_sigprocmask(int how, l_sigset_t *new, l_sigset_t *old, int *res)
+linux_to_bsd_sigprocmask(int how)
 {
-	struct proc *p = curproc;
-	int error;
-	sigset_t mask;
-
-	error = 0;
-	*res = 0;
-
-	if (old != NULL)
-		bsd_to_linux_sigset(&p->p_sigmask, old);
-
-	if (new != NULL) {
-		linux_to_bsd_sigset(new, &mask);
-
-		switch (how) {
-		case LINUX_SIG_BLOCK:
-			SIGSETOR(p->p_sigmask, mask);
-			SIG_CANTMASK(p->p_sigmask);
-			break;
-		case LINUX_SIG_UNBLOCK:
-			SIGSETNAND(p->p_sigmask, mask);
-			break;
-		case LINUX_SIG_SETMASK:
-			p->p_sigmask = mask;
-			SIG_CANTMASK(p->p_sigmask);
-			break;
-		default:
-			error = EINVAL;
-			break;
-		}
+	switch (how) {
+	case LINUX_SIG_BLOCK:
+		return SIG_BLOCK;
+	case LINUX_SIG_UNBLOCK:
+		return SIG_UNBLOCK;
+	case LINUX_SIG_SETMASK:
+		return SIG_SETMASK;
+	default:
+		return (-1);
 	}
-
-	return (error);
 }
 
 #ifndef __alpha__
@@ -277,32 +211,33 @@
 linux_sigprocmask(struct linux_sigprocmask_args *args)
 {
 	l_osigset_t mask;
-	l_sigset_t set, oset;
-	int error;
+	l_sigset_t linux_set, linux_oset;
+	sigset_t set, oset;
+	int error, how;
 
 #ifdef DEBUG
 	if (ldebug(sigprocmask))
 		printf(ARGS(sigprocmask, "%d, *, *"), args->how);
 #endif
 
-	if (args->mask != NULL) {
+	if (args->mask) {
 		error = copyin(args->mask, &mask, sizeof(l_osigset_t));
 		if (error)
 			return (error);
-		LINUX_SIGEMPTYSET(set);
-		set.__bits[0] = mask;
+		LINUX_SIGEMPTYSET(linux_set);
+		linux_set.__bits[0] = mask;
+		linux_to_bsd_sigset(&linux_set, &set);
 	}
+	how = linux_to_bsd_sigprocmask(args->how);
 
-	error = linux_do_sigprocmask(args->how,
-				     args->mask ? &set : NULL,
-				     args->omask ? &oset : NULL,
-				     &args->sysmsg_result);
+	error = kern_sigprocmask(how, args->mask ? &set : NULL,
+	    args->omask ? &oset : NULL);
 
-	if (args->omask != NULL && !error) {
-		mask = oset.__bits[0];
+	if (error == 0 && args->omask) {
+		bsd_to_linux_sigset(&oset, &linux_oset);
+		mask = linux_oset.__bits[0];
 		error = copyout(&mask, args->omask, sizeof(l_osigset_t));
 	}
-
 	return (error);
 }
 #endif	/*!__alpha__*/
@@ -310,8 +245,9 @@
 int
 linux_rt_sigprocmask(struct linux_rt_sigprocmask_args *args)
 {
-	l_sigset_t set, oset;
-	int error;
+	l_sigset_t linux_set, linux_oset;
+	sigset_t set, oset;
+	int error, how;
 
 #ifdef DEBUG
 	if (ldebug(rt_sigprocmask))
@@ -323,19 +259,20 @@
 	if (args->sigsetsize != sizeof(l_sigset_t))
 		return EINVAL;
 
-	if (args->mask != NULL) {
-		error = copyin(args->mask, &set, sizeof(l_sigset_t));
+	if (args->mask) {
+		error = copyin(args->mask, &linux_set, sizeof(l_sigset_t));
 		if (error)
 			return (error);
+		linux_to_bsd_sigset(&linux_set, &set);
 	}
+	how = linux_to_bsd_sigprocmask(args->how);
 
-	error = linux_do_sigprocmask(args->how,
-				     args->mask ? &set : NULL,
-				     args->omask ? &oset : NULL,
-				     &args->sysmsg_result);
+	error = kern_sigprocmask(how, args->mask ? &set : NULL,
+	    args->omask ? &oset : NULL);
 
-	if (args->omask != NULL && !error) {
-		error = copyout(&oset, args->omask, sizeof(l_sigset_t));
+	if (error == 0 && args->omask) {
+		bsd_to_linux_sigset(&oset, &linux_oset);
+		error = copyout(&linux_oset, args->omask, sizeof(l_sigset_t));
 	}
 
 	return (error);
@@ -383,29 +320,34 @@
 int
 linux_sigpending(struct linux_sigpending_args *args)
 {
-	struct proc *p = curproc;
-	sigset_t bset;
-	l_sigset_t lset;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
+	sigset_t set;
+	l_sigset_t linux_set;
 	l_osigset_t mask;
+	int error;
 
 #ifdef DEBUG
 	if (ldebug(sigpending))
 		printf(ARGS(sigpending, "*"));
 #endif
 
-	bset = p->p_siglist;
-	SIGSETAND(bset, p->p_sigmask);
-	bsd_to_linux_sigset(&bset, &lset);
-	mask = lset.__bits[0];
-	return (copyout(&mask, args->mask, sizeof(mask)));
+	error = kern_sigpending(&set);
+
+	if (error == 0) {
+		SIGSETAND(set, p->p_sigmask);
+		bsd_to_linux_sigset(&set, &linux_set);
+		mask = linux_set.__bits[0];
+		error = copyout(&mask, args->mask, sizeof(mask));
+	}
+	return (error);
 }
 #endif	/*!__alpha__*/
 
 int
 linux_kill(struct linux_kill_args *args)
 {
-	struct kill_args ka;
-	int error;
+	int error, sig;
 
 #ifdef DEBUG
 	if (ldebug(kill))
@@ -420,15 +362,13 @@
 
 #ifndef __alpha__
 	if (args->signum > 0 && args->signum <= LINUX_SIGTBLSZ)
-		ka.signum = linux_to_bsd_signal[_SIG_IDX(args->signum)];
+		sig = linux_to_bsd_signal[_SIG_IDX(args->signum)];
 	else
 #endif
-		ka.signum = args->signum;
+		sig = args->signum;
+
+	error = kern_kill(sig, args->pid);
 
-	ka.pid = args->pid;
-	ka.sysmsg_result = 0;
-	error = kill(&ka);
-	args->sysmsg_result = ka.sysmsg_result;
 	return(error);
 }
 
Index: emulation/linux/linux_signal.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/emulation/linux/linux_signal.h,v
retrieving revision 1.5
diff -u -u -r1.5 linux_signal.h
--- emulation/linux/linux_signal.h	27 Aug 2003 06:30:03 -0000	1.5
+++ emulation/linux/linux_signal.h	23 Oct 2003 06:35:19 -0000
@@ -34,6 +34,7 @@
 
 void linux_to_bsd_sigset (l_sigset_t *, sigset_t *);
 void bsd_to_linux_sigset (sigset_t *, l_sigset_t *);
-int linux_do_sigaction (int, l_sigaction_t *, l_sigaction_t *, int *);
+void linux_to_bsd_sigaction(l_sigaction_t *, struct sigaction *);
+void bsd_to_linux_sigaction(struct sigaction *, l_sigaction_t *);
 
 #endif /* _LINUX_SIGNAL_H_ */
Index: emulation/linux/i386/linux_machdep.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/emulation/linux/i386/linux_machdep.c,v
retrieving revision 1.9
diff -u -u -r1.9 linux_machdep.c
--- emulation/linux/i386/linux_machdep.c	20 Aug 2003 07:13:27 -0000	1.9
+++ emulation/linux/i386/linux_machdep.c	23 Oct 2003 12:01:56 -0000
@@ -31,6 +31,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/kern_syscall.h>
 #include <sys/lock.h>
 #include <sys/mman.h>
 #include <sys/proc.h>
@@ -691,7 +692,8 @@
 linux_sigaction(struct linux_sigaction_args *args)
 {
 	l_osigaction_t osa;
-	l_sigaction_t act, oact;
+	l_sigaction_t linux_act, linux_oact;
+	struct sigaction act, oact;
 	int error;
 
 #ifdef DEBUG
@@ -700,30 +702,29 @@
 		    args->sig, (void *)args->nsa, (void *)args->osa);
 #endif
 
-	if (args->nsa != NULL) {
-		error = copyin((caddr_t)args->nsa, &osa,
-		    sizeof(l_osigaction_t));
+	if (args->nsa) {
+		error = copyin(args->nsa, &osa, sizeof(l_osigaction_t));
 		if (error)
 			return (error);
-		act.lsa_handler = osa.lsa_handler;
-		act.lsa_flags = osa.lsa_flags;
-		act.lsa_restorer = osa.lsa_restorer;
-		LINUX_SIGEMPTYSET(act.lsa_mask);
-		act.lsa_mask.__bits[0] = osa.lsa_mask;
+		linux_act.lsa_handler = osa.lsa_handler;
+		linux_act.lsa_flags = osa.lsa_flags;
+		linux_act.lsa_restorer = osa.lsa_restorer;
+		LINUX_SIGEMPTYSET(linux_act.lsa_mask);
+		linux_act.lsa_mask.__bits[0] = osa.lsa_mask;
+		linux_to_bsd_sigaction(&linux_act, &act);
 	}
 
-	error = linux_do_sigaction(args->sig, args->nsa ? &act : NULL,
-	    args->osa ? &oact : NULL, &args->sysmsg_result);
+	error = kern_sigaction(args->sig, args->nsa ? &act : NULL,
+	    args->osa ? &oact : NULL);
 
 	if (args->osa != NULL && !error) {
-		osa.lsa_handler = oact.lsa_handler;
-		osa.lsa_flags = oact.lsa_flags;
-		osa.lsa_restorer = oact.lsa_restorer;
-		osa.lsa_mask = oact.lsa_mask.__bits[0];
-		error = copyout(&osa, (caddr_t)args->osa,
-		    sizeof(l_osigaction_t));
+		bsd_to_linux_sigaction(&oact, &linux_oact);
+		osa.lsa_handler = linux_oact.lsa_handler;
+		osa.lsa_flags = linux_oact.lsa_flags;
+		osa.lsa_restorer = linux_oact.lsa_restorer;
+		osa.lsa_mask = linux_oact.lsa_mask.__bits[0];
+		error = copyout(&osa, args->osa, sizeof(l_osigaction_t));
 	}
-
 	return (error);
 }
 
@@ -735,10 +736,8 @@
 int
 linux_sigsuspend(struct linux_sigsuspend_args *args)
 {
-	struct sigsuspend_args bsd;
-	sigset_t *sigmask;
-	l_sigset_t mask;
-	caddr_t sg = stackgap_init();
+	l_sigset_t linux_mask;
+	sigset_t mask;
 	int error;
 
 #ifdef DEBUG
@@ -746,24 +745,20 @@
 		printf(ARGS(sigsuspend, "%08lx"), (unsigned long)args->mask);
 #endif
 
-	sigmask = stackgap_alloc(&sg, sizeof(sigset_t));
 	LINUX_SIGEMPTYSET(mask);
 	mask.__bits[0] = args->mask;
-	linux_to_bsd_sigset(&mask, sigmask);
-	bsd.sigmask = sigmask;
-	bsd.sysmsg_result = 0;
-	error = sigsuspend(&bsd);
-	args->sysmsg_result = bsd.sysmsg_result;
+	linux_to_bsd_sigset(&linux_mask, &mask);
+
+	error = kern_sigsuspend(&mask);
+
 	return(error);
 }
 
 int
 linux_rt_sigsuspend(struct linux_rt_sigsuspend_args *uap)
 {
-	l_sigset_t lmask;
-	sigset_t *bmask;
-	struct sigsuspend_args bsd;
-	caddr_t sg = stackgap_init();
+	l_sigset_t linux_mask;
+	sigset_t mask;
 	int error;
 
 #ifdef DEBUG
@@ -775,26 +770,23 @@
 	if (uap->sigsetsize != sizeof(l_sigset_t))
 		return (EINVAL);
 
-	error = copyin(uap->newset, &lmask, sizeof(l_sigset_t));
+	error = copyin(uap->newset, &linux_mask, sizeof(l_sigset_t));
 	if (error)
 		return (error);
 
-	bmask = stackgap_alloc(&sg, sizeof(sigset_t));
-	linux_to_bsd_sigset(&lmask, bmask);
-	bsd.sigmask = bmask;
-	bsd.sysmsg_result = 0;
-	error = sigsuspend(&bsd);
-	uap->sysmsg_result = bsd.sysmsg_result;
+	linux_to_bsd_sigset(&linux_mask, &mask);
+
+	error = kern_sigsuspend(&mask);
+
 	return(error);
 }
 
 int
 linux_pause(struct linux_pause_args *args)
 {
-	struct proc *p = curproc;
-	struct sigsuspend_args bsd;
-	sigset_t *sigmask;
-	caddr_t sg = stackgap_init();
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
+	sigset_t mask;
 	int error;
 
 #ifdef DEBUG
@@ -802,56 +794,43 @@
 		printf(ARGS(pause, ""));
 #endif
 
-	sigmask = stackgap_alloc(&sg, sizeof(sigset_t));
-	*sigmask = p->p_sigmask;
-	bsd.sigmask = sigmask;
-	bsd.sysmsg_result = 0;
-	error = sigsuspend(&bsd);
-	args->sysmsg_result = bsd.sysmsg_result;
+	mask = p->p_sigmask;
+
+	error = kern_sigsuspend(&mask);
+
 	return(error);
 }
 
 int
 linux_sigaltstack(struct linux_sigaltstack_args *uap)
 {
-	struct sigaltstack_args bsd;
-	stack_t *ss, *oss;
-	l_stack_t lss;
+	stack_t ss, oss;
+	l_stack_t linux_ss;
 	int error;
-	caddr_t sg = stackgap_init();
 
 #ifdef DEBUG
 	if (ldebug(sigaltstack))
 		printf(ARGS(sigaltstack, "%p, %p"), uap->uss, uap->uoss);
 #endif
 
-	if (uap->uss == NULL) {
-		ss = NULL;
-	} else {
-		error = copyin(uap->uss, &lss, sizeof(l_stack_t));
+	if (uap->uss) {
+		error = copyin(uap->uss, &linux_ss, sizeof(l_stack_t));
 		if (error)
 			return (error);
 
-		ss = stackgap_alloc(&sg, sizeof(stack_t));
-		ss->ss_sp = lss.ss_sp;
-		ss->ss_size = lss.ss_size;
-		ss->ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags);
-	}
-	oss = (uap->uoss != NULL)
-	    ? stackgap_alloc(&sg, sizeof(stack_t))
-	    : NULL;
-
-	bsd.ss = ss;
-	bsd.oss = oss;
-	bsd.sysmsg_result = 0;
-	error = sigaltstack(&bsd);
-	uap->sysmsg_result = bsd.sysmsg_result;
-
-	if (!error && oss != NULL) {
-		lss.ss_sp = oss->ss_sp;
-		lss.ss_size = oss->ss_size;
-		lss.ss_flags = bsd_to_linux_sigaltstack(oss->ss_flags);
-		error = copyout(&lss, uap->uoss, sizeof(l_stack_t));
+		ss.ss_sp = linux_ss.ss_sp;
+		ss.ss_size = linux_ss.ss_size;
+		ss.ss_flags = linux_to_bsd_sigaltstack(linux_ss.ss_flags);
+	}
+
+	error = kern_sigaltstack(uap->uss ? &ss : NULL,
+	    uap->uoss ? &oss : NULL);
+
+	if (error == 0 && uap->uoss) {
+		linux_ss.ss_sp = oss.ss_sp;
+		linux_ss.ss_size = oss.ss_size;
+		linux_ss.ss_flags = bsd_to_linux_sigaltstack(oss.ss_flags);
+		error = copyout(&linux_ss, uap->uoss, sizeof(l_stack_t));
 	}
 
 	return (error);
Index: i386/i386/genassym.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/i386/i386/genassym.c,v
retrieving revision 1.30
diff -u -u -r1.30 genassym.c
--- i386/i386/genassym.c	2 Oct 2003 22:26:56 -0000	1.30
+++ i386/i386/genassym.c	23 Oct 2003 10:04:25 -0000
@@ -163,12 +163,7 @@
 ASSYM(TF_CS, offsetof(struct trapframe, tf_cs));
 ASSYM(TF_EFLAGS, offsetof(struct trapframe, tf_eflags));
 ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler));
-ASSYM(SIGF_SC, offsetof(struct osigframe, sf_siginfo.si_sc));
 ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
-ASSYM(SC_PS, offsetof(struct osigcontext, sc_ps));
-ASSYM(SC_FS, offsetof(struct osigcontext, sc_fs));
-ASSYM(SC_GS, offsetof(struct osigcontext, sc_gs));
-ASSYM(SC_TRAPNO, offsetof(struct osigcontext, sc_trapno));
 ASSYM(UC_EFLAGS, offsetof(ucontext_t, uc_mcontext.mc_eflags));
 ASSYM(UC_GS, offsetof(ucontext_t, uc_mcontext.mc_gs));
 ASSYM(B_READ, B_READ);
Index: i386/i386/locore.s
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/i386/i386/locore.s,v
retrieving revision 1.7
diff -u -u -r1.7 locore.s
--- i386/i386/locore.s	31 Jul 2003 19:56:59 -0000	1.7
+++ i386/i386/locore.s	23 Oct 2003 10:11:35 -0000
@@ -395,29 +395,12 @@
 0:	jmp	0b
 
 	ALIGN_TEXT
-osigcode:
-	call	*SIGF_HANDLER(%esp)		/* call signal handler */
-	lea	SIGF_SC(%esp),%eax		/* get sigcontext */
-	pushl	%eax
-	testl	$PSL_VM,SC_PS(%eax)
-	jne	9f
-	movl	SC_GS(%eax),%gs			/* restore %gs */
-9:
-	movl	$0x01d516,SC_TRAPNO(%eax)	/* magic: 0ldSiG */
-	movl	$SYS_sigreturn,%eax
-	pushl	%eax				/* junk to fake return addr. */
-	int	$0x80				/* enter kernel with args */
-0:	jmp	0b
-
-	ALIGN_TEXT
 esigcode:
 
 	.data
-	.globl	szsigcode, szosigcode
+	.globl	szsigcode
 szsigcode:
 	.long	esigcode - sigcode
-szosigcode:
-	.long	esigcode - osigcode
 	.text
 
 /**********************************************************************
Index: i386/i386/machdep.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/i386/i386/machdep.c,v
retrieving revision 1.38
diff -u -u -r1.38 machdep.c
--- i386/i386/machdep.c	19 Oct 2003 00:23:21 -0000	1.38
+++ i386/i386/machdep.c	23 Oct 2003 03:07:17 -0000
@@ -466,119 +466,6 @@
  * frame pointer, it returns to the user
  * specified pc, psl.
  */
-static void
-osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
-{
-	struct proc *p = curproc;
-	struct trapframe *regs;
-	struct osigframe *fp;
-	struct osigframe sf;
-	struct sigacts *psp = p->p_sigacts;
-	int oonstack;
-
-	regs = p->p_md.md_regs;
-	oonstack = (p->p_sigstk.ss_flags & SS_ONSTACK) ? 1 : 0;
-
-	/* Allocate and validate space for the signal handler context. */
-	if ((p->p_flag & P_ALTSTACK) && !oonstack &&
-	    SIGISMEMBER(psp->ps_sigonstack, sig)) {
-		fp = (struct osigframe *)(p->p_sigstk.ss_sp +
-		    p->p_sigstk.ss_size - sizeof(struct osigframe));
-		p->p_sigstk.ss_flags |= SS_ONSTACK;
-	}
-	else
-		fp = (struct osigframe *)regs->tf_esp - 1;
-
-	/* Translate the signal if appropriate */
-	if (p->p_sysent->sv_sigtbl) {
-		if (sig <= p->p_sysent->sv_sigsize)
-			sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-	}
-
-	/* Build the argument list for the signal handler. */
-	sf.sf_signum = sig;
-	sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc;
-	if (SIGISMEMBER(p->p_sigacts->ps_siginfo, sig)) {
-		/* Signal handler installed with SA_SIGINFO. */
-		sf.sf_arg2 = (register_t)&fp->sf_siginfo;
-		sf.sf_siginfo.si_signo = sig;
-		sf.sf_siginfo.si_code = code;
-		sf.sf_ahu.sf_action = (__osiginfohandler_t *)catcher;
-	}
-	else {
-		/* Old FreeBSD-style arguments. */
-		sf.sf_arg2 = code;
-		sf.sf_addr = regs->tf_err;
-		sf.sf_ahu.sf_handler = catcher;
-	}
-
-	/* save scratch registers */
-	sf.sf_siginfo.si_sc.sc_eax = regs->tf_eax;
-	sf.sf_siginfo.si_sc.sc_ebx = regs->tf_ebx;
-	sf.sf_siginfo.si_sc.sc_ecx = regs->tf_ecx;
-	sf.sf_siginfo.si_sc.sc_edx = regs->tf_edx;
-	sf.sf_siginfo.si_sc.sc_esi = regs->tf_esi;
-	sf.sf_siginfo.si_sc.sc_edi = regs->tf_edi;
-	sf.sf_siginfo.si_sc.sc_cs = regs->tf_cs;
-	sf.sf_siginfo.si_sc.sc_ds = regs->tf_ds;
-	sf.sf_siginfo.si_sc.sc_ss = regs->tf_ss;
-	sf.sf_siginfo.si_sc.sc_es = regs->tf_es;
-	sf.sf_siginfo.si_sc.sc_fs = regs->tf_fs;
-	sf.sf_siginfo.si_sc.sc_gs = rgs();
-	sf.sf_siginfo.si_sc.sc_isp = regs->tf_isp;
-
-	/* Build the signal context to be used by sigreturn. */
-	sf.sf_siginfo.si_sc.sc_onstack = oonstack;
-	SIG2OSIG(*mask, sf.sf_siginfo.si_sc.sc_mask);
-	sf.sf_siginfo.si_sc.sc_sp = regs->tf_esp;
-	sf.sf_siginfo.si_sc.sc_fp = regs->tf_ebp;
-	sf.sf_siginfo.si_sc.sc_pc = regs->tf_eip;
-	sf.sf_siginfo.si_sc.sc_ps = regs->tf_eflags;
-	sf.sf_siginfo.si_sc.sc_trapno = regs->tf_trapno;
-	sf.sf_siginfo.si_sc.sc_err = regs->tf_err;
-
-	/*
-	 * If we're a vm86 process, we want to save the segment registers.
-	 * We also change eflags to be our emulated eflags, not the actual
-	 * eflags.
-	 */
-	if (regs->tf_eflags & PSL_VM) {
-		struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
-		struct vm86_kernel *vm86 = &p->p_thread->td_pcb->pcb_ext->ext_vm86;
-
-		sf.sf_siginfo.si_sc.sc_gs = tf->tf_vm86_gs;
-		sf.sf_siginfo.si_sc.sc_fs = tf->tf_vm86_fs;
-		sf.sf_siginfo.si_sc.sc_es = tf->tf_vm86_es;
-		sf.sf_siginfo.si_sc.sc_ds = tf->tf_vm86_ds;
-
-		if (vm86->vm86_has_vme == 0)
-			sf.sf_siginfo.si_sc.sc_ps =
-			    (tf->tf_eflags & ~(PSL_VIF | PSL_VIP))
-			    | (vm86->vm86_eflags & (PSL_VIF | PSL_VIP));
-		/* see sendsig for comment */
-		tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP);
-	}
-
-	/* Copy the sigframe out to the user's stack. */
-	if (copyout(&sf, fp, sizeof(struct osigframe)) != 0) {
-		/*
-		 * Something is wrong with the stack pointer.
-		 * ...Kill the process.
-		 */
-		sigexit(p, SIGILL);
-	}
-
-	regs->tf_esp = (int)fp;
-	regs->tf_eip = PS_STRINGS - szosigcode;
-	regs->tf_eflags &= ~PSL_T;
-	regs->tf_cs = _ucodesel;
-	regs->tf_ds = _udatasel;
-	regs->tf_es = _udatasel;
-	regs->tf_fs = _udatasel;
-	load_gs(_udatasel);
-	regs->tf_ss = _udatasel;
-}
-
 void
 sendsig(catcher, sig, mask, code)
 	sig_t catcher;
@@ -592,11 +479,6 @@
 	struct sigframe sf, *sfp;
 	int oonstack;
 
-	if (SIGISMEMBER(psp->ps_osigset, sig)) {
-		osendsig(catcher, sig, mask, code);
-		return;
-	}
-
 	regs = p->p_md.md_regs;
 	oonstack = (p->p_sigstk.ss_flags & SS_ONSTACK) ? 1 : 0;
 
@@ -696,7 +578,7 @@
 }
 
 /*
- * osigreturn_args(struct osigcontext *sigcntxp)
+ * sigreturn(ucontext_t *sigcntxp)
  *
  * System call to cleanup state after a signal
  * has been taken.  Reset signal mask and
@@ -710,112 +592,6 @@
 #define	CS_SECURE(cs)		(ISPL(cs) == SEL_UPL)
 
 int
-osigreturn(struct osigreturn_args *uap)
-{
-	struct proc *p = curproc;
-	struct osigcontext *scp;
-	struct trapframe *regs = p->p_md.md_regs;
-	int eflags;
-
-	scp = uap->sigcntxp;
-
-	if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ))
-		return(EFAULT);
-
-	eflags = scp->sc_ps;
-	if (eflags & PSL_VM) {
-		struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
-		struct vm86_kernel *vm86;
-
-		/*
-		 * if pcb_ext == 0 or vm86_inited == 0, the user hasn't
-		 * set up the vm86 area, and we can't enter vm86 mode.
-		 */
-		if (p->p_thread->td_pcb->pcb_ext == 0)
-			return (EINVAL);
-		vm86 = &p->p_thread->td_pcb->pcb_ext->ext_vm86;
-		if (vm86->vm86_inited == 0)
-			return (EINVAL);
-
-		/* go back to user mode if both flags are set */
-		if ((eflags & PSL_VIP) && (eflags & PSL_VIF))
-			trapsignal(p, SIGBUS, 0);
-
-		if (vm86->vm86_has_vme) {
-			eflags = (tf->tf_eflags & ~VME_USERCHANGE) |
-			    (eflags & VME_USERCHANGE) | PSL_VM;
-		} else {
-			vm86->vm86_eflags = eflags;	/* save VIF, VIP */
-			eflags = (tf->tf_eflags & ~VM_USERCHANGE) |					    (eflags & VM_USERCHANGE) | PSL_VM;
-		}
-		tf->tf_vm86_ds = scp->sc_ds;
-		tf->tf_vm86_es = scp->sc_es;
-		tf->tf_vm86_fs = scp->sc_fs;
-		tf->tf_vm86_gs = scp->sc_gs;
-		tf->tf_ds = _udatasel;
-		tf->tf_es = _udatasel;
-		tf->tf_fs = _udatasel;
-	} else {
-		/*
-		 * Don't allow users to change privileged or reserved flags.
-		 */
-		/*
-		 * XXX do allow users to change the privileged flag PSL_RF.
-		 * The cpu sets PSL_RF in tf_eflags for faults.  Debuggers
-		 * should sometimes set it there too.  tf_eflags is kept in
-		 * the signal context during signal handling and there is no
-		 * other place to remember it, so the PSL_RF bit may be
-		 * corrupted by the signal handler without us knowing.
-		 * Corruption of the PSL_RF bit at worst causes one more or
-		 * one less debugger trap, so allowing it is fairly harmless.
-		 */
-		if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
-	    		return(EINVAL);
-		}
-
-		/*
-		 * Don't allow users to load a valid privileged %cs.  Let the
-		 * hardware check for invalid selectors, excess privilege in
-		 * other selectors, invalid %eip's and invalid %esp's.
-		 */
-		if (!CS_SECURE(scp->sc_cs)) {
-			trapsignal(p, SIGBUS, T_PROTFLT);
-			return(EINVAL);
-		}
-		regs->tf_ds = scp->sc_ds;
-		regs->tf_es = scp->sc_es;
-		regs->tf_fs = scp->sc_fs;
-	}
-
-	/* restore scratch registers */
-	regs->tf_eax = scp->sc_eax;
-	regs->tf_ebx = scp->sc_ebx;
-	regs->tf_ecx = scp->sc_ecx;
-	regs->tf_edx = scp->sc_edx;
-	regs->tf_esi = scp->sc_esi;
-	regs->tf_edi = scp->sc_edi;
-	regs->tf_cs = scp->sc_cs;
-	regs->tf_ss = scp->sc_ss;
-	regs->tf_isp = scp->sc_isp;
-
-	if (scp->sc_onstack & 01)
-		p->p_sigstk.ss_flags |= SS_ONSTACK;
-	else
-		p->p_sigstk.ss_flags &= ~SS_ONSTACK;
-
-	SIGSETOLD(p->p_sigmask, scp->sc_mask);
-	SIG_CANTMASK(p->p_sigmask);
-	regs->tf_ebp = scp->sc_fp;
-	regs->tf_esp = scp->sc_sp;
-	regs->tf_eip = scp->sc_pc;
-	regs->tf_eflags = eflags;
-	return(EJUSTRETURN);
-}
-
-/*
- * sigreturn(ucontext_t *sigcntxp)
- */
-int
 sigreturn(struct sigreturn_args *uap)
 {
 	struct proc *p = curproc;
@@ -825,18 +601,6 @@
 
 	ucp = uap->sigcntxp;
 
-	if (!useracc((caddr_t)ucp, sizeof(struct osigcontext), VM_PROT_READ))
-		return (EFAULT);
-	if (((struct osigcontext *)ucp)->sc_trapno == 0x01d516)
-		return (osigreturn((struct osigreturn_args *)uap));
-
-	/*
-	 * Since ucp is not an osigcontext but a ucontext_t, we have to
-	 * check again if all of it is accessible.  A ucontext_t is
-	 * much larger, so instead of just checking for the pointer
-	 * being valid for the size of an osigcontext, now check for
-	 * it being valid for a whole, new-style ucontext_t.
-	 */
 	if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
 		return (EFAULT);
 
Index: i386/include/md_var.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/i386/include/md_var.h,v
retrieving revision 1.10
diff -u -u -r1.10 md_var.h
--- i386/include/md_var.h	26 Aug 2003 21:42:18 -0000	1.10
+++ i386/include/md_var.h	23 Oct 2003 10:13:15 -0000
@@ -61,7 +61,7 @@
 extern	int	nfs_diskless_valid;
 extern	void	(*ovbcopy_vector) (const void *from, void *to, size_t len);
 extern	char	sigcode[];
-extern	int	szsigcode, szosigcode;
+extern	int	szsigcode;
 
 typedef void alias_for_inthand_t (u_int cs, u_int ef, u_int esp, u_int ss);
 struct	proc;
Index: i386/include/sigframe.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/i386/include/sigframe.h,v
retrieving revision 1.2
diff -u -u -r1.2 sigframe.h
--- i386/include/sigframe.h	17 Jun 2003 04:28:36 -0000	1.2
+++ i386/include/sigframe.h	23 Oct 2003 10:00:14 -0000
@@ -36,41 +36,6 @@
  * Signal frames, arguments passed to application signal handlers.
  */
 
-struct	osigframe {
-	/*
-	 * The first four members may be used by applications.
-	 */
-
-	register_t	sf_signum;
-
-	/*
-	 * Either 'int' for old-style FreeBSD handler or 'siginfo_t *'
-	 * pointing to sf_siginfo for SA_SIGINFO handlers.
-	 */
-	register_t	sf_arg2;
-
-	/* Points to sf_siginfo.si_sc. */
-	register_t	sf_scp;
-
-	register_t	sf_addr;
-
-	/*
-	 * The following arguments are not constrained by the
-	 * function call protocol.
-	 * Applications are not supposed to access these members,
-	 * except using the pointers we provide in the first three
-	 * arguments.
-	 */
-
-	union {
-		__osiginfohandler_t	*sf_action;
-		__sighandler_t		*sf_handler;
-	} sf_ahu;
-
-	/* In the SA_SIGINFO case, sf_arg2 points here. */
-	osiginfo_t	sf_siginfo;
-};
-
 struct sigframe {
 	/*
 	 * The first four members may be used by applications.
Index: i386/include/signal.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/i386/include/signal.h,v
retrieving revision 1.4
diff -u -u -r1.4 signal.h
--- i386/include/signal.h	20 Aug 2003 23:05:33 -0000	1.4
+++ i386/include/signal.h	23 Oct 2003 10:01:56 -0000
@@ -60,34 +60,7 @@
  * execution of the signal handler.  It is also made available
  * to the handler to allow it to restore state properly if
  * a non-standard exit is performed.
- */
-typedef unsigned int osigset_t;
-
-struct	osigcontext {
-	int	sc_onstack;		/* sigstack state to restore */
-	osigset_t sc_mask;		/* signal mask to restore */
-	int	sc_esp;			/* machine state follows: */
-	int	sc_ebp;
-	int	sc_isp;
-	int	sc_eip;
-	int	sc_efl;
-	int	sc_es;
-	int	sc_ds;
-	int	sc_cs;
-	int	sc_ss;
-	int	sc_edi;
-	int	sc_esi;
-	int	sc_ebx;
-	int	sc_edx;
-	int	sc_ecx;
-	int	sc_eax;
-	int	sc_gs;
-	int	sc_fs;
-	int	sc_trapno;
-	int	sc_err;
-};
-
-/*
+ *
  * The sequence of the fields/registers in struct sigcontext should match
  * those in mcontext_t.
  */
Index: kern/init_sysent.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/kern/init_sysent.c,v
retrieving revision 1.8
diff -u -u -r1.8 init_sysent.c
--- kern/init_sysent.c	8 Oct 2003 01:30:32 -0000	1.8
+++ kern/init_sysent.c	23 Oct 2003 03:25:54 -0000
@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $DragonFly: src/sys/kern/init_sysent.c,v 1.8 2003/10/08 01:30:32 daver Exp $
- * created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+ * $DragonFly$
+ * created from DragonFly
  */
 
 #include "opt_compat.h"
@@ -68,13 +68,13 @@
 	{ 0, (sy_call_t *)getegid },			/* 43 = getegid */
 	{ AS(profil_args), (sy_call_t *)profil },	/* 44 = profil */
 	{ AS(ktrace_args), (sy_call_t *)ktrace },	/* 45 = ktrace */
-	{ compat(AS(osigaction_args),sigaction) },	/* 46 = old sigaction */
+	{ 0, (sy_call_t *)nosys },			/* 46 = obsolete freebsd3_sigaction */
 	{ SYF_MPSAFE | 0, (sy_call_t *)getgid },	/* 47 = getgid */
-	{ compat(SYF_MPSAFE | AS(osigprocmask_args),sigprocmask) },	/* 48 = old sigprocmask */
+	{ 0, (sy_call_t *)nosys },			/* 48 = obsolete freebsd3_sigprocmask */
 	{ AS(getlogin_args), (sy_call_t *)getlogin },	/* 49 = getlogin */
 	{ AS(setlogin_args), (sy_call_t *)setlogin },	/* 50 = setlogin */
 	{ AS(acct_args), (sy_call_t *)acct },		/* 51 = acct */
-	{ compat(0,sigpending) },			/* 52 = old sigpending */
+	{ 0, (sy_call_t *)nosys },			/* 52 = obsolete { */
 	{ AS(sigaltstack_args), (sy_call_t *)sigaltstack },	/* 53 = sigaltstack */
 	{ AS(ioctl_args), (sy_call_t *)ioctl },		/* 54 = ioctl */
 	{ AS(reboot_args), (sy_call_t *)reboot },	/* 55 = reboot */
@@ -125,7 +125,7 @@
 	{ AS(getpriority_args), (sy_call_t *)getpriority },	/* 100 = getpriority */
 	{ compat(AS(osend_args),send) },		/* 101 = old send */
 	{ compat(AS(orecv_args),recv) },		/* 102 = old recv */
-	{ compat(AS(osigreturn_args),sigreturn) },	/* 103 = old sigreturn */
+	{ 0, (sy_call_t *)nosys },			/* 103 = obsolete freebsd3_sigreturn */
 	{ AS(bind_args), (sy_call_t *)bind },		/* 104 = bind */
 	{ AS(setsockopt_args), (sy_call_t *)setsockopt },	/* 105 = setsockopt */
 	{ AS(listen_args), (sy_call_t *)listen },	/* 106 = listen */
@@ -133,7 +133,7 @@
 	{ compat(AS(osigvec_args),sigvec) },		/* 108 = old sigvec */
 	{ compat(AS(osigblock_args),sigblock) },	/* 109 = old sigblock */
 	{ compat(AS(osigsetmask_args),sigsetmask) },	/* 110 = old sigsetmask */
-	{ compat(AS(osigsuspend_args),sigsuspend) },	/* 111 = old sigsuspend */
+	{ 0, (sy_call_t *)nosys },			/* 111 = obsolete freebsd3_sigsuspend */
 	{ compat(AS(osigstack_args),sigstack) },	/* 112 = old sigstack */
 	{ compat(AS(orecvmsg_args),recvmsg) },		/* 113 = old recvmsg */
 	{ compat(AS(osendmsg_args),sendmsg) },		/* 114 = old sendmsg */
Index: kern/kern_sig.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/kern/kern_sig.c,v
retrieving revision 1.22
diff -u -u -r1.22 kern_sig.c
--- kern/kern_sig.c	13 Oct 2003 21:16:42 -0000	1.22
+++ kern/kern_sig.c	23 Oct 2003 11:37:11 -0000
@@ -40,7 +40,6 @@
  * $DragonFly: src/sys/kern/kern_sig.c,v 1.22 2003/10/13 21:16:42 dillon Exp $
  */
 
-#include "opt_compat.h"
 #include "opt_ktrace.h"
 
 #include <sys/param.h>
@@ -65,21 +64,16 @@
 #include <sys/sysctl.h>
 #include <sys/malloc.h>
 #include <sys/unistd.h>
+#include <sys/kern_syscall.h>
 
 
 #include <machine/ipl.h>
 #include <machine/cpu.h>
 #include <machine/smp.h>
 
-#define	ONSIG	32		/* NSIG for osig* syscalls.  XXX. */
-
 static int coredump	(struct proc *);
-static int do_sigaction	(int sig, struct sigaction *act,
-			     struct sigaction *oact, int old);
-static int do_sigprocmask (int how, sigset_t *set,
-			       sigset_t *oset, int old);
 static char *expand_name (const char *, uid_t, pid_t);
-static int killpg1	(int sig, int pgid, int all);
+static int killpg	(int sig, int pgid, int all);
 static int sig_ffs	(sigset_t *set);
 static int sigprop	(int sig);
 static void stop	(struct proc *);
@@ -227,15 +221,11 @@
 	return (0);
 }
 
-/*
- * do_sigaction
- * sigaction
- * osigaction
- */
-static int
-do_sigaction(int sig, struct sigaction *act, struct sigaction *oact, int old)
+int
+kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact)
 {
-	struct proc *p = curproc;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
 	struct sigacts *ps = p->p_sigacts;
 
 	if (sig <= 0 || sig > _SIG_MAXSIG)
@@ -296,12 +286,6 @@
 			SIGADDSET(ps->ps_signodefer, sig);
 		else
 			SIGDELSET(ps->ps_signodefer, sig);
-#ifdef COMPAT_SUNOS
-		if (act->sa_flags & SA_USERTRAMP)
-			SIGADDSET(ps->ps_usertramp, sig);
-		else
-			SIGDELSET(ps->ps_usertramp, seg);
-#endif
 		if (sig == SIGCHLD) {
 			if (act->sa_flags & SA_NOCLDSTOP)
 				p->p_procsig->ps_flag |= PS_NOCLDSTOP;
@@ -343,18 +327,12 @@
 			else
 				SIGADDSET(p->p_sigcatch, sig);
 		}
-		if (ps->ps_sigact[_SIG_IDX(sig)] == SIG_IGN ||
-		    ps->ps_sigact[_SIG_IDX(sig)] == SIG_DFL || !old)
-			SIGDELSET(ps->ps_osigset, sig);
-		else
-			SIGADDSET(ps->ps_osigset, sig);
 
 		(void) spl0();
 	}
 	return (0);
 }
 
-/* ARGSUSED */
 int
 sigaction(struct sigaction_args *uap)
 {
@@ -369,44 +347,13 @@
 		if (error)
 			return (error);
 	}
-	error = do_sigaction(uap->sig, actp, oactp, 0);
+	error = kern_sigaction(uap->sig, actp, oactp);
 	if (oactp && !error) {
 		error = copyout(oactp, uap->oact, sizeof(oact));
 	}
 	return (error);
 }
 
-/* ARGSUSED */
-int
-osigaction(struct osigaction_args *uap)
-{
-	struct osigaction sa;
-	struct sigaction nsa, osa;
-	struct sigaction *nsap, *osap;
-	int error;
-
-	if (uap->signum <= 0 || uap->signum >= ONSIG)
-		return (EINVAL);
-	nsap = (uap->nsa != NULL) ? &nsa : NULL;
-	osap = (uap->osa != NULL) ? &osa : NULL;
-	if (nsap) {
-		error = copyin(uap->nsa, &sa, sizeof(sa));
-		if (error)
-			return (error);
-		nsap->sa_handler = sa.sa_handler;
-		nsap->sa_flags = sa.sa_flags;
-		OSIG2SIG(sa.sa_mask, nsap->sa_mask);
-	}
-	error = do_sigaction(uap->signum, nsap, osap, 1);
-	if (osap && !error) {
-		sa.sa_handler = osap->sa_handler;
-		sa.sa_flags = osap->sa_flags;
-		SIG2OSIG(osap->sa_mask, sa.sa_mask);
-		error = copyout(&sa, uap->osa, sizeof(sa));
-	}
-	return (error);
-}
-
 /*
  * Initialize signal state for process 0;
  * set to ignore signals that are ignored by default.
@@ -462,16 +409,17 @@
 }
 
 /*
- * do_sigprocmask() - MP SAFE ONLY IF p == curproc
+ * kern_sigprocmask() - MP SAFE ONLY IF p == curproc
  *
  *	Manipulate signal mask.  This routine is MP SAFE *ONLY* if
  *	p == curproc.  Also remember that in order to remain MP SAFE
  *	no spl*() calls may be made.
  */
-static int
-do_sigprocmask(int how, sigset_t *set, sigset_t *oset, int old)
+int
+kern_sigprocmask(int how, sigset_t *set, sigset_t *oset)
 {
-	struct proc *p = curproc;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
 	int error;
 
 	if (oset != NULL)
@@ -489,10 +437,7 @@
 			break;
 		case SIG_SETMASK:
 			SIG_CANTMASK(*set);
-			if (old)
-				SIGSETLO(p->p_sigmask, *set);
-			else
-				p->p_sigmask = *set;
+			p->p_sigmask = *set;
 			break;
 		default:
 			error = EINVAL;
@@ -519,139 +464,47 @@
 		if (error)
 			return (error);
 	}
-	error = do_sigprocmask(uap->how, setp, osetp, 0);
+	error = kern_sigprocmask(uap->how, setp, osetp);
 	if (osetp && !error) {
 		error = copyout(osetp, uap->oset, sizeof(oset));
 	}
 	return (error);
 }
 
-/*
- * osigprocmask() - MP SAFE
- */
-int
-osigprocmask(struct osigprocmask_args *uap)
-{
-	sigset_t set, oset;
-	int error;
-
-	OSIG2SIG(uap->mask, set);
-	error = do_sigprocmask(uap->how, &set, &oset, 1);
-	SIG2OSIG(oset, uap->sysmsg_result);
-	return (error);
-}
-
-/* ARGSUSED */
 int
-sigpending(struct sigpending_args *uap)
+kern_sigpending(struct __sigset *set)
 {
-	struct proc *p = curproc;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
 
-	return (copyout(&p->p_siglist, uap->set, sizeof(sigset_t)));
-}
+	*set = p->p_siglist;
 
-/* ARGSUSED */
-int
-osigpending(struct osigpending_args *uap)
-{
-	struct proc *p = curproc;
-
-	SIG2OSIG(p->p_siglist, uap->sysmsg_result);
 	return (0);
 }
 
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
-/*
- * Generalized interface signal handler, 4.3-compatible.
- */
-/* ARGSUSED */
 int
-osigvec(struct osigvec_args *uap)
-{
-	struct sigvec vec;
-	struct sigaction nsa, osa;
-	struct sigaction *nsap, *osap;
-	int error;
-
-	if (uap->signum <= 0 || uap->signum >= ONSIG)
-		return (EINVAL);
-	nsap = (uap->nsv != NULL) ? &nsa : NULL;
-	osap = (uap->osv != NULL) ? &osa : NULL;
-	if (nsap) {
-		error = copyin(uap->nsv, &vec, sizeof(vec));
-		if (error)
-			return (error);
-		nsap->sa_handler = vec.sv_handler;
-		OSIG2SIG(vec.sv_mask, nsap->sa_mask);
-		nsap->sa_flags = vec.sv_flags;
-		nsap->sa_flags ^= SA_RESTART;	/* opposite of SV_INTERRUPT */
-#ifdef COMPAT_SUNOS
-		nsap->sa_flags |= SA_USERTRAMP;
-#endif
-	}
-	error = do_sigaction(uap->signum, nsap, osap, 1);
-	if (osap && !error) {
-		vec.sv_handler = osap->sa_handler;
-		SIG2OSIG(osap->sa_mask, vec.sv_mask);
-		vec.sv_flags = osap->sa_flags;
-		vec.sv_flags &= ~SA_NOCLDWAIT;
-		vec.sv_flags ^= SA_RESTART;
-#ifdef COMPAT_SUNOS
-		vec.sv_flags &= ~SA_NOCLDSTOP;
-#endif
-		error = copyout(&vec, uap->osv, sizeof(vec));
-	}
-	return (error);
-}
-
-int
-osigblock(struct osigblock_args *uap)
+sigpending(struct sigpending_args *uap)
 {
-	struct proc *p = curproc;
 	sigset_t set;
+	int error;
 
-	OSIG2SIG(uap->mask, set);
-	SIG_CANTMASK(set);
-	(void) splhigh();
-	SIG2OSIG(p->p_sigmask, uap->sysmsg_result);
-	SIGSETOR(p->p_sigmask, set);
-	(void) spl0();
-	return (0);
-}
+	error = kern_sigpending(&set);
 
-int
-osigsetmask(struct osigsetmask_args *uap)
-{
-	struct proc *p = curproc;
-	sigset_t set;
-
-	OSIG2SIG(uap->mask, set);
-	SIG_CANTMASK(set);
-	(void) splhigh();
-	SIG2OSIG(p->p_sigmask, uap->sysmsg_result);
-	SIGSETLO(p->p_sigmask, set);
-	(void) spl0();
-	return (0);
+	if (error == 0)
+		error = copyout(&set, uap->set, sizeof(set));
+	return (error);
 }
-#endif /* COMPAT_43 || COMPAT_SUNOS */
 
 /*
  * Suspend process until signal, providing mask to be set
- * in the meantime.  Note nonstandard calling convention:
- * libc stub passes mask, not pointer, to save a copyin.
+ * in the meantime.
  */
-/* ARGSUSED */
 int
-sigsuspend(struct sigsuspend_args *uap)
+kern_sigsuspend(struct __sigset *set)
 {
-	struct proc *p = curproc;
-	sigset_t mask;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
 	struct sigacts *ps = p->p_sigacts;
-	int error;
-
-	error = copyin(uap->sigmask, &mask, sizeof(mask));
-	if (error)
-		return (error);
 
 	/*
 	 * When returning from sigsuspend, we want
@@ -663,94 +516,88 @@
 	p->p_oldsigmask = p->p_sigmask;
 	p->p_flag |= P_OLDMASK;
 
-	SIG_CANTMASK(mask);
-	p->p_sigmask = mask;
-	while (tsleep((caddr_t) ps, PCATCH, "pause", 0) == 0)
+	SIG_CANTMASK(*set);
+	p->p_sigmask = *set;
+	while (tsleep(ps, PCATCH, "pause", 0) == 0)
 		/* void */;
 	/* always return EINTR rather than ERESTART... */
 	return (EINTR);
 }
 
-/* ARGSUSED */
+/*
+ * Note nonstandard calling convention: libc stub passes mask, not
+ * pointer, to save a copyin.
+ */
 int
-osigsuspend(struct osigsuspend_args *uap)
+sigsuspend(struct sigsuspend_args *uap)
 {
 	sigset_t mask;
-	struct proc *p = curproc;
-	struct sigacts *ps = p->p_sigacts;
+	int error;
 
-	p->p_oldsigmask = p->p_sigmask;
-	p->p_flag |= P_OLDMASK;
-	OSIG2SIG(uap->mask, mask);
-	SIG_CANTMASK(mask);
-	SIGSETLO(p->p_sigmask, mask);
-	while (tsleep((caddr_t) ps, PCATCH, "opause", 0) == 0)
-		/* void */;
-	/* always return EINTR rather than ERESTART... */
-	return (EINTR);
+	error = copyin(uap->sigmask, &mask, sizeof(mask));
+	if (error)
+		return (error);
+
+	error = kern_sigsuspend(&mask);
+
+	return (error);
 }
 
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
-/* ARGSUSED */
 int
-osigstack(struct osigstack_args *uap)
+kern_sigaltstack(struct sigaltstack *ss, struct sigaltstack *oss)
 {
-	struct proc *p = curproc;
-	struct sigstack ss;
-	int error = 0;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
 
-	ss.ss_sp = p->p_sigstk.ss_sp;
-	ss.ss_onstack = p->p_sigstk.ss_flags & SS_ONSTACK;
-	if (uap->oss && (error = copyout(&ss, uap->oss,
-	    sizeof(struct sigstack))))
-		return (error);
-	if (uap->nss && (error = copyin(uap->nss, &ss, sizeof(ss))) == 0) {
-		p->p_sigstk.ss_sp = ss.ss_sp;
-		p->p_sigstk.ss_size = 0;
-		p->p_sigstk.ss_flags |= ss.ss_onstack & SS_ONSTACK;
-		p->p_flag |= P_ALTSTACK;
+	if ((p->p_flag & P_ALTSTACK) == 0)
+		p->p_sigstk.ss_flags |= SS_DISABLE;
+
+	if (oss)
+		*oss = p->p_sigstk;
+
+	if (ss) {
+		if (ss->ss_flags & SS_DISABLE) {
+			if (p->p_sigstk.ss_flags & SS_ONSTACK)
+				return (EINVAL);
+			p->p_flag &= ~P_ALTSTACK;
+			p->p_sigstk.ss_flags = ss->ss_flags;
+		} else {
+			if (ss->ss_size < p->p_sysent->sv_minsigstksz)
+				return (ENOMEM);
+			p->p_flag |= P_ALTSTACK;
+			p->p_sigstk = *ss;
+		}
 	}
-	return (error);
+
+	return (0);
 }
-#endif /* COMPAT_43 || COMPAT_SUNOS */
 
-/* ARGSUSED */
 int
 sigaltstack(struct sigaltstack_args *uap)
 {
-	struct proc *p = curproc;
-	stack_t ss;
+	stack_t ss, oss;
 	int error;
 
-	if ((p->p_flag & P_ALTSTACK) == 0)
-		p->p_sigstk.ss_flags |= SS_DISABLE;
-	if (uap->oss && (error = copyout(&p->p_sigstk, uap->oss,
-	    sizeof(stack_t))))
-		return (error);
-	if (uap->ss == 0)
-		return (0);
-	if ((error = copyin(uap->ss, &ss, sizeof(ss))))
-		return (error);
-	if (ss.ss_flags & SS_DISABLE) {
-		if (p->p_sigstk.ss_flags & SS_ONSTACK)
-			return (EINVAL);
-		p->p_flag &= ~P_ALTSTACK;
-		p->p_sigstk.ss_flags = ss.ss_flags;
-		return (0);
+	if (uap->ss) {
+		error = copyin(uap->ss, &ss, sizeof(ss));
+		if (error)
+			return (error);
 	}
-	if (ss.ss_size < p->p_sysent->sv_minsigstksz)
-		return (ENOMEM);
-	p->p_flag |= P_ALTSTACK;
-	p->p_sigstk = ss;
-	return (0);
+
+	error = kern_sigaltstack(uap->ss ? &ss : NULL,
+	    uap->oss ? &oss : NULL);
+
+	if (error == 0 && uap->oss)
+		error = copyout(&oss, uap->oss, sizeof(*uap->oss));
+	return (error);
 }
 
 /*
  * Common code for kill process group/broadcast kill.
  * cp is calling process.
  */
-int
-killpg1(int sig, int pgid, int all)
+static int
+killpg(int sig, int pgid, int all)
 {
 	struct proc *cp = curproc;
 	struct proc *p;
@@ -793,45 +640,44 @@
 	return (nfound ? 0 : ESRCH);
 }
 
-/* ARGSUSED */
 int
-kill(struct kill_args *uap)
+kern_kill(int sig, int pid)
 {
-	struct proc *p;
+	struct thread *td = curthread;
+	struct proc *p = td->td_proc;
 
-	if ((u_int)uap->signum > _SIG_MAXSIG)
+	if ((u_int)sig > _SIG_MAXSIG)
 		return (EINVAL);
-	if (uap->pid > 0) {
+	if (pid > 0) {
 		/* kill single process */
-		if ((p = pfind(uap->pid)) == NULL)
+		if ((p = pfind(pid)) == NULL)
 			return (ESRCH);
-		if (!CANSIGNAL(p, uap->signum))
+		if (!CANSIGNAL(p, sig))
 			return (EPERM);
-		if (uap->signum)
-			psignal(p, uap->signum);
+		if (sig)
+			psignal(p, sig);
 		return (0);
 	}
-	switch (uap->pid) {
+	switch (pid) {
 	case -1:		/* broadcast signal */
-		return (killpg1(uap->signum, 0, 1));
+		return (killpg(sig, 0, 1));
 	case 0:			/* signal own process group */
-		return (killpg1(uap->signum, 0, 0));
+		return (killpg(sig, 0, 0));
 	default:		/* negative explicit process group */
-		return (killpg1(uap->signum, -uap->pid, 0));
+		return (killpg(sig, -pid, 0));
 	}
 	/* NOTREACHED */
 }
 
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
-/* ARGSUSED */
 int
-okillpg(struct okillpg_args *uap)
+kill(struct kill_args *uap)
 {
-	if ((u_int)uap->signum > _SIG_MAXSIG)
-		return (EINVAL);
-	return (killpg1(uap->signum, uap->pgid, 0));
+	int error;
+
+	error = kern_kill(uap->signum, uap->pid);
+
+	return (error);
 }
-#endif /* COMPAT_43 || COMPAT_SUNOS */
 
 /*
  * Send a signal to a process group.
@@ -890,7 +736,7 @@
 			SIGADDSET(p->p_sigmask, sig);
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*
-			 * See do_sigaction() for origin of this code.
+			 * See kern_sigaction() for origin of this code.
 			 */
 			SIGDELSET(p->p_sigcatch, sig);
 			if (sig != SIGCONT &&
@@ -1403,7 +1249,7 @@
 
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*
-			 * See do_sigaction() for origin of this code.
+			 * See kern_sigaction() for origin of this code.
 			 */
 			SIGDELSET(p->p_sigcatch, sig);
 			if (sig != SIGCONT &&
Index: kern/syscalls.c
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/kern/syscalls.c,v
retrieving revision 1.8
diff -u -u -r1.8 syscalls.c
--- kern/syscalls.c	8 Oct 2003 01:30:32 -0000	1.8
+++ kern/syscalls.c	23 Oct 2003 03:25:54 -0000
@@ -2,8 +2,8 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $DragonFly: src/sys/kern/syscalls.c,v 1.8 2003/10/08 01:30:32 daver Exp $
- * created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+ * $DragonFly$
+ * created from DragonFly
  */
 
 char *syscallnames[] = {
@@ -53,13 +53,13 @@
 	"getegid",			/* 43 = getegid */
 	"profil",			/* 44 = profil */
 	"ktrace",			/* 45 = ktrace */
-	"old.sigaction",		/* 46 = old sigaction */
+	"obs_freebsd3_sigaction",			/* 46 = obsolete freebsd3_sigaction */
 	"getgid",			/* 47 = getgid */
-	"old.sigprocmask",		/* 48 = old sigprocmask */
+	"obs_freebsd3_sigprocmask",			/* 48 = obsolete freebsd3_sigprocmask */
 	"getlogin",			/* 49 = getlogin */
 	"setlogin",			/* 50 = setlogin */
 	"acct",			/* 51 = acct */
-	"old.sigpending",		/* 52 = old sigpending */
+	"obs_{",			/* 52 = obsolete { */
 	"sigaltstack",			/* 53 = sigaltstack */
 	"ioctl",			/* 54 = ioctl */
 	"reboot",			/* 55 = reboot */
@@ -110,7 +110,7 @@
 	"getpriority",			/* 100 = getpriority */
 	"old.send",		/* 101 = old send */
 	"old.recv",		/* 102 = old recv */
-	"old.sigreturn",		/* 103 = old sigreturn */
+	"obs_freebsd3_sigreturn",			/* 103 = obsolete freebsd3_sigreturn */
 	"bind",			/* 104 = bind */
 	"setsockopt",			/* 105 = setsockopt */
 	"listen",			/* 106 = listen */
@@ -118,7 +118,7 @@
 	"old.sigvec",		/* 108 = old sigvec */
 	"old.sigblock",		/* 109 = old sigblock */
 	"old.sigsetmask",		/* 110 = old sigsetmask */
-	"old.sigsuspend",		/* 111 = old sigsuspend */
+	"obs_freebsd3_sigsuspend",			/* 111 = obsolete freebsd3_sigsuspend */
 	"old.sigstack",		/* 112 = old sigstack */
 	"old.recvmsg",		/* 113 = old recvmsg */
 	"old.sendmsg",		/* 114 = old sendmsg */
Index: kern/syscalls.master
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/kern/syscalls.master,v
retrieving revision 1.5
diff -u -u -r1.5 syscalls.master
--- kern/syscalls.master	23 Oct 2003 00:04:58 -0000	1.5
+++ kern/syscalls.master	23 Oct 2003 03:25:49 -0000
@@ -1,4 +1,4 @@
- $DragonFly: src/sys/kern/syscalls.master,v 1.5 2003/10/23 00:04:58 daver Exp $
+ $DragonFly$
 
 ; @(#)syscalls.master	8.2 (Berkeley) 1/13/94
 ; $FreeBSD: src/sys/kern/syscalls.master,v 1.72.2.10 2002/07/12 08:22:46 alfred Exp $
@@ -96,17 +96,16 @@
 			    size_t offset, u_int scale); }
 45	STD	BSD	{ int ktrace(const char *fname, int ops, int facs, \
 			    int pid); }
-46	COMPAT	POSIX	{ int sigaction(int signum, struct osigaction *nsa, \
-			    struct osigaction *osa); }
+46	OBSOL	NOHIDE	freebsd3_sigaction
 47	MPSAFE	STD	POSIX	{ gid_t getgid(void); }
-48	MPSAFE	COMPAT	POSIX	{ int sigprocmask(int how, osigset_t mask); }
+48	OBSOL	NOHIDE	freebsd3_sigprocmask
 ; XXX note nonstandard (bogus) calling convention - the libc stub passes
 ; us the mask, not a pointer to it, and we return the old mask as the
 ; (int) return value.
 49	STD	BSD	{ int getlogin(char *namebuf, u_int namelen); }
 50	STD	BSD	{ int setlogin(char *namebuf); }
 51	STD	BSD	{ int acct(char *path); }
-52	COMPAT	POSIX	{ int sigpending(void); }
+52	OBSOL	NOHIDE	{ int sigpending(void); }
 53	STD	BSD	{ int sigaltstack(stack_t *ss, stack_t *oss); }
 54	STD	POSIX	{ int ioctl(int fd, u_long com, caddr_t data); }
 55	STD	BSD	{ int reboot(int opt); }
@@ -169,7 +168,7 @@
 100	STD	BSD	{ int getpriority(int which, int who); }
 101	COMPAT	BSD	{ int send(int s, caddr_t buf, int len, int flags); }
 102	COMPAT	BSD	{ int recv(int s, caddr_t buf, int len, int flags); }
-103	COMPAT	BSD	{ int sigreturn(struct osigcontext *sigcntxp); }
+103	OBSOL	NOHIDE	freebsd3_sigreturn
 104	STD	BSD	{ int bind(int s, caddr_t name, int namelen); }
 105	STD	BSD	{ int setsockopt(int s, int level, int name, \
 			    caddr_t val, int valsize); }
@@ -179,7 +178,7 @@
 			    struct sigvec *osv); }
 109	COMPAT	BSD	{ int sigblock(int mask); }
 110	COMPAT	BSD	{ int sigsetmask(int mask); }
-111	COMPAT	POSIX	{ int sigsuspend(osigset_t mask); }
+111	OBSOL	NOHIDE	freebsd3_sigsuspend
 ; XXX note nonstandard (bogus) calling convention - the libc stub passes
 ; us the mask, not a pointer to it.
 112	COMPAT	BSD	{ int sigstack(struct sigstack *nss, \
Index: sys/kern_syscall.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/kern_syscall.h,v
retrieving revision 1.8
diff -u -u -r1.8 kern_syscall.h
--- sys/kern_syscall.h	21 Oct 2003 01:05:09 -0000	1.8
+++ sys/kern_syscall.h	23 Oct 2003 06:37:27 -0000
@@ -35,10 +35,14 @@
 union fcntl_dat;
 struct mbuf;
 struct msghdr;
+struct sigaction;
+struct sigaltstack;
+struct __sigset;
 struct sf_hdtr;
 struct sockaddr;
 struct socket;
 struct sockopt;
+struct stat;
 struct uio;
 struct vnode;
 
@@ -48,6 +52,16 @@
 int kern_dup(enum dup_type type, int old, int new, int *res);
 int kern_fcntl(int fd, int cmd, union fcntl_dat *dat);
 int kern_fstat(int fd, struct stat *st);
+
+/*
+ * Prototypes for syscalls in kern/kern_sig.c
+ */
+int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact);
+int kern_sigprocmask(int how, struct __sigset *set, struct __sigset *oset);
+int kern_sigpending(struct __sigset *set);
+int kern_sigsuspend(struct __sigset *mask);
+int kern_sigaltstack(struct sigaltstack *ss, struct sigaltstack *oss);
+int kern_kill(int sig, int id);
 
 /*
  * Prototypes for syscalls in kern/sys_generic.c
Index: sys/signalvar.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/signalvar.h,v
retrieving revision 1.6
diff -u -u -r1.6 signalvar.h
--- sys/signalvar.h	13 Oct 2003 18:12:07 -0000	1.6
+++ sys/signalvar.h	23 Oct 2003 12:06:53 -0000
@@ -59,31 +59,10 @@
 	sigset_t ps_sigreset;		/* signals that reset when caught */
 	sigset_t ps_signodefer;		/* signals not masked while handled */
 	sigset_t ps_siginfo;		/* signals that want SA_SIGINFO args */
-	sigset_t ps_osigset;		/* signals that use osigset_t */
+	sigset_t ps_osigset;		/* pre FreeBSD-4 signals */
 	sigset_t ps_usertramp;		/* SunOS compat; libc sigtramp XXX */
 };
 
-/*
- * Compatibility.
- */
-typedef struct {
-	struct osigcontext si_sc;
-	int		si_signo;
-	int		si_code;
-	union sigval	si_value;
-} osiginfo_t;
-
-struct	osigaction {
-	union {
-		void    (*__sa_handler) (int);
-		void    (*__sa_sigaction) (int, osiginfo_t *, void *);
-	} __sigaction_u;		/* signal handler */
-	osigset_t	sa_mask;	/* signal mask to apply */
-	int		sa_flags;	/* see signal options below */
-};
-
-typedef void __osiginfohandler_t (int, osiginfo_t *, void *);
-
 /* additional signal action values, used only temporarily/internally */
 #define	SIG_CATCH	((__sighandler_t *)2)
 #define SIG_HOLD        ((__sighandler_t *)3)
@@ -146,9 +125,6 @@
 			(set1).__bits[__i] &= ~(set2).__bits[__i];	\
 	} while (0)
 
-#define SIGSETLO(set1, set2)	((set1).__bits[0] = (set2).__bits[0])
-#define SIGSETOLD(set, oset)	((set).__bits[0] = (oset))
-
 #define SIG_CANTMASK(set)						\
 	SIGDELSET(set, SIGKILL), SIGDELSET(set, SIGSTOP)
 
@@ -160,9 +136,6 @@
 	SIGDELSET(set, SIGCONT)
 
 #define sigcantmask	(sigmask(SIGKILL) | sigmask(SIGSTOP))
-
-#define SIG2OSIG(sig, osig)	osig = (sig).__bits[0]
-#define OSIG2SIG(osig, sig)	SIGEMPTYSET(sig); (sig).__bits[0] = osig
 
 static __inline int
 __sigisempty(sigset_t *set)
Index: sys/syscall-hide.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/syscall-hide.h,v
retrieving revision 1.9
diff -u -u -r1.9 syscall-hide.h
--- sys/syscall-hide.h	8 Oct 2003 01:30:32 -0000	1.9
+++ sys/syscall-hide.h	23 Oct 2003 03:25:54 -0000
@@ -2,8 +2,8 @@
  * System call hiders.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $DragonFly: src/sys/sys/syscall-hide.h,v 1.9 2003/10/08 01:30:32 daver Exp $
- * created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+ * $DragonFly$
+ * created from DragonFly
  */
 
 HIDE_POSIX(fork)
@@ -49,13 +49,10 @@
 HIDE_POSIX(getegid)
 HIDE_BSD(profil)
 HIDE_BSD(ktrace)
-HIDE_POSIX(sigaction)
 HIDE_POSIX(getgid)
-HIDE_POSIX(sigprocmask)
 HIDE_BSD(getlogin)
 HIDE_BSD(setlogin)
 HIDE_BSD(acct)
-HIDE_POSIX(sigpending)
 HIDE_BSD(sigaltstack)
 HIDE_POSIX(ioctl)
 HIDE_BSD(reboot)
@@ -102,14 +99,12 @@
 HIDE_BSD(getpriority)
 HIDE_BSD(send)
 HIDE_BSD(recv)
-HIDE_BSD(sigreturn)
 HIDE_BSD(bind)
 HIDE_BSD(setsockopt)
 HIDE_BSD(listen)
 HIDE_BSD(sigvec)
 HIDE_BSD(sigblock)
 HIDE_BSD(sigsetmask)
-HIDE_POSIX(sigsuspend)
 HIDE_BSD(sigstack)
 HIDE_BSD(recvmsg)
 HIDE_BSD(sendmsg)
Index: sys/syscall.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/syscall.h,v
retrieving revision 1.9
diff -u -u -r1.9 syscall.h
--- sys/syscall.h	8 Oct 2003 01:30:32 -0000	1.9
+++ sys/syscall.h	23 Oct 2003 03:25:54 -0000
@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $DragonFly: src/sys/sys/syscall.h,v 1.9 2003/10/08 01:30:32 daver Exp $
- * created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+ * $DragonFly$
+ * created from DragonFly
  */
 
 #define	SYS_syscall	0
@@ -52,13 +52,13 @@
 #define	SYS_getegid	43
 #define	SYS_profil	44
 #define	SYS_ktrace	45
-				/* 46 is old sigaction */
+				/* 46 is obsolete freebsd3_sigaction */
 #define	SYS_getgid	47
-				/* 48 is old sigprocmask */
+				/* 48 is obsolete freebsd3_sigprocmask */
 #define	SYS_getlogin	49
 #define	SYS_setlogin	50
 #define	SYS_acct	51
-				/* 52 is old sigpending */
+				/* 52 is obsolete { */
 #define	SYS_sigaltstack	53
 #define	SYS_ioctl	54
 #define	SYS_reboot	55
@@ -107,7 +107,7 @@
 #define	SYS_getpriority	100
 				/* 101 is old send */
 				/* 102 is old recv */
-				/* 103 is old sigreturn */
+				/* 103 is obsolete freebsd3_sigreturn */
 #define	SYS_bind	104
 #define	SYS_setsockopt	105
 #define	SYS_listen	106
@@ -115,7 +115,7 @@
 				/* 108 is old sigvec */
 				/* 109 is old sigblock */
 				/* 110 is old sigsetmask */
-				/* 111 is old sigsuspend */
+				/* 111 is obsolete freebsd3_sigsuspend */
 				/* 112 is old sigstack */
 				/* 113 is old recvmsg */
 				/* 114 is old sendmsg */
Index: sys/syscall.mk
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/syscall.mk,v
retrieving revision 1.9
diff -u -u -r1.9 syscall.mk
--- sys/syscall.mk	8 Oct 2003 01:30:32 -0000	1.9
+++ sys/syscall.mk	23 Oct 2003 03:25:54 -0000
@@ -1,7 +1,7 @@
 # DragonFly system call names.
 # DO NOT EDIT-- this file is automatically generated.
-# $DragonFly: src/sys/sys/syscall.mk,v 1.9 2003/10/08 01:30:32 daver Exp $
-# created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+# $DragonFly$
+# created from DragonFly
 MIASM =  \
 	syscall.o \
 	exit.o \
Index: sys/sysproto.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/sysproto.h,v
retrieving revision 1.9
diff -u -u -r1.9 sysproto.h
--- sys/sysproto.h	8 Oct 2003 01:30:32 -0000	1.9
+++ sys/sysproto.h	23 Oct 2003 03:25:54 -0000
@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $DragonFly: src/sys/sys/sysproto.h,v 1.9 2003/10/08 01:30:32 daver Exp $
- * created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+ * $DragonFly$
+ * created from DragonFly
  */
 
 #ifndef _SYS_SYSPROTO_H_
@@ -385,13 +385,6 @@
 	union usrmsg usrmsg;
 	char *	path;	char path_[PAD_(char *)];
 };
-struct	osigpending_args {
-#ifdef _KERNEL
-	union sysmsg sysmsg;
-#endif
-	union usrmsg usrmsg;
-	register_t dummy;
-};
 struct	sigaltstack_args {
 #ifdef _KERNEL
 	union sysmsg sysmsg;
@@ -2235,23 +2228,6 @@
 	char *	path;	char path_[PAD_(char *)];
 	struct ostat *	ub;	char ub_[PAD_(struct ostat *)];
 };
-struct	osigaction_args {
-#ifdef _KERNEL
-	union sysmsg sysmsg;
-#endif
-	union usrmsg usrmsg;
-	int	signum;	char signum_[PAD_(int)];
-	struct osigaction *	nsa;	char nsa_[PAD_(struct osigaction *)];
-	struct osigaction *	osa;	char osa_[PAD_(struct osigaction *)];
-};
-struct	osigprocmask_args {
-#ifdef _KERNEL
-	union sysmsg sysmsg;
-#endif
-	union usrmsg usrmsg;
-	int	how;	char how_[PAD_(int)];
-	osigset_t	mask;	char mask_[PAD_(osigset_t)];
-};
 struct	ofstat_args {
 #ifdef _KERNEL
 	union sysmsg sysmsg;
@@ -2318,13 +2294,6 @@
 	int	len;	char len_[PAD_(int)];
 	int	flags;	char flags_[PAD_(int)];
 };
-struct	osigreturn_args {
-#ifdef _KERNEL
-	union sysmsg sysmsg;
-#endif
-	union usrmsg usrmsg;
-	struct osigcontext *	sigcntxp;	char sigcntxp_[PAD_(struct osigcontext *)];
-};
 struct	osigvec_args {
 #ifdef _KERNEL
 	union sysmsg sysmsg;
@@ -2348,13 +2317,6 @@
 	union usrmsg usrmsg;
 	int	mask;	char mask_[PAD_(int)];
 };
-struct	osigsuspend_args {
-#ifdef _KERNEL
-	union sysmsg sysmsg;
-#endif
-	union usrmsg usrmsg;
-	osigset_t	mask;	char mask_[PAD_(osigset_t)];
-};
 struct	osigstack_args {
 #ifdef _KERNEL
 	union sysmsg sysmsg;
@@ -2454,9 +2416,6 @@
 int	olseek (struct olseek_args *);
 int	ostat (struct ostat_args *);
 int	olstat (struct olstat_args *);
-int	osigaction (struct osigaction_args *);
-int	osigprocmask (struct osigprocmask_args *);
-int	osigpending (struct osigpending_args *);
 int	ofstat (struct ofstat_args *);
 int	ogetkerninfo (struct getkerninfo_args *);
 int	ogetpagesize (struct getpagesize_args *);
@@ -2467,11 +2426,9 @@
 int	oaccept (struct accept_args *);
 int	osend (struct osend_args *);
 int	orecv (struct orecv_args *);
-int	osigreturn (struct osigreturn_args *);
 int	osigvec (struct osigvec_args *);
 int	osigblock (struct osigblock_args *);
 int	osigsetmask (struct osigsetmask_args *);
-int	osigsuspend (struct osigsuspend_args *);
 int	osigstack (struct osigstack_args *);
 int	orecvmsg (struct orecvmsg_args *);
 int	osendmsg (struct osendmsg_args *);
Index: sys/sysunion.h
===================================================================
RCS file: /nfs/daver/cvs-repos/cvs-dragonflybsd/src/sys/sys/sysunion.h,v
retrieving revision 1.6
diff -u -u -r1.6 sysunion.h
--- sys/sysunion.h	8 Oct 2003 01:30:32 -0000	1.6
+++ sys/sysunion.h	23 Oct 2003 03:25:54 -0000
@@ -2,8 +2,8 @@
  * Union of syscall args for messaging.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $DragonFly: src/sys/sys/sysunion.h,v 1.6 2003/10/08 01:30:32 daver Exp $
- * created from DragonFly: src/sys/kern/syscalls.master,v 1.2 2003/06/17 04:28:41 dillon Exp 
+ * $DragonFly$
+ * created from DragonFly
  */
 
 union sysunion {
@@ -64,17 +64,10 @@
 	struct	getegid_args getegid;
 	struct	profil_args profil;
 	struct	ktrace_args ktrace;
-#ifdef COMPAT_43
-	struct	osigaction_args osigaction;
-#endif
 	struct	getgid_args getgid;
-#ifdef COMPAT_43
-	struct	osigprocmask_args osigprocmask;
-#endif
 	struct	getlogin_args getlogin;
 	struct	setlogin_args setlogin;
 	struct	acct_args acct;
-	struct	osigpending_args osigpending;
 	struct	sigaltstack_args sigaltstack;
 	struct	ioctl_args ioctl;
 	struct	reboot_args reboot;
@@ -132,9 +125,6 @@
 #ifdef COMPAT_43
 	struct	orecv_args orecv;
 #endif
-#ifdef COMPAT_43
-	struct	osigreturn_args osigreturn;
-#endif
 	struct	bind_args bind;
 	struct	setsockopt_args setsockopt;
 	struct	listen_args listen;
@@ -146,9 +136,6 @@
 #endif
 #ifdef COMPAT_43
 	struct	osigsetmask_args osigsetmask;
-#endif
-#ifdef COMPAT_43
-	struct	osigsuspend_args osigsuspend;
 #endif
 #ifdef COMPAT_43
 	struct	osigstack_args osigstack;

