kern_procctl.c (172207) | kern_procctl.c (172485) |
---|---|
1/*- 2 * Copyright (c) 1994, Sean Eric Fagan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994, Sean Eric Fagan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/sys_process.c 172207 2007-09-17 05:31:39Z jeff $"); | 33__FBSDID("$FreeBSD: head/sys/kern/sys_process.c 172485 2007-10-09 00:03:39Z jeff $"); |
34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/lock.h> 40#include <sys/mutex.h> 41#include <sys/syscallsubr.h> --- 732 unchanged lines hidden (view full) --- 774 /* childproc_continued(p); */ 775 } 776 777 sendsig: 778 if (proctree_locked) { 779 sx_xunlock(&proctree_lock); 780 proctree_locked = 0; 781 } | 34 35#include "opt_compat.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/lock.h> 40#include <sys/mutex.h> 41#include <sys/syscallsubr.h> --- 732 unchanged lines hidden (view full) --- 774 /* childproc_continued(p); */ 775 } 776 777 sendsig: 778 if (proctree_locked) { 779 sx_xunlock(&proctree_lock); 780 proctree_locked = 0; 781 } |
782 /* deliver or queue signal */ 783 thread_lock(td2); 784 td2->td_flags &= ~TDF_XSIG; 785 thread_unlock(td2); 786 td2->td_xsig = data; | |
787 p->p_xstat = data; 788 p->p_xthread = NULL; 789 if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) != 0) { | 782 p->p_xstat = data; 783 p->p_xthread = NULL; 784 if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) != 0) { |
785 /* deliver or queue signal */ 786 thread_lock(td2); 787 td2->td_flags &= ~TDF_XSIG; 788 thread_unlock(td2); 789 td2->td_xsig = data; 790 |
|
790 PROC_SLOCK(p); 791 if (req == PT_DETACH) { 792 struct thread *td3; 793 FOREACH_THREAD_IN_PROC(p, td3) { 794 thread_lock(td3); 795 td3->td_flags &= ~TDF_DBSUSPEND; 796 thread_unlock(td3); 797 } --- 6 unchanged lines hidden (view full) --- 804#ifdef KSE 805 PROC_SUNLOCK(p); 806 thread_continued(p); 807 PROC_SLOCK(p); 808#endif 809 p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); 810 thread_unsuspend(p); 811 PROC_SUNLOCK(p); | 791 PROC_SLOCK(p); 792 if (req == PT_DETACH) { 793 struct thread *td3; 794 FOREACH_THREAD_IN_PROC(p, td3) { 795 thread_lock(td3); 796 td3->td_flags &= ~TDF_DBSUSPEND; 797 thread_unlock(td3); 798 } --- 6 unchanged lines hidden (view full) --- 805#ifdef KSE 806 PROC_SUNLOCK(p); 807 thread_continued(p); 808 PROC_SLOCK(p); 809#endif 810 p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); 811 thread_unsuspend(p); 812 PROC_SUNLOCK(p); |
813 } else { 814 if (data) 815 psignal(p, data); |
|
812 } | 816 } |
813 814 if (data) 815 psignal(p, data); 816 | |
817 break; 818 819 case PT_WRITE_I: 820 case PT_WRITE_D: 821 write = 1; 822 /* FALLTHROUGH */ 823 case PT_READ_I: 824 case PT_READ_D: --- 208 unchanged lines hidden --- | 817 break; 818 819 case PT_WRITE_I: 820 case PT_WRITE_D: 821 write = 1; 822 /* FALLTHROUGH */ 823 case PT_READ_I: 824 case PT_READ_D: --- 208 unchanged lines hidden --- |