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 91140 2002-02-23 11:12:57Z tanimura $ |
42 */ 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/exec.h> 47#include <sys/lock.h> 48#include <sys/mutex.h> 49#include <sys/jail.h> 50#include <sys/malloc.h> |
51#include <sys/mutex.h> 52#include <sys/sx.h> |
53#include <sys/proc.h> 54#include <sys/resourcevar.h> 55#include <sys/sbuf.h> 56#include <sys/tty.h> 57 58#include <vm/vm.h> 59#include <vm/pmap.h> 60#include <vm/vm_param.h> --- 11 unchanged lines hidden (view full) --- 72 char *pc; 73 char *sep; 74 int pid, ppid, pgid, sid; 75 int i; 76 77 pid = p->p_pid; 78 PROC_LOCK(p); 79 ppid = p->p_pptr ? p->p_pptr->p_pid : 0; |
80 pgid = p->p_pgrp->pg_id; 81 sess = p->p_pgrp->pg_session; |
82 SESS_LOCK(sess); |
83 sid = sess->s_leader ? sess->s_leader->p_pid : 0; 84 85/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg 86 euid ruid rgid,egid,groups[1 .. NGROUPS] 87*/ 88 89 pc = p->p_comm; 90 do { --- 12 unchanged lines hidden (view full) --- 103 if (sess->s_ttyvp) { 104 sbuf_printf(sb, "%sctty", sep); 105 sep = ","; 106 } 107 if (SESS_LEADER(p)) { 108 sbuf_printf(sb, "%ssldr", sep); 109 sep = ","; 110 } |
111 SESS_UNLOCK(sess); 112 PROC_UNLOCK(p); |
113 if (*sep != ',') { 114 sbuf_printf(sb, "noflags"); 115 } 116 117 mtx_lock_spin(&sched_lock); 118 if (p->p_sflag & PS_INMEM) { 119 struct timeval ut, st; 120 --- 79 unchanged lines hidden --- |