xref: /illumos-gate/usr/src/uts/common/sys/procfs.h (revision c6402783)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*c6402783Sakolb  * Common Development and Distribution License (the "License").
6*c6402783Sakolb  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21*c6402783Sakolb 
227c478bd9Sstevel@tonic-gate /*
23*c6402783Sakolb  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_PROCFS_H
287c478bd9Sstevel@tonic-gate #define	_SYS_PROCFS_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate /*
377c478bd9Sstevel@tonic-gate  * This definition is temporary.  Structured proc is the preferred API,
387c478bd9Sstevel@tonic-gate  * and the older ioctl-based interface will be removed in a future version
397c478bd9Sstevel@tonic-gate  * of Solaris.  Until then, by default, including <sys/procfs.h> will
407c478bd9Sstevel@tonic-gate  * provide the older ioctl-based /proc definitions.  To get the structured
417c478bd9Sstevel@tonic-gate  * /proc definitions, either include <procfs.h> or define _STRUCTURED_PROC
427c478bd9Sstevel@tonic-gate  * to be 1 before including <sys/procfs.h>.
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate #ifndef	_STRUCTURED_PROC
457c478bd9Sstevel@tonic-gate #define	_STRUCTURED_PROC	0
467c478bd9Sstevel@tonic-gate #endif
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate #if !defined(_KERNEL) && _STRUCTURED_PROC == 0
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #include <sys/old_procfs.h>
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate #else	/* !defined(_KERNEL) && _STRUCTURED_PROC == 0 */
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
557c478bd9Sstevel@tonic-gate #include <sys/types.h>
567c478bd9Sstevel@tonic-gate #include <sys/time_impl.h>
577c478bd9Sstevel@tonic-gate #include <sys/signal.h>
587c478bd9Sstevel@tonic-gate #include <sys/siginfo.h>
597c478bd9Sstevel@tonic-gate #include <sys/fault.h>
607c478bd9Sstevel@tonic-gate #include <sys/syscall.h>
617c478bd9Sstevel@tonic-gate #include <sys/pset.h>
627c478bd9Sstevel@tonic-gate #include <sys/procfs_isa.h>
637c478bd9Sstevel@tonic-gate #include <sys/priv.h>
64*c6402783Sakolb #include <sys/lgrp.h>
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
677c478bd9Sstevel@tonic-gate #error	"Cannot use procfs in the large file compilation environment"
687c478bd9Sstevel@tonic-gate #endif
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * System call interfaces for /proc.
727c478bd9Sstevel@tonic-gate  */
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate /*
757c478bd9Sstevel@tonic-gate  * Control codes (long values) for messages written to ctl and lwpctl files.
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate #define	PCNULL   0L	/* null request, advance to next message */
787c478bd9Sstevel@tonic-gate #define	PCSTOP   1L	/* direct process or lwp to stop and wait for stop */
797c478bd9Sstevel@tonic-gate #define	PCDSTOP  2L	/* direct process or lwp to stop */
807c478bd9Sstevel@tonic-gate #define	PCWSTOP  3L	/* wait for process or lwp to stop, no timeout */
817c478bd9Sstevel@tonic-gate #define	PCTWSTOP 4L	/* wait for stop, with long millisecond timeout arg */
827c478bd9Sstevel@tonic-gate #define	PCRUN    5L	/* make process/lwp runnable, w/ long flags argument */
837c478bd9Sstevel@tonic-gate #define	PCCSIG   6L	/* clear current signal from lwp */
847c478bd9Sstevel@tonic-gate #define	PCCFAULT 7L	/* clear current fault from lwp */
857c478bd9Sstevel@tonic-gate #define	PCSSIG   8L	/* set current signal from siginfo_t argument */
867c478bd9Sstevel@tonic-gate #define	PCKILL   9L	/* post a signal to process/lwp, long argument */
877c478bd9Sstevel@tonic-gate #define	PCUNKILL 10L	/* delete a pending signal from process/lwp, long arg */
887c478bd9Sstevel@tonic-gate #define	PCSHOLD  11L	/* set lwp signal mask from sigset_t argument */
897c478bd9Sstevel@tonic-gate #define	PCSTRACE 12L	/* set traced signal set from sigset_t argument */
907c478bd9Sstevel@tonic-gate #define	PCSFAULT 13L	/* set traced fault set from fltset_t argument */
917c478bd9Sstevel@tonic-gate #define	PCSENTRY 14L	/* set traced syscall entry set from sysset_t arg */
927c478bd9Sstevel@tonic-gate #define	PCSEXIT  15L	/* set traced syscall exit set from sysset_t arg */
937c478bd9Sstevel@tonic-gate #define	PCSET    16L	/* set modes from long argument */
947c478bd9Sstevel@tonic-gate #define	PCUNSET  17L	/* unset modes from long argument */
957c478bd9Sstevel@tonic-gate #define	PCSREG   18L	/* set lwp general registers from prgregset_t arg */
967c478bd9Sstevel@tonic-gate #define	PCSFPREG 19L	/* set lwp floating-point registers from prfpregset_t */
977c478bd9Sstevel@tonic-gate #define	PCSXREG  20L	/* set lwp extra registers from prxregset_t arg */
987c478bd9Sstevel@tonic-gate #define	PCNICE   21L	/* set nice priority from long argument */
997c478bd9Sstevel@tonic-gate #define	PCSVADDR 22L	/* set %pc virtual address from long argument */
1007c478bd9Sstevel@tonic-gate #define	PCWATCH  23L	/* set/unset watched memory area from prwatch_t arg */
1017c478bd9Sstevel@tonic-gate #define	PCAGENT  24L	/* create agent lwp with regs from prgregset_t arg */
1027c478bd9Sstevel@tonic-gate #define	PCREAD   25L	/* read from the address space via priovec_t arg */
1037c478bd9Sstevel@tonic-gate #define	PCWRITE  26L	/* write to the address space via priovec_t arg */
1047c478bd9Sstevel@tonic-gate #define	PCSCRED  27L	/* set process credentials from prcred_t argument */
1057c478bd9Sstevel@tonic-gate #define	PCSASRS  28L	/* set ancillary state registers from asrset_t arg */
1067c478bd9Sstevel@tonic-gate #define	PCSPRIV  29L	/* set process privileges from prpriv_t argument */
1077c478bd9Sstevel@tonic-gate #define	PCSZONE  30L	/* set zoneid from zoneid_t argument */
1087c478bd9Sstevel@tonic-gate #define	PCSCREDX 31L	/* as PCSCRED but with supplemental groups */
1097c478bd9Sstevel@tonic-gate /*
1107c478bd9Sstevel@tonic-gate  * PCRUN long operand flags.
1117c478bd9Sstevel@tonic-gate  */
1127c478bd9Sstevel@tonic-gate #define	PRCSIG		0x01	/* clear current signal, if any */
1137c478bd9Sstevel@tonic-gate #define	PRCFAULT	0x02	/* clear current fault, if any */
1147c478bd9Sstevel@tonic-gate #define	PRSTEP		0x04	/* direct the lwp to single-step */
1157c478bd9Sstevel@tonic-gate #define	PRSABORT	0x08	/* abort syscall, if in syscall */
1167c478bd9Sstevel@tonic-gate #define	PRSTOP		0x10	/* set directed stop request */
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /*
1197c478bd9Sstevel@tonic-gate  * lwp status file.  /proc/<pid>/lwp/<lwpid>/lwpstatus
1207c478bd9Sstevel@tonic-gate  */
1217c478bd9Sstevel@tonic-gate #define	PRCLSZ		8	/* maximum size of scheduling class name */
1227c478bd9Sstevel@tonic-gate #define	PRSYSARGS	8	/* maximum number of syscall arguments */
1237c478bd9Sstevel@tonic-gate typedef struct lwpstatus {
1247c478bd9Sstevel@tonic-gate 	int	pr_flags;	/* flags (see below) */
1257c478bd9Sstevel@tonic-gate 	id_t	pr_lwpid;	/* specific lwp identifier */
1267c478bd9Sstevel@tonic-gate 	short	pr_why;		/* reason for lwp stop, if stopped */
1277c478bd9Sstevel@tonic-gate 	short	pr_what;	/* more detailed reason */
1287c478bd9Sstevel@tonic-gate 	short	pr_cursig;	/* current signal, if any */
1297c478bd9Sstevel@tonic-gate 	short	pr_pad1;
1307c478bd9Sstevel@tonic-gate 	siginfo_t pr_info;	/* info associated with signal or fault */
1317c478bd9Sstevel@tonic-gate 	sigset_t pr_lwppend;	/* set of signals pending to the lwp */
1327c478bd9Sstevel@tonic-gate 	sigset_t pr_lwphold;	/* set of signals blocked by the lwp */
1337c478bd9Sstevel@tonic-gate 	struct sigaction pr_action;	/* signal action for current signal */
1347c478bd9Sstevel@tonic-gate 	stack_t	pr_altstack;	/* alternate signal stack info */
1357c478bd9Sstevel@tonic-gate 	uintptr_t pr_oldcontext;	/* address of previous ucontext */
1367c478bd9Sstevel@tonic-gate 	short	pr_syscall;	/* system call number (if in syscall) */
1377c478bd9Sstevel@tonic-gate 	short	pr_nsysarg;	/* number of arguments to this syscall */
1387c478bd9Sstevel@tonic-gate 	int	pr_errno;	/* errno for failed syscall, 0 if successful */
1397c478bd9Sstevel@tonic-gate 	long	pr_sysarg[PRSYSARGS];	/* arguments to this syscall */
1407c478bd9Sstevel@tonic-gate 	long	pr_rval1;	/* primary syscall return value */
1417c478bd9Sstevel@tonic-gate 	long	pr_rval2;	/* second syscall return value, if any */
1427c478bd9Sstevel@tonic-gate 	char	pr_clname[PRCLSZ];	/* scheduling class name */
1437c478bd9Sstevel@tonic-gate 	timestruc_t pr_tstamp;	/* real-time time stamp of stop */
1447c478bd9Sstevel@tonic-gate 	timestruc_t pr_utime;	/* lwp user cpu time */
1457c478bd9Sstevel@tonic-gate 	timestruc_t pr_stime;	/* lwp system cpu time */
1467c478bd9Sstevel@tonic-gate 	int	pr_filler[11 - 2 * sizeof (timestruc_t) / sizeof (int)];
1477c478bd9Sstevel@tonic-gate 	int	pr_errpriv;	/* missing privilege */
1487c478bd9Sstevel@tonic-gate 	uintptr_t pr_ustack;	/* address of stack boundary data (stack_t) */
1497c478bd9Sstevel@tonic-gate 	ulong_t	pr_instr;	/* current instruction */
1507c478bd9Sstevel@tonic-gate 	prgregset_t pr_reg;	/* general registers */
1517c478bd9Sstevel@tonic-gate 	prfpregset_t pr_fpreg;	/* floating-point registers */
1527c478bd9Sstevel@tonic-gate } lwpstatus_t;
1537c478bd9Sstevel@tonic-gate 
1547c478bd9Sstevel@tonic-gate /*
1557c478bd9Sstevel@tonic-gate  * process status file.  /proc/<pid>/status
1567c478bd9Sstevel@tonic-gate  */
1577c478bd9Sstevel@tonic-gate typedef struct pstatus {
1587c478bd9Sstevel@tonic-gate 	int	pr_flags;	/* flags (see below) */
1597c478bd9Sstevel@tonic-gate 	int	pr_nlwp;	/* number of active lwps in the process */
1607c478bd9Sstevel@tonic-gate 	pid_t	pr_pid;		/* process id */
1617c478bd9Sstevel@tonic-gate 	pid_t	pr_ppid;	/* parent process id */
1627c478bd9Sstevel@tonic-gate 	pid_t	pr_pgid;	/* process group id */
1637c478bd9Sstevel@tonic-gate 	pid_t	pr_sid;		/* session id */
1647c478bd9Sstevel@tonic-gate 	id_t	pr_aslwpid;	/* historical; now always zero */
1657c478bd9Sstevel@tonic-gate 	id_t	pr_agentid;	/* lwp id of the /proc agent lwp, if any */
1667c478bd9Sstevel@tonic-gate 	sigset_t pr_sigpend;	/* set of process pending signals */
1677c478bd9Sstevel@tonic-gate 	uintptr_t pr_brkbase;	/* address of the process heap */
1687c478bd9Sstevel@tonic-gate 	size_t	pr_brksize;	/* size of the process heap, in bytes */
1697c478bd9Sstevel@tonic-gate 	uintptr_t pr_stkbase;	/* address of the process stack */
1707c478bd9Sstevel@tonic-gate 	size_t	pr_stksize;	/* size of the process stack, in bytes */
1717c478bd9Sstevel@tonic-gate 	timestruc_t pr_utime;	/* process user cpu time */
1727c478bd9Sstevel@tonic-gate 	timestruc_t pr_stime;	/* process system cpu time */
1737c478bd9Sstevel@tonic-gate 	timestruc_t pr_cutime;	/* sum of children's user times */
1747c478bd9Sstevel@tonic-gate 	timestruc_t pr_cstime;	/* sum of children's system times */
1757c478bd9Sstevel@tonic-gate 	sigset_t pr_sigtrace;	/* set of traced signals */
1767c478bd9Sstevel@tonic-gate 	fltset_t pr_flttrace;	/* set of traced faults */
1777c478bd9Sstevel@tonic-gate 	sysset_t pr_sysentry;	/* set of system calls traced on entry */
1787c478bd9Sstevel@tonic-gate 	sysset_t pr_sysexit;	/* set of system calls traced on exit */
1797c478bd9Sstevel@tonic-gate 	char	pr_dmodel;	/* data model of the process (see below) */
1807c478bd9Sstevel@tonic-gate 	char	pr_pad[3];
1817c478bd9Sstevel@tonic-gate 	taskid_t pr_taskid;	/* task id */
1827c478bd9Sstevel@tonic-gate 	projid_t pr_projid;	/* project id */
1837c478bd9Sstevel@tonic-gate 	int	pr_nzomb;	/* number of zombie lwps in the process */
1847c478bd9Sstevel@tonic-gate 	zoneid_t pr_zoneid;	/* zone id */
1857c478bd9Sstevel@tonic-gate 	int	pr_filler[15];	/* reserved for future use */
1867c478bd9Sstevel@tonic-gate 	lwpstatus_t pr_lwp;	/* status of the representative lwp */
1877c478bd9Sstevel@tonic-gate } pstatus_t;
1887c478bd9Sstevel@tonic-gate 
1897c478bd9Sstevel@tonic-gate /*
1907c478bd9Sstevel@tonic-gate  * pr_flags (same values appear in both pstatus_t and lwpstatus_t pr_flags).
1917c478bd9Sstevel@tonic-gate  *
1927c478bd9Sstevel@tonic-gate  * These flags do *not* apply to psinfo_t.pr_flag or lwpsinfo_t.pr_flag
1937c478bd9Sstevel@tonic-gate  * (which are both deprecated).
1947c478bd9Sstevel@tonic-gate  */
1957c478bd9Sstevel@tonic-gate /* The following flags apply to the specific or representative lwp */
1967c478bd9Sstevel@tonic-gate #define	PR_STOPPED 0x00000001	/* lwp is stopped */
1977c478bd9Sstevel@tonic-gate #define	PR_ISTOP   0x00000002	/* lwp is stopped on an event of interest */
1987c478bd9Sstevel@tonic-gate #define	PR_DSTOP   0x00000004	/* lwp has a stop directive in effect */
1997c478bd9Sstevel@tonic-gate #define	PR_STEP	   0x00000008	/* lwp has a single-step directive in effect */
2007c478bd9Sstevel@tonic-gate #define	PR_ASLEEP  0x00000010	/* lwp is sleeping in a system call */
2017c478bd9Sstevel@tonic-gate #define	PR_PCINVAL 0x00000020	/* contents of pr_instr undefined */
2027c478bd9Sstevel@tonic-gate #define	PR_ASLWP   0x00000040	/* obsolete flag; never set */
2037c478bd9Sstevel@tonic-gate #define	PR_AGENT   0x00000080	/* this lwp is the /proc agent lwp */
2047c478bd9Sstevel@tonic-gate #define	PR_DETACH  0x00000100	/* this is a detached lwp */
2057c478bd9Sstevel@tonic-gate #define	PR_DAEMON  0x00000200	/* this is a daemon lwp */
2067c478bd9Sstevel@tonic-gate /* The following flags apply to the process, not to an individual lwp */
2077c478bd9Sstevel@tonic-gate #define	PR_ISSYS   0x00001000	/* this is a system process */
2087c478bd9Sstevel@tonic-gate #define	PR_VFORKP  0x00002000	/* process is the parent of a vfork()d child */
2097c478bd9Sstevel@tonic-gate #define	PR_ORPHAN  0x00004000	/* process's process group is orphaned */
2107c478bd9Sstevel@tonic-gate /* The following process flags are modes settable by PCSET/PCUNSET */
2117c478bd9Sstevel@tonic-gate #define	PR_FORK	   0x00100000	/* inherit-on-fork is in effect */
2127c478bd9Sstevel@tonic-gate #define	PR_RLC	   0x00200000	/* run-on-last-close is in effect */
2137c478bd9Sstevel@tonic-gate #define	PR_KLC	   0x00400000	/* kill-on-last-close is in effect */
2147c478bd9Sstevel@tonic-gate #define	PR_ASYNC   0x00800000	/* asynchronous-stop is in effect */
2157c478bd9Sstevel@tonic-gate #define	PR_MSACCT  0x01000000	/* micro-state usage accounting is in effect */
2167c478bd9Sstevel@tonic-gate #define	PR_BPTADJ  0x02000000	/* breakpoint trap pc adjustment is in effect */
2177c478bd9Sstevel@tonic-gate #define	PR_PTRACE  0x04000000	/* ptrace-compatibility mode is in effect */
2187c478bd9Sstevel@tonic-gate #define	PR_MSFORK  0x08000000	/* micro-state accounting inherited on fork */
2197c478bd9Sstevel@tonic-gate #define	PR_IDLE    0x10000000	/* lwp is a cpu's idle thread */
2207c478bd9Sstevel@tonic-gate 
2217c478bd9Sstevel@tonic-gate /*
2227c478bd9Sstevel@tonic-gate  * See <sys/procfs_isa.h> for possible values of pr_dmodel.
2237c478bd9Sstevel@tonic-gate  */
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate /*
2267c478bd9Sstevel@tonic-gate  * Reasons for stopping (pr_why).
2277c478bd9Sstevel@tonic-gate  */
2287c478bd9Sstevel@tonic-gate #define	PR_REQUESTED	1
2297c478bd9Sstevel@tonic-gate #define	PR_SIGNALLED	2
2307c478bd9Sstevel@tonic-gate #define	PR_SYSENTRY	3
2317c478bd9Sstevel@tonic-gate #define	PR_SYSEXIT	4
2327c478bd9Sstevel@tonic-gate #define	PR_JOBCONTROL	5
2337c478bd9Sstevel@tonic-gate #define	PR_FAULTED	6
2347c478bd9Sstevel@tonic-gate #define	PR_SUSPENDED	7
2357c478bd9Sstevel@tonic-gate #define	PR_CHECKPOINT	8
2367c478bd9Sstevel@tonic-gate 
2377c478bd9Sstevel@tonic-gate /*
2387c478bd9Sstevel@tonic-gate  * lwp ps(1) information file.  /proc/<pid>/lwp/<lwpid>/lwpsinfo
2397c478bd9Sstevel@tonic-gate  */
2407c478bd9Sstevel@tonic-gate #define	PRFNSZ		16	/* Maximum size of execed filename */
2417c478bd9Sstevel@tonic-gate typedef struct lwpsinfo {
2427c478bd9Sstevel@tonic-gate 	int	pr_flag;	/* lwp flags (DEPRECATED; do not use) */
2437c478bd9Sstevel@tonic-gate 	id_t	pr_lwpid;	/* lwp id */
2447c478bd9Sstevel@tonic-gate 	uintptr_t pr_addr;	/* internal address of lwp */
2457c478bd9Sstevel@tonic-gate 	uintptr_t pr_wchan;	/* wait addr for sleeping lwp */
2467c478bd9Sstevel@tonic-gate 	char	pr_stype;	/* synchronization event type */
2477c478bd9Sstevel@tonic-gate 	char	pr_state;	/* numeric lwp state */
2487c478bd9Sstevel@tonic-gate 	char	pr_sname;	/* printable character for pr_state */
2497c478bd9Sstevel@tonic-gate 	char	pr_nice;	/* nice for cpu usage */
2507c478bd9Sstevel@tonic-gate 	short	pr_syscall;	/* system call number (if in syscall) */
2517c478bd9Sstevel@tonic-gate 	char	pr_oldpri;	/* pre-SVR4, low value is high priority */
2527c478bd9Sstevel@tonic-gate 	char	pr_cpu;		/* pre-SVR4, cpu usage for scheduling */
2537c478bd9Sstevel@tonic-gate 	int	pr_pri;		/* priority, high value is high priority */
2547c478bd9Sstevel@tonic-gate 			/* The following percent number is a 16-bit binary */
2557c478bd9Sstevel@tonic-gate 			/* fraction [0 .. 1] with the binary point to the */
2567c478bd9Sstevel@tonic-gate 			/* right of the high-order bit (1.0 == 0x8000) */
2577c478bd9Sstevel@tonic-gate 	ushort_t pr_pctcpu;	/* % of recent cpu time used by this lwp */
2587c478bd9Sstevel@tonic-gate 	ushort_t pr_pad;
2597c478bd9Sstevel@tonic-gate 	timestruc_t pr_start;	/* lwp start time, from the epoch */
2607c478bd9Sstevel@tonic-gate 	timestruc_t pr_time;	/* usr+sys cpu time for this lwp */
2617c478bd9Sstevel@tonic-gate 	char	pr_clname[PRCLSZ];	/* scheduling class name */
2627c478bd9Sstevel@tonic-gate 	char	pr_name[PRFNSZ];	/* name of system lwp */
2637c478bd9Sstevel@tonic-gate 	processorid_t pr_onpro;		/* processor which last ran this lwp */
2647c478bd9Sstevel@tonic-gate 	processorid_t pr_bindpro;	/* processor to which lwp is bound */
2657c478bd9Sstevel@tonic-gate 	psetid_t pr_bindpset;	/* processor set to which lwp is bound */
266*c6402783Sakolb 	lgrp_id_t pr_lgrp;	/* lwp home lgroup */
267*c6402783Sakolb 	int	pr_filler[4];	/* reserved for future use */
2687c478bd9Sstevel@tonic-gate } lwpsinfo_t;
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate /*
2717c478bd9Sstevel@tonic-gate  * process ps(1) information file.  /proc/<pid>/psinfo
2727c478bd9Sstevel@tonic-gate  */
2737c478bd9Sstevel@tonic-gate #define	PRARGSZ		80	/* number of chars of arguments */
2747c478bd9Sstevel@tonic-gate typedef struct psinfo {
2757c478bd9Sstevel@tonic-gate 	int	pr_flag;	/* process flags (DEPRECATED; do not use) */
2767c478bd9Sstevel@tonic-gate 	int	pr_nlwp;	/* number of active lwps in the process */
2777c478bd9Sstevel@tonic-gate 	pid_t	pr_pid;		/* unique process id */
2787c478bd9Sstevel@tonic-gate 	pid_t	pr_ppid;	/* process id of parent */
2797c478bd9Sstevel@tonic-gate 	pid_t	pr_pgid;	/* pid of process group leader */
2807c478bd9Sstevel@tonic-gate 	pid_t	pr_sid;		/* session id */
2817c478bd9Sstevel@tonic-gate 	uid_t	pr_uid;		/* real user id */
2827c478bd9Sstevel@tonic-gate 	uid_t	pr_euid;	/* effective user id */
2837c478bd9Sstevel@tonic-gate 	gid_t	pr_gid;		/* real group id */
2847c478bd9Sstevel@tonic-gate 	gid_t	pr_egid;	/* effective group id */
2857c478bd9Sstevel@tonic-gate 	uintptr_t pr_addr;	/* address of process */
2867c478bd9Sstevel@tonic-gate 	size_t	pr_size;	/* size of process image in Kbytes */
2877c478bd9Sstevel@tonic-gate 	size_t	pr_rssize;	/* resident set size in Kbytes */
2887c478bd9Sstevel@tonic-gate 	size_t	pr_pad1;
2897c478bd9Sstevel@tonic-gate 	dev_t	pr_ttydev;	/* controlling tty device (or PRNODEV) */
2907c478bd9Sstevel@tonic-gate 			/* The following percent numbers are 16-bit binary */
2917c478bd9Sstevel@tonic-gate 			/* fractions [0 .. 1] with the binary point to the */
2927c478bd9Sstevel@tonic-gate 			/* right of the high-order bit (1.0 == 0x8000) */
2937c478bd9Sstevel@tonic-gate 	ushort_t pr_pctcpu;	/* % of recent cpu time used by all lwps */
2947c478bd9Sstevel@tonic-gate 	ushort_t pr_pctmem;	/* % of system memory used by process */
2957c478bd9Sstevel@tonic-gate 	timestruc_t pr_start;	/* process start time, from the epoch */
2967c478bd9Sstevel@tonic-gate 	timestruc_t pr_time;	/* usr+sys cpu time for this process */
2977c478bd9Sstevel@tonic-gate 	timestruc_t pr_ctime;	/* usr+sys cpu time for reaped children */
2987c478bd9Sstevel@tonic-gate 	char	pr_fname[PRFNSZ];	/* name of execed file */
2997c478bd9Sstevel@tonic-gate 	char	pr_psargs[PRARGSZ];	/* initial characters of arg list */
3007c478bd9Sstevel@tonic-gate 	int	pr_wstat;	/* if zombie, the wait() status */
3017c478bd9Sstevel@tonic-gate 	int	pr_argc;	/* initial argument count */
3027c478bd9Sstevel@tonic-gate 	uintptr_t pr_argv;	/* address of initial argument vector */
3037c478bd9Sstevel@tonic-gate 	uintptr_t pr_envp;	/* address of initial environment vector */
3047c478bd9Sstevel@tonic-gate 	char	pr_dmodel;	/* data model of the process */
3057c478bd9Sstevel@tonic-gate 	char	pr_pad2[3];
3067c478bd9Sstevel@tonic-gate 	taskid_t pr_taskid;	/* task id */
3077c478bd9Sstevel@tonic-gate 	projid_t pr_projid;	/* project id */
3087c478bd9Sstevel@tonic-gate 	int	pr_nzomb;	/* number of zombie lwps in the process */
3097c478bd9Sstevel@tonic-gate 	poolid_t pr_poolid;	/* pool id */
3107c478bd9Sstevel@tonic-gate 	zoneid_t pr_zoneid;	/* zone id */
3117c478bd9Sstevel@tonic-gate 	id_t	pr_contract;	/* process contract */
3127c478bd9Sstevel@tonic-gate 	int	pr_filler[1];	/* reserved for future use */
3137c478bd9Sstevel@tonic-gate 	lwpsinfo_t pr_lwp;	/* information for representative lwp */
3147c478bd9Sstevel@tonic-gate } psinfo_t;
3157c478bd9Sstevel@tonic-gate 
3167c478bd9Sstevel@tonic-gate #define	PRNODEV	(dev_t)(-1)	/* non-existent device */
3177c478bd9Sstevel@tonic-gate 
3187c478bd9Sstevel@tonic-gate /*
3197c478bd9Sstevel@tonic-gate  * Memory-map interface.  /proc/<pid>/map /proc/<pid>/rmap
3207c478bd9Sstevel@tonic-gate  */
3217c478bd9Sstevel@tonic-gate #define	PRMAPSZ	64
3227c478bd9Sstevel@tonic-gate typedef struct prmap {
3237c478bd9Sstevel@tonic-gate 	uintptr_t pr_vaddr;	/* virtual address of mapping */
3247c478bd9Sstevel@tonic-gate 	size_t	pr_size;	/* size of mapping in bytes */
3257c478bd9Sstevel@tonic-gate 	char	pr_mapname[PRMAPSZ];	/* name in /proc/<pid>/object */
3267c478bd9Sstevel@tonic-gate 	offset_t pr_offset;	/* offset into mapped object, if any */
3277c478bd9Sstevel@tonic-gate 	int	pr_mflags;	/* protection and attribute flags (see below) */
3287c478bd9Sstevel@tonic-gate 	int	pr_pagesize;	/* pagesize (bytes) for this mapping */
3297c478bd9Sstevel@tonic-gate 	int	pr_shmid;	/* SysV shmid, -1 if not SysV shared memory */
3307c478bd9Sstevel@tonic-gate 	int	pr_filler[1];	/* filler for future expansion */
3317c478bd9Sstevel@tonic-gate } prmap_t;
3327c478bd9Sstevel@tonic-gate 
3337c478bd9Sstevel@tonic-gate /*
3347c478bd9Sstevel@tonic-gate  * HAT memory-map interface.  /proc/<pid>/xmap
3357c478bd9Sstevel@tonic-gate  *
3367c478bd9Sstevel@tonic-gate  * The xmap structure is a Sun private interface. The existence, semantics
3377c478bd9Sstevel@tonic-gate  * and contents of the xmap structure are subject to arbitrary change.
3387c478bd9Sstevel@tonic-gate  */
3397c478bd9Sstevel@tonic-gate typedef struct prxmap {
3407c478bd9Sstevel@tonic-gate 	uintptr_t pr_vaddr;	/* virtual address of mapping */
3417c478bd9Sstevel@tonic-gate 	size_t	pr_size;	/* size of mapping in bytes */
3427c478bd9Sstevel@tonic-gate 	char	pr_mapname[PRMAPSZ];	/* name in /proc/<pid>/object */
3437c478bd9Sstevel@tonic-gate 	offset_t pr_offset;	/* offset into mapped object, if any */
3447c478bd9Sstevel@tonic-gate 	int	pr_mflags;	/* protection and attribute flags (see below) */
3457c478bd9Sstevel@tonic-gate 	int	pr_pagesize;	/* pagesize (bytes) for this mapping */
3467c478bd9Sstevel@tonic-gate 	int	pr_shmid;	/* SysV shmid, -1 if not SysV shared memory */
3477c478bd9Sstevel@tonic-gate 	dev_t	pr_dev;	/* st_dev from stat64() of mapped object, or PRNODEV */
3487c478bd9Sstevel@tonic-gate 	uint64_t pr_ino; /* st_ino from stat64() of mapped object, if any */
3497c478bd9Sstevel@tonic-gate 	ulong_t	pr_rss; 	/* pages of resident memory */
3507c478bd9Sstevel@tonic-gate 	ulong_t	pr_anon;	/* pages of resident anonymous memory */
3517c478bd9Sstevel@tonic-gate 	ulong_t	pr_locked;	/* pages of locked memory */
3527c478bd9Sstevel@tonic-gate 	int	pr_hatpagesize;	/* pagesize of the hat mapping */
3537c478bd9Sstevel@tonic-gate 	ulong_t	pr_filler[8];	/* filler for future expansion */
3547c478bd9Sstevel@tonic-gate } prxmap_t;
3557c478bd9Sstevel@tonic-gate 
3567c478bd9Sstevel@tonic-gate 
3577c478bd9Sstevel@tonic-gate /* Protection and attribute flags */
3587c478bd9Sstevel@tonic-gate #define	MA_READ		0x04	/* readable by the traced process */
3597c478bd9Sstevel@tonic-gate #define	MA_WRITE	0x02	/* writable by the traced process */
3607c478bd9Sstevel@tonic-gate #define	MA_EXEC		0x01	/* executable by the traced process */
3617c478bd9Sstevel@tonic-gate #define	MA_SHARED	0x08	/* changes are shared by mapped object */
3627c478bd9Sstevel@tonic-gate #define	MA_ANON		0x40	/* anonymous memory (e.g. /dev/zero) */
3637c478bd9Sstevel@tonic-gate #define	MA_ISM		0x80	/* intimate shared mem (shared MMU resources) */
3647c478bd9Sstevel@tonic-gate #define	MA_NORESERVE	0x100	/* mapped with MAP_NORESERVE */
3657c478bd9Sstevel@tonic-gate #define	MA_SHM		0x200	/* System V shared memory */
3667c478bd9Sstevel@tonic-gate #define	MA_RESERVED1	0x400	/* reserved for future use */
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate /*
3697c478bd9Sstevel@tonic-gate  * These are obsolete and unreliable.
3707c478bd9Sstevel@tonic-gate  * They are included here only for historical compatibility.
3717c478bd9Sstevel@tonic-gate  */
3727c478bd9Sstevel@tonic-gate #define	MA_BREAK	0x10	/* grown by brk(2) */
3737c478bd9Sstevel@tonic-gate #define	MA_STACK	0x20	/* grown automatically on stack faults */
3747c478bd9Sstevel@tonic-gate 
3757c478bd9Sstevel@tonic-gate /*
3767c478bd9Sstevel@tonic-gate  * Process credentials.  PCSCRED and /proc/<pid>/cred
3777c478bd9Sstevel@tonic-gate  */
3787c478bd9Sstevel@tonic-gate typedef struct prcred {
3797c478bd9Sstevel@tonic-gate 	uid_t	pr_euid;	/* effective user id */
3807c478bd9Sstevel@tonic-gate 	uid_t	pr_ruid;	/* real user id */
3817c478bd9Sstevel@tonic-gate 	uid_t	pr_suid;	/* saved user id (from exec) */
3827c478bd9Sstevel@tonic-gate 	gid_t	pr_egid;	/* effective group id */
3837c478bd9Sstevel@tonic-gate 	gid_t	pr_rgid;	/* real group id */
3847c478bd9Sstevel@tonic-gate 	gid_t	pr_sgid;	/* saved group id (from exec) */
3857c478bd9Sstevel@tonic-gate 	int	pr_ngroups;	/* number of supplementary groups */
3867c478bd9Sstevel@tonic-gate 	gid_t	pr_groups[1];	/* array of supplementary groups */
3877c478bd9Sstevel@tonic-gate } prcred_t;
3887c478bd9Sstevel@tonic-gate 
3897c478bd9Sstevel@tonic-gate /*
3907c478bd9Sstevel@tonic-gate  * Process privileges.  PCSPRIV and /proc/<pid>/priv
3917c478bd9Sstevel@tonic-gate  */
3927c478bd9Sstevel@tonic-gate typedef struct prpriv {
3937c478bd9Sstevel@tonic-gate 	uint32_t	pr_nsets;		/* number of privilege set */
3947c478bd9Sstevel@tonic-gate 	uint32_t	pr_setsize;		/* size of privilege set */
3957c478bd9Sstevel@tonic-gate 	uint32_t	pr_infosize;		/* size of supplementary data */
3967c478bd9Sstevel@tonic-gate 	priv_chunk_t	pr_sets[1];		/* array of sets */
3977c478bd9Sstevel@tonic-gate } prpriv_t;
3987c478bd9Sstevel@tonic-gate 
3997c478bd9Sstevel@tonic-gate /*
4007c478bd9Sstevel@tonic-gate  * Watchpoint interface.  PCWATCH and /proc/<pid>/watch
4017c478bd9Sstevel@tonic-gate  */
4027c478bd9Sstevel@tonic-gate typedef struct prwatch {
4037c478bd9Sstevel@tonic-gate 	uintptr_t pr_vaddr;	/* virtual address of watched area */
4047c478bd9Sstevel@tonic-gate 	size_t	pr_size;	/* size of watched area in bytes */
4057c478bd9Sstevel@tonic-gate 	int	pr_wflags;	/* watch type flags */
4067c478bd9Sstevel@tonic-gate 	int	pr_pad;
4077c478bd9Sstevel@tonic-gate } prwatch_t;
4087c478bd9Sstevel@tonic-gate 
4097c478bd9Sstevel@tonic-gate /* pr_wflags */
4107c478bd9Sstevel@tonic-gate #define	WA_READ		0x04	/* trap on read access */
4117c478bd9Sstevel@tonic-gate #define	WA_WRITE	0x02	/* trap on write access */
4127c478bd9Sstevel@tonic-gate #define	WA_EXEC		0x01	/* trap on execute access */
4137c478bd9Sstevel@tonic-gate #define	WA_TRAPAFTER	0x08	/* trap after instruction completes */
4147c478bd9Sstevel@tonic-gate 
4157c478bd9Sstevel@tonic-gate /*
4167c478bd9Sstevel@tonic-gate  * PCREAD/PCWRITE I/O interface.
4177c478bd9Sstevel@tonic-gate  */
4187c478bd9Sstevel@tonic-gate typedef struct priovec {
4197c478bd9Sstevel@tonic-gate 	void	*pio_base;	/* buffer in controlling process */
4207c478bd9Sstevel@tonic-gate 	size_t	pio_len;	/* size of read/write request */
4217c478bd9Sstevel@tonic-gate 	off_t	pio_offset;	/* virtual address in target process */
4227c478bd9Sstevel@tonic-gate } priovec_t;
4237c478bd9Sstevel@tonic-gate 
4247c478bd9Sstevel@tonic-gate /*
4257c478bd9Sstevel@tonic-gate  * Resource usage.  /proc/<pid>/usage /proc/<pid>/lwp/<lwpid>/lwpusage
4267c478bd9Sstevel@tonic-gate  */
4277c478bd9Sstevel@tonic-gate typedef struct prusage {
4287c478bd9Sstevel@tonic-gate 	id_t		pr_lwpid;	/* lwp id.  0: process or defunct */
4297c478bd9Sstevel@tonic-gate 	int		pr_count;	/* number of contributing lwps */
4307c478bd9Sstevel@tonic-gate 	timestruc_t	pr_tstamp;	/* current time stamp */
4317c478bd9Sstevel@tonic-gate 	timestruc_t	pr_create;	/* process/lwp creation time stamp */
4327c478bd9Sstevel@tonic-gate 	timestruc_t	pr_term;	/* process/lwp termination time stamp */
4337c478bd9Sstevel@tonic-gate 	timestruc_t	pr_rtime;	/* total lwp real (elapsed) time */
4347c478bd9Sstevel@tonic-gate 	timestruc_t	pr_utime;	/* user level cpu time */
4357c478bd9Sstevel@tonic-gate 	timestruc_t	pr_stime;	/* system call cpu time */
4367c478bd9Sstevel@tonic-gate 	timestruc_t	pr_ttime;	/* other system trap cpu time */
4377c478bd9Sstevel@tonic-gate 	timestruc_t	pr_tftime;	/* text page fault sleep time */
4387c478bd9Sstevel@tonic-gate 	timestruc_t	pr_dftime;	/* data page fault sleep time */
4397c478bd9Sstevel@tonic-gate 	timestruc_t	pr_kftime;	/* kernel page fault sleep time */
4407c478bd9Sstevel@tonic-gate 	timestruc_t	pr_ltime;	/* user lock wait sleep time */
4417c478bd9Sstevel@tonic-gate 	timestruc_t	pr_slptime;	/* all other sleep time */
4427c478bd9Sstevel@tonic-gate 	timestruc_t	pr_wtime;	/* wait-cpu (latency) time */
4437c478bd9Sstevel@tonic-gate 	timestruc_t	pr_stoptime;	/* stopped time */
4447c478bd9Sstevel@tonic-gate 	timestruc_t	filltime[6];	/* filler for future expansion */
4457c478bd9Sstevel@tonic-gate 	ulong_t		pr_minf;	/* minor page faults */
4467c478bd9Sstevel@tonic-gate 	ulong_t		pr_majf;	/* major page faults */
4477c478bd9Sstevel@tonic-gate 	ulong_t		pr_nswap;	/* swaps */
4487c478bd9Sstevel@tonic-gate 	ulong_t		pr_inblk;	/* input blocks */
4497c478bd9Sstevel@tonic-gate 	ulong_t		pr_oublk;	/* output blocks */
4507c478bd9Sstevel@tonic-gate 	ulong_t		pr_msnd;	/* messages sent */
4517c478bd9Sstevel@tonic-gate 	ulong_t		pr_mrcv;	/* messages received */
4527c478bd9Sstevel@tonic-gate 	ulong_t		pr_sigs;	/* signals received */
4537c478bd9Sstevel@tonic-gate 	ulong_t		pr_vctx;	/* voluntary context switches */
4547c478bd9Sstevel@tonic-gate 	ulong_t		pr_ictx;	/* involuntary context switches */
4557c478bd9Sstevel@tonic-gate 	ulong_t		pr_sysc;	/* system calls */
4567c478bd9Sstevel@tonic-gate 	ulong_t		pr_ioch;	/* chars read and written */
4577c478bd9Sstevel@tonic-gate 	ulong_t		filler[10];	/* filler for future expansion */
4587c478bd9Sstevel@tonic-gate } prusage_t;
4597c478bd9Sstevel@tonic-gate 
4607c478bd9Sstevel@tonic-gate /*
4617c478bd9Sstevel@tonic-gate  * Page data file.  /proc/<pid>/pagedata
4627c478bd9Sstevel@tonic-gate  */
4637c478bd9Sstevel@tonic-gate 
4647c478bd9Sstevel@tonic-gate /* page data file header */
4657c478bd9Sstevel@tonic-gate typedef struct prpageheader {
4667c478bd9Sstevel@tonic-gate 	timestruc_t	pr_tstamp;	/* real time stamp */
4677c478bd9Sstevel@tonic-gate 	long		pr_nmap;	/* number of address space mappings */
4687c478bd9Sstevel@tonic-gate 	long		pr_npage;	/* total number of pages */
4697c478bd9Sstevel@tonic-gate } prpageheader_t;
4707c478bd9Sstevel@tonic-gate 
4717c478bd9Sstevel@tonic-gate /* page data mapping header */
4727c478bd9Sstevel@tonic-gate typedef struct prasmap {
4737c478bd9Sstevel@tonic-gate 	uintptr_t pr_vaddr;	/* virtual address of mapping */
4747c478bd9Sstevel@tonic-gate 	size_t	pr_npage;	/* number of pages in mapping */
4757c478bd9Sstevel@tonic-gate 	char	pr_mapname[PRMAPSZ];	/* name in /proc/<pid>/object */
4767c478bd9Sstevel@tonic-gate 	offset_t pr_offset;	/* offset into mapped object, if any */
4777c478bd9Sstevel@tonic-gate 	int	pr_mflags;	/* protection and attribute flags */
4787c478bd9Sstevel@tonic-gate 	int	pr_pagesize;	/* pagesize (bytes) for this mapping */
4797c478bd9Sstevel@tonic-gate 	int	pr_shmid;	/* SysV shmid, -1 if not SysV shared memory */
4807c478bd9Sstevel@tonic-gate 	int	pr_filler[1];	/* filler for future expansion */
4817c478bd9Sstevel@tonic-gate } prasmap_t;
4827c478bd9Sstevel@tonic-gate 
4837c478bd9Sstevel@tonic-gate /*
4847c478bd9Sstevel@tonic-gate  * pr_npage bytes (plus 0-7 null bytes to round up to an 8-byte boundary)
4857c478bd9Sstevel@tonic-gate  * follow each mapping header, each containing zero or more of these flags.
4867c478bd9Sstevel@tonic-gate  */
4877c478bd9Sstevel@tonic-gate #define	PG_REFERENCED	0x02		/* page referenced since last read */
4887c478bd9Sstevel@tonic-gate #define	PG_MODIFIED	0x01		/* page modified since last read */
4897c478bd9Sstevel@tonic-gate #define	PG_HWMAPPED	0x04		/* page is present and mapped */
4907c478bd9Sstevel@tonic-gate 
4917c478bd9Sstevel@tonic-gate /*
4927c478bd9Sstevel@tonic-gate  * Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage
4937c478bd9Sstevel@tonic-gate  */
4947c478bd9Sstevel@tonic-gate typedef struct prheader {
4957c478bd9Sstevel@tonic-gate 	long	pr_nent;	/* number of entries */
4967c478bd9Sstevel@tonic-gate 	long	pr_entsize;	/* size of each entry, in bytes */
4977c478bd9Sstevel@tonic-gate } prheader_t;
4987c478bd9Sstevel@tonic-gate 
4997c478bd9Sstevel@tonic-gate /*
5007c478bd9Sstevel@tonic-gate  * Macros for manipulating sets of flags.
5017c478bd9Sstevel@tonic-gate  * sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
5027c478bd9Sstevel@tonic-gate  * flag must be a member of the enumeration corresponding to *sp.
5037c478bd9Sstevel@tonic-gate  */
5047c478bd9Sstevel@tonic-gate 
5057c478bd9Sstevel@tonic-gate /* turn on all flags in set */
5067c478bd9Sstevel@tonic-gate #define	prfillset(sp) \
5077c478bd9Sstevel@tonic-gate 	{ register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
5087c478bd9Sstevel@tonic-gate 		while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0xFFFFFFFF; }
5097c478bd9Sstevel@tonic-gate 
5107c478bd9Sstevel@tonic-gate /* turn off all flags in set */
5117c478bd9Sstevel@tonic-gate #define	premptyset(sp) \
5127c478bd9Sstevel@tonic-gate 	{ register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
5137c478bd9Sstevel@tonic-gate 		while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0; }
5147c478bd9Sstevel@tonic-gate 
5157c478bd9Sstevel@tonic-gate /* turn on specified flag in set */
5167c478bd9Sstevel@tonic-gate #define	praddset(sp, flag) \
5177c478bd9Sstevel@tonic-gate 	((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
5187c478bd9Sstevel@tonic-gate 	(((uint32_t *)(sp))[((flag)-1)/32] |= (1U<<(((flag)-1)%32))) : 0))
5197c478bd9Sstevel@tonic-gate 
5207c478bd9Sstevel@tonic-gate /* turn off specified flag in set */
5217c478bd9Sstevel@tonic-gate #define	prdelset(sp, flag) \
5227c478bd9Sstevel@tonic-gate 	((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
5237c478bd9Sstevel@tonic-gate 	    (((uint32_t *)(sp))[((flag)-1)/32] &= ~(1U<<(((flag)-1)%32))) : 0))
5247c478bd9Sstevel@tonic-gate 
5257c478bd9Sstevel@tonic-gate /* query: != 0 iff flag is turned on in set */
5267c478bd9Sstevel@tonic-gate #define	prismember(sp, flag) \
5277c478bd9Sstevel@tonic-gate 	(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) && \
5287c478bd9Sstevel@tonic-gate 	    (((uint32_t *)(sp))[((flag)-1)/32] & (1U<<(((flag)-1)%32))))
5297c478bd9Sstevel@tonic-gate 
5307c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
5317c478bd9Sstevel@tonic-gate 
5327c478bd9Sstevel@tonic-gate /*
5337c478bd9Sstevel@tonic-gate  * dev32_t version of PRNODEV
5347c478bd9Sstevel@tonic-gate  */
5357c478bd9Sstevel@tonic-gate #define	PRNODEV32 (dev32_t)(-1)
5367c478bd9Sstevel@tonic-gate 
5377c478bd9Sstevel@tonic-gate /*
5387c478bd9Sstevel@tonic-gate  * Kernel view of /proc structures for _ILP32 programs.
5397c478bd9Sstevel@tonic-gate  */
5407c478bd9Sstevel@tonic-gate 
5417c478bd9Sstevel@tonic-gate /*
5427c478bd9Sstevel@tonic-gate  * _ILP32 lwp status file.  /proc/<pid>/lwp/<lwpid>/lwpstatus
5437c478bd9Sstevel@tonic-gate  */
5447c478bd9Sstevel@tonic-gate typedef struct lwpstatus32 {
5457c478bd9Sstevel@tonic-gate 	int	pr_flags;	/* flags */
5467c478bd9Sstevel@tonic-gate 	id32_t	pr_lwpid;	/* specific lwp identifier */
5477c478bd9Sstevel@tonic-gate 	short	pr_why;		/* reason for lwp stop, if stopped */
5487c478bd9Sstevel@tonic-gate 	short	pr_what;	/* more detailed reason */
5497c478bd9Sstevel@tonic-gate 	short	pr_cursig;	/* current signal, if any */
5507c478bd9Sstevel@tonic-gate 	short	pr_pad1;
5517c478bd9Sstevel@tonic-gate 	siginfo32_t pr_info;	/* info associated with signal or fault */
5527c478bd9Sstevel@tonic-gate 	sigset_t pr_lwppend;	/* set of signals pending to the lwp */
5537c478bd9Sstevel@tonic-gate 	sigset_t pr_lwphold;	/* set of signals blocked by the lwp */
5547c478bd9Sstevel@tonic-gate 	struct sigaction32 pr_action;	/* signal action for current signal */
5557c478bd9Sstevel@tonic-gate 	stack32_t pr_altstack;	/* alternate signal stack info */
5567c478bd9Sstevel@tonic-gate 	caddr32_t pr_oldcontext;	/* address of previous ucontext */
5577c478bd9Sstevel@tonic-gate 	short	pr_syscall;	/* system call number (if in syscall) */
5587c478bd9Sstevel@tonic-gate 	short	pr_nsysarg;	/* number of arguments to this syscall */
5597c478bd9Sstevel@tonic-gate 	int	pr_errno;	/* errno for failed syscall, 0 if successful */
5607c478bd9Sstevel@tonic-gate 	int32_t	pr_sysarg[PRSYSARGS];	/* arguments to this syscall */
5617c478bd9Sstevel@tonic-gate 	int32_t	pr_rval1;	/* primary syscall return value */
5627c478bd9Sstevel@tonic-gate 	int32_t	pr_rval2;	/* second syscall return value, if any */
5637c478bd9Sstevel@tonic-gate 	char	pr_clname[PRCLSZ];	/* scheduling class name */
5647c478bd9Sstevel@tonic-gate 	timestruc32_t pr_tstamp;	/* real-time time stamp of stop */
5657c478bd9Sstevel@tonic-gate 	timestruc32_t pr_utime;	/* lwp user cpu time */
5667c478bd9Sstevel@tonic-gate 	timestruc32_t pr_stime;	/* lwp system cpu time */
5677c478bd9Sstevel@tonic-gate 	int	pr_filler[11 - 2 * sizeof (timestruc32_t) / sizeof (int)];
5687c478bd9Sstevel@tonic-gate 	int	pr_errpriv;	/* missing privilege */
5697c478bd9Sstevel@tonic-gate 	caddr32_t pr_ustack;	/* address of stack boundary data (stack32_t) */
5707c478bd9Sstevel@tonic-gate 	uint32_t pr_instr;	/* current instruction */
5717c478bd9Sstevel@tonic-gate 	prgregset32_t pr_reg;	/* general registers */
5727c478bd9Sstevel@tonic-gate 	prfpregset32_t pr_fpreg; /* floating-point registers */
5737c478bd9Sstevel@tonic-gate } lwpstatus32_t;
5747c478bd9Sstevel@tonic-gate 
5757c478bd9Sstevel@tonic-gate /*
5767c478bd9Sstevel@tonic-gate  * _ILP32 process status file.  /proc/<pid>/status
5777c478bd9Sstevel@tonic-gate  */
5787c478bd9Sstevel@tonic-gate typedef struct pstatus32 {
5797c478bd9Sstevel@tonic-gate 	int	pr_flags;	/* flags */
5807c478bd9Sstevel@tonic-gate 	int	pr_nlwp;	/* number of active lwps in the process */
5817c478bd9Sstevel@tonic-gate 	pid32_t	pr_pid;		/* process id */
5827c478bd9Sstevel@tonic-gate 	pid32_t	pr_ppid;	/* parent process id */
5837c478bd9Sstevel@tonic-gate 	pid32_t	pr_pgid;	/* process group id */
5847c478bd9Sstevel@tonic-gate 	pid32_t	pr_sid;		/* session id */
5857c478bd9Sstevel@tonic-gate 	id32_t	pr_aslwpid;	/* historical; now always zero */
5867c478bd9Sstevel@tonic-gate 	id32_t	pr_agentid;	/* lwp id of the /proc agent lwp, if any */
5877c478bd9Sstevel@tonic-gate 	sigset_t pr_sigpend;	/* set of process pending signals */
5887c478bd9Sstevel@tonic-gate 	caddr32_t pr_brkbase;	/* address of the process heap */
5897c478bd9Sstevel@tonic-gate 	size32_t pr_brksize;	/* size of the process heap, in bytes */
5907c478bd9Sstevel@tonic-gate 	caddr32_t pr_stkbase;	/* address of the process stack */
5917c478bd9Sstevel@tonic-gate 	size32_t pr_stksize;	/* size of the process stack, in bytes */
5927c478bd9Sstevel@tonic-gate 	timestruc32_t pr_utime;	/* process user cpu time */
5937c478bd9Sstevel@tonic-gate 	timestruc32_t pr_stime;	/* process system cpu time */
5947c478bd9Sstevel@tonic-gate 	timestruc32_t pr_cutime;	/* sum of children's user times */
5957c478bd9Sstevel@tonic-gate 	timestruc32_t pr_cstime;	/* sum of children's system times */
5967c478bd9Sstevel@tonic-gate 	sigset_t pr_sigtrace;	/* set of traced signals */
5977c478bd9Sstevel@tonic-gate 	fltset_t pr_flttrace;	/* set of traced faults */
5987c478bd9Sstevel@tonic-gate 	sysset_t pr_sysentry;	/* set of system calls traced on entry */
5997c478bd9Sstevel@tonic-gate 	sysset_t pr_sysexit;	/* set of system calls traced on exit */
6007c478bd9Sstevel@tonic-gate 	char	pr_dmodel;	/* data model of the process */
6017c478bd9Sstevel@tonic-gate 	char	pr_pad[3];
6027c478bd9Sstevel@tonic-gate 	id32_t	pr_taskid;	/* task id */
6037c478bd9Sstevel@tonic-gate 	id32_t	pr_projid;	/* project id */
6047c478bd9Sstevel@tonic-gate 	int	pr_nzomb;	/* number of zombie lwps in the process */
6057c478bd9Sstevel@tonic-gate 	id32_t	pr_zoneid;	/* zone id */
6067c478bd9Sstevel@tonic-gate 	int	pr_filler[15];	/* reserved for future use */
6077c478bd9Sstevel@tonic-gate 	lwpstatus32_t pr_lwp;	/* status of the representative lwp */
6087c478bd9Sstevel@tonic-gate } pstatus32_t;
6097c478bd9Sstevel@tonic-gate 
6107c478bd9Sstevel@tonic-gate /*
6117c478bd9Sstevel@tonic-gate  * _ILP32 lwp ps(1) information file.  /proc/<pid>/lwp/<lwpid>/lwpsinfo
6127c478bd9Sstevel@tonic-gate  */
6137c478bd9Sstevel@tonic-gate typedef struct lwpsinfo32 {
6147c478bd9Sstevel@tonic-gate 	int	pr_flag;	/* lwp flags */
6157c478bd9Sstevel@tonic-gate 	id32_t	pr_lwpid;	/* lwp id */
6167c478bd9Sstevel@tonic-gate 	caddr32_t pr_addr;	/* internal address of lwp */
6177c478bd9Sstevel@tonic-gate 	caddr32_t pr_wchan;	/* wait addr for sleeping lwp */
6187c478bd9Sstevel@tonic-gate 	char	pr_stype;	/* synchronization event type */
6197c478bd9Sstevel@tonic-gate 	char	pr_state;	/* numeric lwp state */
6207c478bd9Sstevel@tonic-gate 	char	pr_sname;	/* printable character for pr_state */
6217c478bd9Sstevel@tonic-gate 	char	pr_nice;	/* nice for cpu usage */
6227c478bd9Sstevel@tonic-gate 	short	pr_syscall;	/* system call number (if in syscall) */
6237c478bd9Sstevel@tonic-gate 	char	pr_oldpri;	/* pre-SVR4, low value is high priority */
6247c478bd9Sstevel@tonic-gate 	char	pr_cpu;		/* pre-SVR4, cpu usage for scheduling */
6257c478bd9Sstevel@tonic-gate 	int	pr_pri;		/* priority, high value is high priority */
6267c478bd9Sstevel@tonic-gate 			/* The following percent number is a 16-bit binary */
6277c478bd9Sstevel@tonic-gate 			/* fraction [0 .. 1] with the binary point to the */
6287c478bd9Sstevel@tonic-gate 			/* right of the high-order bit (1.0 == 0x8000) */
6297c478bd9Sstevel@tonic-gate 	ushort_t pr_pctcpu;	/* % of recent cpu time used by this lwp */
6307c478bd9Sstevel@tonic-gate 	ushort_t pr_pad;
6317c478bd9Sstevel@tonic-gate 	timestruc32_t pr_start;	/* lwp start time, from the epoch */
6327c478bd9Sstevel@tonic-gate 	timestruc32_t pr_time;	/* usr+sys cpu time for this lwp */
6337c478bd9Sstevel@tonic-gate 	char	pr_clname[PRCLSZ];	/* scheduling class name */
6347c478bd9Sstevel@tonic-gate 	char	pr_name[PRFNSZ];	/* name of system lwp */
6357c478bd9Sstevel@tonic-gate 	processorid_t pr_onpro;		/* processor which last ran this lwp */
6367c478bd9Sstevel@tonic-gate 	processorid_t pr_bindpro;	/* processor to which lwp is bound */
6377c478bd9Sstevel@tonic-gate 	psetid_t pr_bindpset;	/* processor set to which lwp is bound */
638*c6402783Sakolb 	lgrp_id_t pr_lgrp;	/* lwp home lgroup */
639*c6402783Sakolb 	int	pr_filler[4];	/* reserved for future use */
6407c478bd9Sstevel@tonic-gate } lwpsinfo32_t;
6417c478bd9Sstevel@tonic-gate 
6427c478bd9Sstevel@tonic-gate /*
6437c478bd9Sstevel@tonic-gate  * _ILP32 process ps(1) information file.  /proc/<pid>/psinfo
6447c478bd9Sstevel@tonic-gate  */
6457c478bd9Sstevel@tonic-gate typedef struct psinfo32 {
6467c478bd9Sstevel@tonic-gate 	int	pr_flag;	/* process flags */
6477c478bd9Sstevel@tonic-gate 	int	pr_nlwp;	/* number of active lwps in the process */
6487c478bd9Sstevel@tonic-gate 	pid32_t	pr_pid;		/* unique process id */
6497c478bd9Sstevel@tonic-gate 	pid32_t	pr_ppid;	/* process id of parent */
6507c478bd9Sstevel@tonic-gate 	pid32_t	pr_pgid;	/* pid of process group leader */
6517c478bd9Sstevel@tonic-gate 	pid32_t	pr_sid;		/* session id */
6527c478bd9Sstevel@tonic-gate 	uid32_t	pr_uid;		/* real user id */
6537c478bd9Sstevel@tonic-gate 	uid32_t	pr_euid;	/* effective user id */
6547c478bd9Sstevel@tonic-gate 	gid32_t	pr_gid;		/* real group id */
6557c478bd9Sstevel@tonic-gate 	gid32_t	pr_egid;	/* effective group id */
6567c478bd9Sstevel@tonic-gate 	caddr32_t pr_addr;	/* address of process */
6577c478bd9Sstevel@tonic-gate 	size32_t pr_size;	/* size of process image in Kbytes */
6587c478bd9Sstevel@tonic-gate 	size32_t pr_rssize;	/* resident set size in Kbytes */
6597c478bd9Sstevel@tonic-gate 	size32_t pr_pad1;
6607c478bd9Sstevel@tonic-gate 	dev32_t	pr_ttydev;	/* controlling tty device (or PRNODEV) */
6617c478bd9Sstevel@tonic-gate 	ushort_t pr_pctcpu;	/* % of recent cpu time used by all lwps */
6627c478bd9Sstevel@tonic-gate 	ushort_t pr_pctmem;	/* % of system memory used by process */
6637c478bd9Sstevel@tonic-gate 	timestruc32_t pr_start;	/* process start time, from the epoch */
6647c478bd9Sstevel@tonic-gate 	timestruc32_t pr_time;	/* usr+sys cpu time for this process */
6657c478bd9Sstevel@tonic-gate 	timestruc32_t pr_ctime;	/* usr+sys cpu time for reaped children */
6667c478bd9Sstevel@tonic-gate 	char	pr_fname[PRFNSZ];	/* name of execed file */
6677c478bd9Sstevel@tonic-gate 	char	pr_psargs[PRARGSZ];	/* initial characters of arg list */
6687c478bd9Sstevel@tonic-gate 	int	pr_wstat;	/* if zombie, the wait() status */
6697c478bd9Sstevel@tonic-gate 	int	pr_argc;	/* initial argument count */
6707c478bd9Sstevel@tonic-gate 	caddr32_t pr_argv;	/* address of initial argument vector */
6717c478bd9Sstevel@tonic-gate 	caddr32_t pr_envp;	/* address of initial environment vector */
6727c478bd9Sstevel@tonic-gate 	char	pr_dmodel;	/* data model of the process */
6737c478bd9Sstevel@tonic-gate 	char	pr_pad2[3];
6747c478bd9Sstevel@tonic-gate 	id32_t	pr_taskid;	/* task id */
6757c478bd9Sstevel@tonic-gate 	id32_t	pr_projid;	/* project id */
6767c478bd9Sstevel@tonic-gate 	int	pr_nzomb;	/* number of zombie lwps in the process */
6777c478bd9Sstevel@tonic-gate 	id32_t	pr_poolid;	/* pool id */
6787c478bd9Sstevel@tonic-gate 	id32_t	pr_zoneid;	/* zone id */
6797c478bd9Sstevel@tonic-gate 	id32_t	pr_contract;	/* process contract */
6807c478bd9Sstevel@tonic-gate 	int	pr_filler[1];	/* reserved for future use */
6817c478bd9Sstevel@tonic-gate 	lwpsinfo32_t pr_lwp;	/* information for representative lwp */
6827c478bd9Sstevel@tonic-gate } psinfo32_t;
6837c478bd9Sstevel@tonic-gate 
6847c478bd9Sstevel@tonic-gate /*
6857c478bd9Sstevel@tonic-gate  * _ILP32 Memory-management interface.  /proc/<pid>/map /proc/<pid>/rmap
6867c478bd9Sstevel@tonic-gate  */
6877c478bd9Sstevel@tonic-gate typedef struct prmap32 {
6887c478bd9Sstevel@tonic-gate 	caddr32_t pr_vaddr;	/* virtual address of mapping */
6897c478bd9Sstevel@tonic-gate 	size32_t pr_size;	/* size of mapping in bytes */
6907c478bd9Sstevel@tonic-gate 	char	pr_mapname[64];	/* name in /proc/<pid>/object */
6917c478bd9Sstevel@tonic-gate 	offset_t pr_offset;	/* offset into mapped object, if any */
6927c478bd9Sstevel@tonic-gate 	int	pr_mflags;	/* protection and attribute flags */
6937c478bd9Sstevel@tonic-gate 	int	pr_pagesize;	/* pagesize (bytes) for this mapping */
6947c478bd9Sstevel@tonic-gate 	int	pr_shmid;	/* SysV shmid, -1 if not SysV shared memory */
6957c478bd9Sstevel@tonic-gate 	int	pr_filler[1];	/* filler for future expansion */
6967c478bd9Sstevel@tonic-gate } prmap32_t;
6977c478bd9Sstevel@tonic-gate 
6987c478bd9Sstevel@tonic-gate /*
6997c478bd9Sstevel@tonic-gate  * _ILP32 HAT memory-map interface.  /proc/<pid>/xmap
7007c478bd9Sstevel@tonic-gate  *
7017c478bd9Sstevel@tonic-gate  * The xmap structure is a Sun private interface. The existence, semantics
7027c478bd9Sstevel@tonic-gate  * and contents of the xmap structure are subject to arbitrary change.
7037c478bd9Sstevel@tonic-gate  */
7047c478bd9Sstevel@tonic-gate typedef struct prxmap32 {
7057c478bd9Sstevel@tonic-gate 	caddr32_t pr_vaddr;	/* virtual address of mapping */
7067c478bd9Sstevel@tonic-gate 	size32_t pr_size;	/* size of mapping in bytes */
7077c478bd9Sstevel@tonic-gate 	char	pr_mapname[PRMAPSZ];	/* name in /proc/<pid>/object */
7087c478bd9Sstevel@tonic-gate 	offset_t pr_offset;	/* offset into mapped object, if any */
7097c478bd9Sstevel@tonic-gate 	int	pr_mflags;	/* protection and attribute flags (see below) */
7107c478bd9Sstevel@tonic-gate 	int	pr_pagesize;	/* pagesize (bytes) for this mapping */
7117c478bd9Sstevel@tonic-gate 	int	pr_shmid;	/* SysV shmid, -1 if not SysV shared memory */
7127c478bd9Sstevel@tonic-gate 	dev32_t	pr_dev;  /* st_dev from stat64() of mapped object, or PRNODEV */
7137c478bd9Sstevel@tonic-gate 	uint64_t pr_ino; /* st_ino from stat64() of mapped object, if any */
7147c478bd9Sstevel@tonic-gate 	uint32_t pr_rss;	/* pages of resident memory */
7157c478bd9Sstevel@tonic-gate 	uint32_t pr_anon;	/* pages of resident anonymous memory */
7167c478bd9Sstevel@tonic-gate 	uint32_t pr_locked;	/* pages of locked memory */
7177c478bd9Sstevel@tonic-gate 	int	pr_hatpagesize;	/* pagesize of the hat mapping */
7187c478bd9Sstevel@tonic-gate 	uint32_t pr_filler[7];	/* filler for future expansion */
7197c478bd9Sstevel@tonic-gate } prxmap32_t;
7207c478bd9Sstevel@tonic-gate 
7217c478bd9Sstevel@tonic-gate /*
7227c478bd9Sstevel@tonic-gate  * _ILP32 Process credentials.  PCSCRED and /proc/<pid>/cred
7237c478bd9Sstevel@tonic-gate  */
7247c478bd9Sstevel@tonic-gate typedef struct prcred32 {
7257c478bd9Sstevel@tonic-gate 	uid32_t	pr_euid;	/* effective user id */
7267c478bd9Sstevel@tonic-gate 	uid32_t	pr_ruid;	/* real user id */
7277c478bd9Sstevel@tonic-gate 	uid32_t	pr_suid;	/* saved user id (from exec) */
7287c478bd9Sstevel@tonic-gate 	gid32_t	pr_egid;	/* effective group id */
7297c478bd9Sstevel@tonic-gate 	gid32_t	pr_rgid;	/* real group id */
7307c478bd9Sstevel@tonic-gate 	gid32_t	pr_sgid;	/* saved group id (from exec) */
7317c478bd9Sstevel@tonic-gate 	int	pr_ngroups;	/* number of supplementary groups */
7327c478bd9Sstevel@tonic-gate 	gid32_t	pr_groups[1];	/* array of supplementary groups */
7337c478bd9Sstevel@tonic-gate } prcred32_t;
7347c478bd9Sstevel@tonic-gate 
7357c478bd9Sstevel@tonic-gate /*
7367c478bd9Sstevel@tonic-gate  * _ILP32 Watchpoint interface.  PCWATCH and /proc/<pid>/watch
7377c478bd9Sstevel@tonic-gate  */
7387c478bd9Sstevel@tonic-gate typedef struct prwatch32 {
7397c478bd9Sstevel@tonic-gate 	caddr32_t pr_vaddr;	/* virtual address of watched area */
7407c478bd9Sstevel@tonic-gate 	size32_t pr_size;	/* size of watched area in bytes */
7417c478bd9Sstevel@tonic-gate 	int	pr_wflags;	/* watch type flags */
7427c478bd9Sstevel@tonic-gate 	int	pr_pad;
7437c478bd9Sstevel@tonic-gate } prwatch32_t;
7447c478bd9Sstevel@tonic-gate 
7457c478bd9Sstevel@tonic-gate /*
7467c478bd9Sstevel@tonic-gate  * _ILP32 PCREAD/PCWRITE I/O interface.
7477c478bd9Sstevel@tonic-gate  */
7487c478bd9Sstevel@tonic-gate typedef struct priovec32 {
7497c478bd9Sstevel@tonic-gate 	caddr32_t pio_base;	/* buffer in controlling process */
7507c478bd9Sstevel@tonic-gate 	size32_t pio_len;	/* size of read/write request */
7517c478bd9Sstevel@tonic-gate 	off32_t	pio_offset;	/* virtual address in target process */
7527c478bd9Sstevel@tonic-gate } priovec32_t;
7537c478bd9Sstevel@tonic-gate 
7547c478bd9Sstevel@tonic-gate /*
7557c478bd9Sstevel@tonic-gate  * _ILP32 Resource usage.  /proc/<pid>/usage /proc/<pid>/lwp/<lwpid>/lwpusage
7567c478bd9Sstevel@tonic-gate  */
7577c478bd9Sstevel@tonic-gate typedef struct prusage32 {
7587c478bd9Sstevel@tonic-gate 	id32_t		pr_lwpid;	/* lwp id.  0: process or defunct */
7597c478bd9Sstevel@tonic-gate 	int32_t		pr_count;	/* number of contributing lwps */
7607c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_tstamp;	/* current time stamp */
7617c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_create;	/* process/lwp creation time stamp */
7627c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_term;	/* process/lwp termination time stamp */
7637c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_rtime;	/* total lwp real (elapsed) time */
7647c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_utime;	/* user level cpu time */
7657c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_stime;	/* system call cpu time */
7667c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_ttime;	/* other system trap cpu time */
7677c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_tftime;	/* text page fault sleep time */
7687c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_dftime;	/* data page fault sleep time */
7697c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_kftime;	/* kernel page fault sleep time */
7707c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_ltime;	/* user lock wait sleep time */
7717c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_slptime;	/* all other sleep time */
7727c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_wtime;	/* wait-cpu (latency) time */
7737c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_stoptime;	/* stopped time */
7747c478bd9Sstevel@tonic-gate 	timestruc32_t	filltime[6];	/* filler for future expansion */
7757c478bd9Sstevel@tonic-gate 	uint32_t	pr_minf;	/* minor page faults */
7767c478bd9Sstevel@tonic-gate 	uint32_t	pr_majf;	/* major page faults */
7777c478bd9Sstevel@tonic-gate 	uint32_t	pr_nswap;	/* swaps */
7787c478bd9Sstevel@tonic-gate 	uint32_t	pr_inblk;	/* input blocks */
7797c478bd9Sstevel@tonic-gate 	uint32_t	pr_oublk;	/* output blocks */
7807c478bd9Sstevel@tonic-gate 	uint32_t	pr_msnd;	/* messages sent */
7817c478bd9Sstevel@tonic-gate 	uint32_t	pr_mrcv;	/* messages received */
7827c478bd9Sstevel@tonic-gate 	uint32_t	pr_sigs;	/* signals received */
7837c478bd9Sstevel@tonic-gate 	uint32_t	pr_vctx;	/* voluntary context switches */
7847c478bd9Sstevel@tonic-gate 	uint32_t	pr_ictx;	/* involuntary context switches */
7857c478bd9Sstevel@tonic-gate 	uint32_t	pr_sysc;	/* system calls */
7867c478bd9Sstevel@tonic-gate 	uint32_t	pr_ioch;	/* chars read and written */
7877c478bd9Sstevel@tonic-gate 	uint32_t	filler[10];	/* filler for future expansion */
7887c478bd9Sstevel@tonic-gate } prusage32_t;
7897c478bd9Sstevel@tonic-gate 
7907c478bd9Sstevel@tonic-gate /*
7917c478bd9Sstevel@tonic-gate  * _ILP32 Page data file.  /proc/<pid>/pagedata
7927c478bd9Sstevel@tonic-gate  */
7937c478bd9Sstevel@tonic-gate 
7947c478bd9Sstevel@tonic-gate /* _ILP32 page data file header */
7957c478bd9Sstevel@tonic-gate typedef struct prpageheader32 {
7967c478bd9Sstevel@tonic-gate 	timestruc32_t	pr_tstamp;	/* real time stamp */
7977c478bd9Sstevel@tonic-gate 	int32_t		pr_nmap;	/* number of address space mappings */
7987c478bd9Sstevel@tonic-gate 	int32_t		pr_npage;	/* total number of pages */
7997c478bd9Sstevel@tonic-gate } prpageheader32_t;
8007c478bd9Sstevel@tonic-gate 
8017c478bd9Sstevel@tonic-gate /* _ILP32 page data mapping header */
8027c478bd9Sstevel@tonic-gate typedef struct prasmap32 {
8037c478bd9Sstevel@tonic-gate 	caddr32_t pr_vaddr;	/* virtual address of mapping */
8047c478bd9Sstevel@tonic-gate 	size32_t pr_npage;	/* number of pages in mapping */
8057c478bd9Sstevel@tonic-gate 	char	pr_mapname[64];	/* name in /proc/<pid>/object */
8067c478bd9Sstevel@tonic-gate 	offset_t pr_offset;	/* offset into mapped object, if any */
8077c478bd9Sstevel@tonic-gate 	int	pr_mflags;	/* protection and attribute flags */
8087c478bd9Sstevel@tonic-gate 	int	pr_pagesize;	/* pagesize (bytes) for this mapping */
8097c478bd9Sstevel@tonic-gate 	int	pr_shmid;	/* SysV shmid, -1 if not SysV shared memory */
8107c478bd9Sstevel@tonic-gate 	int	pr_filler[1];	/* filler for future expansion */
8117c478bd9Sstevel@tonic-gate } prasmap32_t;
8127c478bd9Sstevel@tonic-gate 
8137c478bd9Sstevel@tonic-gate /*
8147c478bd9Sstevel@tonic-gate  * _ILP32 Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage
8157c478bd9Sstevel@tonic-gate  */
8167c478bd9Sstevel@tonic-gate typedef struct prheader32 {
8177c478bd9Sstevel@tonic-gate 	int32_t	pr_nent;	/* number of entries */
8187c478bd9Sstevel@tonic-gate 	int32_t	pr_entsize;	/* size of each entry, in bytes */
8197c478bd9Sstevel@tonic-gate } prheader32_t;
8207c478bd9Sstevel@tonic-gate 
8217c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
8227c478bd9Sstevel@tonic-gate 
8237c478bd9Sstevel@tonic-gate #endif	/* !_KERNEL && _STRUCTURED_PROC == 0 */
8247c478bd9Sstevel@tonic-gate 
8257c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
8267c478bd9Sstevel@tonic-gate }
8277c478bd9Sstevel@tonic-gate #endif
8287c478bd9Sstevel@tonic-gate 
8297c478bd9Sstevel@tonic-gate #endif	/* _SYS_PROCFS_H */
830