kvm_proc.c (185435) | kvm_proc.c (194498) |
---|---|
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 185435 2008-11-29 14:32:14Z bz $"); | 41__FBSDID("$FreeBSD: head/lib/libkvm/kvm_proc.c 194498 2009-06-19 17:10:35Z brooks $"); |
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 --- 91 unchanged lines hidden (view full) --- 141 } 142 } 143 if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { 144 kp->ki_ruid = ucred.cr_ruid; 145 kp->ki_svuid = ucred.cr_svuid; 146 kp->ki_rgid = ucred.cr_rgid; 147 kp->ki_svgid = ucred.cr_svgid; 148 kp->ki_ngroups = ucred.cr_ngroups; | 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 --- 91 unchanged lines hidden (view full) --- 141 } 142 } 143 if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { 144 kp->ki_ruid = ucred.cr_ruid; 145 kp->ki_svuid = ucred.cr_svuid; 146 kp->ki_rgid = ucred.cr_rgid; 147 kp->ki_svgid = ucred.cr_svgid; 148 kp->ki_ngroups = ucred.cr_ngroups; |
149 bcopy(ucred.cr_groups, kp->ki_groups, 150 NGROUPS * sizeof(gid_t)); | 149 kp->ki_groups = ucred.cr_groups; |
151 kp->ki_uid = ucred.cr_uid; 152 if (ucred.cr_prison != NULL) { 153 if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) { 154 _kvm_err(kd, kd->program, 155 "can't read prison at %x", 156 ucred.cr_prison); 157 return (-1); 158 } --- 854 unchanged lines hidden --- | 150 kp->ki_uid = ucred.cr_uid; 151 if (ucred.cr_prison != NULL) { 152 if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) { 153 _kvm_err(kd, kd->program, 154 "can't read prison at %x", 155 ucred.cr_prison); 156 return (-1); 157 } --- 854 unchanged lines hidden --- |