1#	$NetBSD: procs,v 1.2 2009/11/18 18:05:51 eeh Exp $
2
3define procs
4	set $i = 0
5
6	while ($i < 2)
7		if ($i == 0)
8			set $p = allproc.lh_first
9		end
10		if ($p)
11			printf "            proc   pid     flag stat nlwps            lwp  comm\n"
12		end
13		while ($p)
14			printf "%16lx %5d %8x %4x %5d %16lx %s", \
15				$p, $p->p_pid, \
16				$p->p_flag, $p->p_stat, $p->p_nlwps, $p->p_lwps.lh_first, \
17				(char *) $p->p_comm
18			printf "\n"
19			set $p = $p->p_list.le_next
20		end
21		set $i++
22	end
23end
24