summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-05-13 20:36:02 +0000
committerjhb <jhb@FreeBSD.org>2003-05-13 20:36:02 +0000
commit89a4eb17deddba4ba8bfb0cf7c6801a608731f8c (patch)
tree0e2ba79e40f08e96bb98756b67576ff96caccfbc /sys/compat/svr4
parent3b9288c6f4df2bfdc2a41de3ae161246c310e064 (diff)
downloadFreeBSD-src-89a4eb17deddba4ba8bfb0cf7c6801a608731f8c.zip
FreeBSD-src-89a4eb17deddba4ba8bfb0cf7c6801a608731f8c.tar.gz
- Merge struct procsig with struct sigacts.
- Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson)
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_filio.c15
-rw-r--r--sys/compat/svr4/svr4_misc.c8
2 files changed, 15 insertions, 8 deletions
diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c
index 870da5d..374338f 100644
--- a/sys/compat/svr4/svr4_filio.c
+++ b/sys/compat/svr4/svr4_filio.c
@@ -132,10 +132,21 @@ svr4_sys_read(td, uap)
DPRINTF(("svr4_read(%d, 0x%0x, %d) = %d\n",
uap->fd, uap->buf, uap->nbyte, rv));
if (rv == EAGAIN) {
+#ifdef DEBUG_SVR4
+ struct sigacts *ps;
+
+ PROC_LOCK(td->td_proc);
+ ps = td->td_proc->p_sigacts;
+ mtx_lock(&ps->ps_mtx);
+#endif
DPRINTF(("sigmask = 0x%x\n", td->td_sigmask));
- DPRINTF(("sigignore = 0x%x\n", td->td_proc->p_sigignore));
- DPRINTF(("sigcaught = 0x%x\n", td->td_proc->p_sigcatch));
+ DPRINTF(("sigignore = 0x%x\n", ps->ps_sigignore));
+ DPRINTF(("sigcaught = 0x%x\n", ps->ps_sigcatch));
DPRINTF(("siglist = 0x%x\n", td->td_siglist));
+#ifdef DEBUG_SVR4
+ mtx_unlock(&ps->ps_mtx);
+ PROC_UNLOCK(td->td_proc);
+#endif
}
#if defined(GROTTY_READ_HACK)
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 81eef66..22fdc66 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1363,12 +1363,8 @@ loop:
sx_xunlock(&proctree_lock);
PROC_LOCK(q);
- if (--q->p_procsig->ps_refcnt == 0) {
- if (q->p_sigacts != &q->p_uarea->u_sigacts)
- FREE(q->p_sigacts, M_SUBPROC);
- FREE(q->p_procsig, M_SUBPROC);
- q->p_procsig = NULL;
- }
+ sigacts_free(q->p_sigacts);
+ q->p_sigacts = NULL;
PROC_UNLOCK(q);
/*
OpenPOWER on IntegriCloud