procfs_status.c (116361) | procfs_status.c (123247) |
---|---|
1/* 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 24 unchanged lines hidden (view full) --- 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 38 * 39 * From: 40 * $Id: procfs_status.c,v 3.1 1993/12/15 09:40:17 jsp Exp $ | 1/* 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 24 unchanged lines hidden (view full) --- 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 38 * 39 * From: 40 * $Id: procfs_status.c,v 3.1 1993/12/15 09:40:17 jsp Exp $ |
41 * $FreeBSD: head/sys/fs/procfs/procfs_status.c 116361 2003-06-15 00:31:24Z davidxu $ | 41 * $FreeBSD: head/sys/fs/procfs/procfs_status.c 123247 2003-12-07 17:40:00Z des $ |
42 */ 43 44#include <sys/param.h> 45#include <sys/kernel.h> 46#include <sys/systm.h> 47#include <sys/exec.h> 48#include <sys/lock.h> 49#include <sys/mutex.h> --- 30 unchanged lines hidden (view full) --- 80 pid = p->p_pid; 81 PROC_LOCK(p); 82 ppid = p->p_pptr ? p->p_pptr->p_pid : 0; 83 pgid = p->p_pgrp->pg_id; 84 sess = p->p_pgrp->pg_session; 85 SESS_LOCK(sess); 86 sid = sess->s_leader ? sess->s_leader->p_pid : 0; 87 | 42 */ 43 44#include <sys/param.h> 45#include <sys/kernel.h> 46#include <sys/systm.h> 47#include <sys/exec.h> 48#include <sys/lock.h> 49#include <sys/mutex.h> --- 30 unchanged lines hidden (view full) --- 80 pid = p->p_pid; 81 PROC_LOCK(p); 82 ppid = p->p_pptr ? p->p_pptr->p_pid : 0; 83 pgid = p->p_pgrp->pg_id; 84 sess = p->p_pgrp->pg_session; 85 SESS_LOCK(sess); 86 sid = sess->s_leader ? sess->s_leader->p_pid : 0; 87 |
88/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg 89 euid ruid rgid,egid,groups[1 .. NGROUPS] | 88/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg 89 euid ruid rgid,egid,groups[1 .. NGROUPS] |
90*/ 91 92 pc = p->p_comm; 93 do { 94 if (*pc < 33 || *pc > 126 || *pc == '\\') 95 sbuf_printf(sb, "\\%03o", *pc); 96 else 97 sbuf_putc(sb, *pc); --- 51 unchanged lines hidden (view full) --- 149 150 cr = p->p_ucred; 151 152 sbuf_printf(sb, " %lu %lu %lu", 153 (u_long)cr->cr_uid, 154 (u_long)cr->cr_ruid, 155 (u_long)cr->cr_rgid); 156 | 90*/ 91 92 pc = p->p_comm; 93 do { 94 if (*pc < 33 || *pc > 126 || *pc == '\\') 95 sbuf_printf(sb, "\\%03o", *pc); 96 else 97 sbuf_putc(sb, *pc); --- 51 unchanged lines hidden (view full) --- 149 150 cr = p->p_ucred; 151 152 sbuf_printf(sb, " %lu %lu %lu", 153 (u_long)cr->cr_uid, 154 (u_long)cr->cr_ruid, 155 (u_long)cr->cr_rgid); 156 |
157 /* egid (cr->cr_svgid) is equal to cr_ngroups[0] | 157 /* egid (cr->cr_svgid) is equal to cr_ngroups[0] |
158 see also getegid(2) in /sys/kern/kern_prot.c */ 159 160 for (i = 0; i < cr->cr_ngroups; i++) { 161 sbuf_printf(sb, ",%lu", (u_long)cr->cr_groups[i]); 162 } 163 164 if (jailed(p->p_ucred)) { 165 mtx_lock(&p->p_ucred->cr_prison->pr_mtx); --- 49 unchanged lines hidden --- | 158 see also getegid(2) in /sys/kern/kern_prot.c */ 159 160 for (i = 0; i < cr->cr_ngroups; i++) { 161 sbuf_printf(sb, ",%lu", (u_long)cr->cr_groups[i]); 162 } 163 164 if (jailed(p->p_ucred)) { 165 mtx_lock(&p->p_ucred->cr_prison->pr_mtx); --- 49 unchanged lines hidden --- |