diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-15 04:52:41 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-15 04:52:41 +0000 |
commit | 71771abcbf45c58af4735979b21a2e7604cb42bf (patch) | |
tree | 1e12c4f7e6473b7549d0bf973e6f96bd314644b8 /lib/libkvm | |
parent | 847e8a9bf0e99af86e8791ea570d84b9d3bc54f9 (diff) |
Correct the sharing of the signal handling state: stuff that should
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves
to struct sigacts, wihle stuff that should be per rthread (ps_oldmask,
SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping
state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread
until our locking around coredumping is better.
Oh, and remove the old SunOS-compat ps_usertramp member.
"I like the sound of this" tedu@
Diffstat (limited to 'lib/libkvm')
-rw-r--r-- | lib/libkvm/kvm_proc2.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_proc2.c b/lib/libkvm/kvm_proc2.c index 1ba2e38945c..5610641292e 100644 --- a/lib/libkvm/kvm_proc2.c +++ b/lib/libkvm/kvm_proc2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_proc2.c,v 1.4 2011/03/12 04:54:28 guenther Exp $ */ +/* $OpenBSD: kvm_proc2.c,v 1.5 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: kvm_proc.c,v 1.30 1999/03/24 05:50:50 mrg Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -77,6 +77,7 @@ #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/tty.h> +#include <sys/signalvar.h> #include <stddef.h> #include <stdlib.h> #include <string.h> @@ -113,6 +114,7 @@ kvm_proclist(kvm_t *kd, int op, int arg, struct proc *p, struct process process, process2; struct pgrp pgrp; struct tty tty; + struct sigacts sa; struct vmspace vm, *vmp; struct plimit limits, *limp; struct pstats pstats, *ps; @@ -188,6 +190,11 @@ kvm_proclist(kvm_t *kd, int op, int arg, struct proc *p, } else leader_pid = 0; + if (KREAD(kd, (u_long)proc.p_sigacts, &sa)) { + _kvm_err(kd, kd->program, "can't read sigacts at %x", + proc.p_sigacts); + return (-1); + } switch (op) { case KERN_PROC_PID: @@ -266,7 +273,7 @@ kvm_proclist(kvm_t *kd, int op, int arg, struct proc *p, #define do_copy_str(_d, _s, _l) kvm_read(kd, (u_long)(_s), (_d), (_l)-1) FILL_KPROC(&kp, do_copy_str, &proc, &process, &pcred, &ucred, - &pgrp, p, proc.p_p, &sess, vmp, limp, ps); + &pgrp, p, proc.p_p, &sess, vmp, limp, ps, &sa); #undef do_copy_str /* stuff that's too painful to generalize into the macros */ |