Deleted Added
full compact
kvm_proc.c (170178) kvm_proc.c (172207)
1/*-
2 * Copyright (c) 1989, 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software developed by the Computer Systems
6 * Engineering group at Lawrence Berkeley Laboratory under DARPA contract
7 * BG 91-66 and contributed to Berkeley.
8 *

--- 24 unchanged lines hidden (view full) ---

33
34#if 0
35#if defined(LIBC_SCCS) && !defined(lint)
36static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
37#endif /* LIBC_SCCS and not lint */
38#endif
39
40#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software developed by the Computer Systems
6 * Engineering group at Lawrence Berkeley Laboratory under DARPA contract
7 * BG 91-66 and contributed to Berkeley.
8 *

--- 24 unchanged lines hidden (view full) ---

33
34#if 0
35#if defined(LIBC_SCCS) && !defined(lint)
36static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
37#endif /* LIBC_SCCS and not lint */
38#endif
39
40#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/lib/libkvm/kvm_proc.c 170178 2007-06-01 04:14:57Z jeff $");
41__FBSDID("$FreeBSD: head/lib/libkvm/kvm_proc.c 172207 2007-09-17 05:31:39Z jeff $");
42
43/*
44 * Proc traversal interface for kvm. ps and w are (probably) the exclusive
45 * users of this code, so we've factored it out into a separate module.
46 * Thus, we keep this grunge out of the other kvm applications (i.e.,
47 * most other applications are interested only in open/close/read/nlist).
48 */
49

--- 154 unchanged lines hidden (view full) ---

204 _kvm_err(kd, kd->program,
205 "can't read sigacts at %x", proc.p_sigacts);
206 return (-1);
207 }
208 kp->ki_sigignore = sigacts.ps_sigignore;
209 kp->ki_sigcatch = sigacts.ps_sigcatch;
210 }
211#if 0
42
43/*
44 * Proc traversal interface for kvm. ps and w are (probably) the exclusive
45 * users of this code, so we've factored it out into a separate module.
46 * Thus, we keep this grunge out of the other kvm applications (i.e.,
47 * most other applications are interested only in open/close/read/nlist).
48 */
49

--- 154 unchanged lines hidden (view full) ---

204 _kvm_err(kd, kd->program,
205 "can't read sigacts at %x", proc.p_sigacts);
206 return (-1);
207 }
208 kp->ki_sigignore = sigacts.ps_sigignore;
209 kp->ki_sigcatch = sigacts.ps_sigcatch;
210 }
211#if 0
212 if ((proc.p_sflag & PS_INMEM) && proc.p_stats != NULL) {
212 if ((proc.p_flag & P_INMEM) && proc.p_stats != NULL) {
213 if (KREAD(kd, (u_long)proc.p_stats, &pstats)) {
214 _kvm_err(kd, kd->program,
215 "can't read stats at %x", proc.p_stats);
216 return (-1);
217 }
218 kp->ki_start = pstats.p_start;
219
220 /*

--- 144 unchanged lines hidden (view full) ---

365 SIGSETOR(kp->ki_siglist, mtd.td_siglist);
366 kp->ki_sigmask = mtd.td_sigmask;
367 kp->ki_xstat = proc.p_xstat;
368 kp->ki_acflag = proc.p_acflag;
369 kp->ki_lock = proc.p_lock;
370 if (proc.p_state != PRS_ZOMBIE) {
371 kp->ki_swtime = proc.p_swtime;
372 kp->ki_flag = proc.p_flag;
213 if (KREAD(kd, (u_long)proc.p_stats, &pstats)) {
214 _kvm_err(kd, kd->program,
215 "can't read stats at %x", proc.p_stats);
216 return (-1);
217 }
218 kp->ki_start = pstats.p_start;
219
220 /*

--- 144 unchanged lines hidden (view full) ---

365 SIGSETOR(kp->ki_siglist, mtd.td_siglist);
366 kp->ki_sigmask = mtd.td_sigmask;
367 kp->ki_xstat = proc.p_xstat;
368 kp->ki_acflag = proc.p_acflag;
369 kp->ki_lock = proc.p_lock;
370 if (proc.p_state != PRS_ZOMBIE) {
371 kp->ki_swtime = proc.p_swtime;
372 kp->ki_flag = proc.p_flag;
373 kp->ki_sflag = proc.p_sflag;
373 kp->ki_sflag = 0;
374 kp->ki_nice = proc.p_nice;
375 kp->ki_traceflag = proc.p_traceflag;
376 if (proc.p_state == PRS_NORMAL) {
377 if (TD_ON_RUNQ(&mtd) ||
378 TD_CAN_RUN(&mtd) ||
379 TD_IS_RUNNING(&mtd)) {
380 kp->ki_stat = SRUN;
381 } else if (mtd.td_state ==

--- 615 unchanged lines hidden ---
374 kp->ki_nice = proc.p_nice;
375 kp->ki_traceflag = proc.p_traceflag;
376 if (proc.p_state == PRS_NORMAL) {
377 if (TD_ON_RUNQ(&mtd) ||
378 TD_CAN_RUN(&mtd) ||
379 TD_IS_RUNNING(&mtd)) {
380 kp->ki_stat = SRUN;
381 } else if (mtd.td_state ==

--- 615 unchanged lines hidden ---