kern_sig.c (96620) | kern_sig.c (96886) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 |
39 * $FreeBSD: head/sys/kern/kern_sig.c 96620 2002-05-14 23:07:15Z rwatson $ | 39 * $FreeBSD: head/sys/kern/kern_sig.c 96886 2002-05-19 00:14:50Z jhb $ |
40 */ 41 42#include "opt_compat.h" 43#include "opt_ktrace.h" 44 45#include <sys/param.h> 46#include <sys/kernel.h> 47#include <sys/sysproto.h> --- 959 unchanged lines hidden (view full) --- 1007 sx_slock(&allproc_lock); 1008 LIST_FOREACH(p, &allproc, p_list) { 1009 PROC_LOCK(p); 1010 if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || 1011 p == td->td_proc) { 1012 PROC_UNLOCK(p); 1013 continue; 1014 } | 40 */ 41 42#include "opt_compat.h" 43#include "opt_ktrace.h" 44 45#include <sys/param.h> 46#include <sys/kernel.h> 47#include <sys/sysproto.h> --- 959 unchanged lines hidden (view full) --- 1007 sx_slock(&allproc_lock); 1008 LIST_FOREACH(p, &allproc, p_list) { 1009 PROC_LOCK(p); 1010 if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || 1011 p == td->td_proc) { 1012 PROC_UNLOCK(p); 1013 continue; 1014 } |
1015 if (p_cansignal(td->td_proc, p, sig) == 0) { | 1015 if (p_cansignal(td, p, sig) == 0) { |
1016 nfound++; 1017 if (sig) 1018 psignal(p, sig); 1019 } 1020 PROC_UNLOCK(p); 1021 } 1022 sx_sunlock(&allproc_lock); 1023 } else { --- 17 unchanged lines hidden (view full) --- 1041 if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) { 1042 PROC_UNLOCK(p); 1043 continue; 1044 } 1045 if (p->p_stat == SZOMB) { 1046 PROC_UNLOCK(p); 1047 continue; 1048 } | 1016 nfound++; 1017 if (sig) 1018 psignal(p, sig); 1019 } 1020 PROC_UNLOCK(p); 1021 } 1022 sx_sunlock(&allproc_lock); 1023 } else { --- 17 unchanged lines hidden (view full) --- 1041 if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) { 1042 PROC_UNLOCK(p); 1043 continue; 1044 } 1045 if (p->p_stat == SZOMB) { 1046 PROC_UNLOCK(p); 1047 continue; 1048 } |
1049 if (p_cansignal(td->td_proc, p, sig) == 0) { | 1049 if (p_cansignal(td, p, sig) == 0) { |
1050 nfound++; 1051 if (sig) 1052 psignal(p, sig); 1053 } 1054 PROC_UNLOCK(p); 1055 } 1056 PGRP_UNLOCK(pgrp); 1057 } --- 21 unchanged lines hidden (view full) --- 1079 if ((u_int)uap->signum > _SIG_MAXSIG) 1080 return (EINVAL); 1081 1082 mtx_lock(&Giant); 1083 if (uap->pid > 0) { 1084 /* kill single process */ 1085 if ((p = pfind(uap->pid)) == NULL) { 1086 error = ESRCH; | 1050 nfound++; 1051 if (sig) 1052 psignal(p, sig); 1053 } 1054 PROC_UNLOCK(p); 1055 } 1056 PGRP_UNLOCK(pgrp); 1057 } --- 21 unchanged lines hidden (view full) --- 1079 if ((u_int)uap->signum > _SIG_MAXSIG) 1080 return (EINVAL); 1081 1082 mtx_lock(&Giant); 1083 if (uap->pid > 0) { 1084 /* kill single process */ 1085 if ((p = pfind(uap->pid)) == NULL) { 1086 error = ESRCH; |
1087 } else if ((error = p_cansignal(td->td_proc, p, uap->signum)) 1088 != 0) { | 1087 } else if ((error = p_cansignal(td, p, uap->signum)) != 0) { |
1089 PROC_UNLOCK(p); 1090 } else { 1091 if (uap->signum) 1092 psignal(p, uap->signum); 1093 PROC_UNLOCK(p); 1094 error = 0; 1095 } 1096 } else { --- 1058 unchanged lines hidden --- | 1088 PROC_UNLOCK(p); 1089 } else { 1090 if (uap->signum) 1091 psignal(p, uap->signum); 1092 PROC_UNLOCK(p); 1093 error = 0; 1094 } 1095 } else { --- 1058 unchanged lines hidden --- |