Deleted Added
full compact
kvm_proc.c (130552) kvm_proc.c (130640)
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 *

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

37
38#if 0
39#if defined(LIBC_SCCS) && !defined(lint)
40static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
41#endif /* LIBC_SCCS and not lint */
42#endif
43
44#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 *

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

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

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

246 if (sess.s_leader == p)
247 kp->ki_kiflag |= KI_SLEADER;
248 if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) {
249 if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) {
250 _kvm_err(kd, kd->program,
251 "can't read tty at %x", sess.s_ttyp);
252 return (-1);
253 }
46
47/*
48 * Proc traversal interface for kvm. ps and w are (probably) the exclusive
49 * users of this code, so we've factored it out into a separate module.
50 * Thus, we keep this grunge out of the other kvm applications (i.e.,
51 * most other applications are interested only in open/close/read/nlist).
52 */
53

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

246 if (sess.s_leader == p)
247 kp->ki_kiflag |= KI_SLEADER;
248 if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) {
249 if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) {
250 _kvm_err(kd, kd->program,
251 "can't read tty at %x", sess.s_ttyp);
252 return (-1);
253 }
254 kp->ki_tdev = tty.t_dev;
254 kp->ki_tdev = tty.t_dev; /* XXX: wrong */
255 if (tty.t_pgrp != NULL) {
256 if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) {
257 _kvm_err(kd, kd->program,
258 "can't read tpgrp at %x",
259 tty.t_pgrp);
260 return (-1);
261 }
262 kp->ki_tpgid = pgrp.pg_id;

--- 707 unchanged lines hidden ---
255 if (tty.t_pgrp != NULL) {
256 if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) {
257 _kvm_err(kd, kd->program,
258 "can't read tpgrp at %x",
259 tty.t_pgrp);
260 return (-1);
261 }
262 kp->ki_tpgid = pgrp.pg_id;

--- 707 unchanged lines hidden ---