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 90717 2002-02-16 05:59:26Z bde $
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/proc.h>
52#include <sys/resourcevar.h>
53#include <sys/sbuf.h>
54#include <sys/tty.h>
55
56#include <vm/vm.h>
57#include <vm/pmap.h>
58#include <vm/vm_param.h>
--- 11 unchanged lines hidden (view full) ---
70 char *pc;
71 char *sep;
72 int pid, ppid, pgid, sid;
73 int i;
74
75 pid = p->p_pid;
76 PROC_LOCK(p);
77 ppid = p->p_pptr ? p->p_pptr->p_pid : 0;
78 PROC_UNLOCK(p);
79 pgid = p->p_pgrp->pg_id;
80 sess = p->p_pgrp->pg_session;
81 sid = sess->s_leader ? sess->s_leader->p_pid : 0;
82
83/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg
84 euid ruid rgid,egid,groups[1 .. NGROUPS]
85*/
86
87 pc = p->p_comm;
88 do {
--- 12 unchanged lines hidden (view full) ---
101 if (sess->s_ttyvp) {
102 sbuf_printf(sb, "%sctty", sep);
103 sep = ",";
104 }
105 if (SESS_LEADER(p)) {
106 sbuf_printf(sb, "%ssldr", sep);
107 sep = ",";
108 }
109 if (*sep != ',') {
110 sbuf_printf(sb, "noflags");
111 }
112
113 mtx_lock_spin(&sched_lock);
114 if (p->p_sflag & PS_INMEM) {
115 struct timeval ut, st;
116
--- 79 unchanged lines hidden ---
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 90717 2002-02-16 05:59:26Z bde $
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/proc.h>
52#include <sys/resourcevar.h>
53#include <sys/sbuf.h>
54#include <sys/tty.h>
55
56#include <vm/vm.h>
57#include <vm/pmap.h>
58#include <vm/vm_param.h>
--- 11 unchanged lines hidden (view full) ---
70 char *pc;
71 char *sep;
72 int pid, ppid, pgid, sid;
73 int i;
74
75 pid = p->p_pid;
76 PROC_LOCK(p);
77 ppid = p->p_pptr ? p->p_pptr->p_pid : 0;
78 PROC_UNLOCK(p);
79 pgid = p->p_pgrp->pg_id;
80 sess = p->p_pgrp->pg_session;
81 sid = sess->s_leader ? sess->s_leader->p_pid : 0;
82
83/* comm pid ppid pgid sid maj,min ctty,sldr start ut st wmsg
84 euid ruid rgid,egid,groups[1 .. NGROUPS]
85*/
86
87 pc = p->p_comm;
88 do {
--- 12 unchanged lines hidden (view full) ---
101 if (sess->s_ttyvp) {
102 sbuf_printf(sb, "%sctty", sep);
103 sep = ",";
104 }
105 if (SESS_LEADER(p)) {
106 sbuf_printf(sb, "%ssldr", sep);
107 sep = ",";
108 }
109 if (*sep != ',') {
110 sbuf_printf(sb, "noflags");
111 }
112
113 mtx_lock_spin(&sched_lock);
114 if (p->p_sflag & PS_INMEM) {
115 struct timeval ut, st;
116
--- 79 unchanged lines hidden ---