xref: /titanic_44/usr/src/uts/sparc/sys/old_procfs.h (revision ea8dc4b6d2251b437950c0056bc626b311c73c27)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1992-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 
31 #ifndef _SYS_OLD_PROCFS_H
32 #define	_SYS_OLD_PROCFS_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 /*
37  * This file contains the definitions for the old ioctl()-based
38  * version of the process file system.  It is obsolete but will
39  * continue to be supported in SunOS until the next major release.
40  * Note that <sys/procfs.h> and <sys/old_procfs.h> contain conflicting
41  * definitions and cannot be included together in the same source file.
42  */
43 
44 #include <sys/types.h>
45 #include <sys/time_impl.h>
46 #include <sys/signal.h>
47 #include <sys/siginfo.h>
48 #include <sys/fault.h>
49 #include <sys/syscall.h>
50 #include <sys/procfs_isa.h>
51 
52 #ifdef	__cplusplus
53 extern "C" {
54 #endif
55 
56 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
57 #error	"Cannot use procfs in the large file compilation environment"
58 #endif
59 
60 #if _STRUCTURED_PROC == 0
61 
62 /*
63  * ioctl codes and system call interfaces for /proc.
64  */
65 
66 #define	PIOC		('q'<<8)
67 #define	PIOCSTATUS	(PIOC|1)	/* get process status */
68 #define	PIOCSTOP	(PIOC|2)	/* post STOP request and... */
69 #define	PIOCWSTOP	(PIOC|3)	/* wait for process to STOP */
70 #define	PIOCRUN		(PIOC|4)	/* make process runnable */
71 #define	PIOCGTRACE	(PIOC|5)	/* get traced signal set */
72 #define	PIOCSTRACE	(PIOC|6)	/* set traced signal set */
73 #define	PIOCSSIG	(PIOC|7)	/* set current signal */
74 #define	PIOCKILL	(PIOC|8)	/* send signal */
75 #define	PIOCUNKILL	(PIOC|9)	/* delete a signal */
76 #define	PIOCGHOLD	(PIOC|10)	/* get held signal set */
77 #define	PIOCSHOLD	(PIOC|11)	/* set held signal set */
78 #define	PIOCMAXSIG	(PIOC|12)	/* get max signal number */
79 #define	PIOCACTION	(PIOC|13)	/* get signal action structs */
80 #define	PIOCGFAULT	(PIOC|14)	/* get traced fault set */
81 #define	PIOCSFAULT	(PIOC|15)	/* set traced fault set */
82 #define	PIOCCFAULT	(PIOC|16)	/* clear current fault */
83 #define	PIOCGENTRY	(PIOC|17)	/* get syscall entry set */
84 #define	PIOCSENTRY	(PIOC|18)	/* set syscall entry set */
85 #define	PIOCGEXIT	(PIOC|19)	/* get syscall exit set */
86 #define	PIOCSEXIT	(PIOC|20)	/* set syscall exit set */
87 
88 /*
89  * These four are obsolete (replaced by PIOCSET/PIOCRESET).
90  */
91 #define	PIOCSFORK	(PIOC|21)	/* set inherit-on-fork flag */
92 #define	PIOCRFORK	(PIOC|22)	/* reset inherit-on-fork flag */
93 #define	PIOCSRLC	(PIOC|23)	/* set run-on-last-close flag */
94 #define	PIOCRRLC	(PIOC|24)	/* reset run-on-last-close flag */
95 
96 #define	PIOCGREG	(PIOC|25)	/* get general registers */
97 #define	PIOCSREG	(PIOC|26)	/* set general registers */
98 #define	PIOCGFPREG	(PIOC|27)	/* get floating-point registers */
99 #define	PIOCSFPREG	(PIOC|28)	/* set floating-point registers */
100 #define	PIOCNICE	(PIOC|29)	/* set nice priority */
101 #define	PIOCPSINFO	(PIOC|30)	/* get ps(1) information */
102 #define	PIOCNMAP	(PIOC|31)	/* get number of memory mappings */
103 #define	PIOCMAP		(PIOC|32)	/* get memory map information */
104 #define	PIOCOPENM	(PIOC|33)	/* open mapped object for reading */
105 #define	PIOCCRED	(PIOC|34)	/* get process credentials */
106 #define	PIOCGROUPS	(PIOC|35)	/* get supplementary groups */
107 #define	PIOCGETPR	(PIOC|36)	/* read struct proc */
108 #define	PIOCGETU	(PIOC|37)	/* read user area */
109 
110 /*
111  * These are new with SunOS5.0.
112  */
113 #define	PIOCSET		(PIOC|38)	/* set process flags */
114 #define	PIOCRESET	(PIOC|39)	/* reset process flags */
115 #define	PIOCUSAGE	(PIOC|43)	/* get resource usage */
116 #define	PIOCOPENPD	(PIOC|44)	/* get page data file descriptor */
117 
118 /*
119  * Lightweight process interfaces.
120  */
121 #define	PIOCLWPIDS	(PIOC|45)	/* get lwp identifiers */
122 #define	PIOCOPENLWP	(PIOC|46)	/* get lwp file descriptor */
123 #define	PIOCLSTATUS	(PIOC|47)	/* get status of all lwps */
124 #define	PIOCLUSAGE	(PIOC|48)	/* get resource usage of all lwps */
125 
126 /*
127  * SVR4 run-time loader interfaces.
128  */
129 #define	PIOCNAUXV	(PIOC|49)	/* get number of aux vector entries */
130 #define	PIOCAUXV	(PIOC|50)	/* get aux vector (see sys/auxv.h) */
131 
132 /*
133  * extra register state interfaces
134  */
135 #define	PIOCGXREGSIZE	(PIOC|51)	/* get extra register state size */
136 #define	PIOCGXREG	(PIOC|52)	/* get extra register state */
137 #define	PIOCSXREG	(PIOC|53)	/* set extra register state */
138 
139 /*
140  * SPARC-specific interfaces.
141  */
142 #define	PIOCGWIN	(PIOC|101)	/* get gwindows_t (see sys/reg.h) */
143 
144 /* Process/lwp status structure */
145 
146 #define	PRCLSZ		8	/* maximum size of scheduling class name */
147 #define	PRSYSARGS	8	/* maximum number of syscall arguments */
148 
149 #endif	/* _STRUCTURED_PROC == 0 */
150 
151 typedef struct prstatus {
152 	int	pr_flags;	/* Flags (see below) */
153 	short	pr_why;		/* Reason for process stop (if stopped) */
154 	short	pr_what;	/* More detailed reason */
155 	siginfo_t pr_info;	/* Info associated with signal or fault */
156 	short	pr_cursig;	/* Current signal */
157 	ushort_t pr_nlwp;	/* Number of lwps in the process */
158 	sigset_t pr_sigpend;	/* Set of signals pending to the process */
159 	sigset_t pr_sighold;	/* Set of signals held (blocked) by the lwp */
160 	struct	sigaltstack pr_altstack; /* Alternate signal stack info */
161 	struct	sigaction pr_action; /* Signal action for current signal */
162 	pid_t	pr_pid;		/* Process id */
163 	pid_t	pr_ppid;	/* Parent process id */
164 	pid_t	pr_pgrp;	/* Process group id */
165 	pid_t	pr_sid;		/* Session id */
166 	timestruc_t pr_utime;	/* Process user cpu time */
167 	timestruc_t pr_stime;	/* Process system cpu time */
168 	timestruc_t pr_cutime;	/* Sum of children's user times */
169 	timestruc_t pr_cstime;	/* Sum of children's system times */
170 	char	pr_clname[PRCLSZ]; /* Scheduling class name */
171 	short	pr_syscall;	/* System call number (if in syscall) */
172 	short	pr_nsysarg;	/* Number of arguments to this syscall */
173 	long	pr_sysarg[PRSYSARGS]; /* Arguments to this syscall */
174 	id_t	pr_who;		/* Specific lwp identifier */
175 	sigset_t pr_lwppend;	/* Set of signals pending to the lwp */
176 	struct ucontext *pr_oldcontext; /* Address of previous ucontext */
177 	caddr_t	pr_brkbase;	/* Address of the process heap */
178 	size_t	pr_brksize;	/* Size of the process heap, in bytes */
179 	caddr_t	pr_stkbase;	/* Address of the process stack */
180 	size_t	pr_stksize;	/* Size of the process stack, in bytes */
181 	short	pr_processor;	/* processor which last ran this LWP */
182 	short	pr_bind;	/* processor LWP bound to or PBIND_NONE */
183 	long	pr_instr;	/* Current instruction */
184 	prgregset_t pr_reg;	/* General registers */
185 } prstatus_t;
186 
187 #if _STRUCTURED_PROC == 0
188 
189 /* pr_flags */
190 
191 #define	PR_STOPPED	0x0001	/* lwp is stopped */
192 #define	PR_ISTOP	0x0002	/* lwp is stopped on an event of interest */
193 #define	PR_DSTOP	0x0004	/* lwp has a stop directive in effect */
194 #define	PR_ASLEEP	0x0008	/* lwp is sleeping in a system call */
195 #define	PR_FORK		0x0010	/* inherit-on-fork is in effect */
196 #define	PR_RLC		0x0020	/* run-on-last-close is in effect */
197 #define	PR_PTRACE	0x0040	/* obsolete, never set in SunOS5.0 */
198 #define	PR_PCINVAL	0x0080	/* contents of pr_instr undefined */
199 #define	PR_ISSYS	0x0100	/* system process */
200 #define	PR_STEP		0x0200	/* lwp has a single-step directive in effect */
201 #define	PR_KLC		0x0400	/* kill-on-last-close is in effect */
202 #define	PR_ASYNC	0x0800	/* asynchronous-stop is in effect */
203 #define	PR_PCOMPAT	0x1000	/* ptrace-compatibility mode is in effect */
204 #define	PR_MSACCT	0x2000	/* micro-state usage accounting is in effect */
205 #define	PR_BPTADJ	0x4000	/* breakpoint trap pc adjustment is in effect */
206 #define	PR_ASLWP	0x8000	/* obsolete flag; never set */
207 
208 /* Reasons for stopping */
209 
210 #define	PR_REQUESTED	1
211 #define	PR_SIGNALLED	2
212 #define	PR_SYSENTRY	3
213 #define	PR_SYSEXIT	4
214 #define	PR_JOBCONTROL	5
215 #define	PR_FAULTED	6
216 #define	PR_SUSPENDED	7
217 #define	PR_CHECKPOINT	8
218 
219 /* Information for the ps(1) command */
220 
221 #define	PRFNSZ		16		/* max size of execed filename */
222 #define	PRARGSZ		80		/* Number of chars of arguments */
223 
224 #endif	/* _STRUCTURED_PROC == 0 */
225 
226 typedef struct prpsinfo {
227 	char	pr_state;	/* numeric process state (see pr_sname) */
228 	char	pr_sname;	/* printable character representing pr_state */
229 	char	pr_zomb;	/* !=0: process terminated but not waited for */
230 	char	pr_nice;	/* nice for cpu usage */
231 	uint_t	pr_flag;	/* process flags */
232 	uid_t	pr_uid;		/* real user id */
233 	gid_t	pr_gid;		/* real group id */
234 	pid_t	pr_pid;		/* unique process id */
235 	pid_t	pr_ppid;	/* process id of parent */
236 	pid_t	pr_pgrp;	/* pid of process group leader */
237 	pid_t	pr_sid;		/* session id */
238 	caddr_t	pr_addr;	/* physical address of process */
239 	size_t	pr_size;	/* size of process image in pages */
240 	size_t	pr_rssize;	/* resident set size in pages */
241 	caddr_t	pr_wchan;	/* wait addr for sleeping process */
242 	timestruc_t pr_start;	/* process start time, sec+nsec since epoch */
243 	timestruc_t pr_time;	/* usr+sys cpu time for this process */
244 	int	pr_pri;		/* priority, high value is high priority */
245 	char	pr_oldpri;	/* pre-SVR4, low value is high priority */
246 	char	pr_cpu;		/* pre-SVR4, cpu usage for scheduling */
247 	o_dev_t	pr_ottydev;	/* short tty device number */
248 	dev_t	pr_lttydev;	/* controlling tty device (PRNODEV if none) */
249 	char	pr_clname[PRCLSZ];	/* scheduling class name */
250 	char	pr_fname[PRFNSZ];	/* last component of execed pathname */
251 	char	pr_psargs[PRARGSZ];	/* initial characters of arg list */
252 	short	pr_syscall;	/* system call number (if in syscall) */
253 	short	pr_fill;
254 	timestruc_t pr_ctime;	/* usr+sys cpu time for reaped children */
255 	size_t	pr_bysize;	/* size of process image in bytes */
256 	size_t	pr_byrssize;	/* resident set size in bytes */
257 	int	pr_argc;	/* initial argument count */
258 	char	**pr_argv;	/* initial argument vector */
259 	char	**pr_envp;	/* initial environment vector */
260 	int	pr_wstat;	/* if zombie, the wait() status */
261 			/* The following percent numbers are 16-bit binary */
262 			/* fractions [0 .. 1] with the binary point to the */
263 			/* right of the high-order bit (one == 0x8000) */
264 	ushort_t pr_pctcpu;	/* % of recent cpu time, one or all lwps */
265 	ushort_t pr_pctmem;	/* % of of system memory used by the process */
266 	uid_t	pr_euid;	/* effective user id */
267 	gid_t	pr_egid;	/* effective group id */
268 	id_t	pr_aslwpid;	/* historical; now always zero */
269 	char	pr_dmodel;	/* data model of the process */
270 	char	pr_pad[3];
271 	int	pr_filler[6];	/* for future expansion */
272 } prpsinfo_t;
273 
274 #if _STRUCTURED_PROC == 0
275 
276 #if !defined(_STYPES)
277 #define	pr_ttydev	pr_lttydev
278 #else
279 #define	pr_ttydev	pr_ottydev
280 #endif
281 
282 #define	PRNODEV	(dev_t)(-1l)	/* non-existent device */
283 
284 /*
285  * See <sys/procfs_isa.h> for possible values of pr_dmodel.
286  */
287 
288 /* Optional actions to take when process continues */
289 
290 typedef struct prrun {
291 	int	pr_flags;	/* Flags */
292 	sigset_t pr_trace;	/* Set of signals to be traced */
293 	sigset_t pr_sighold;	/* Set of signals to be held */
294 	fltset_t pr_fault;	/* Set of faults to be traced */
295 	caddr_t	pr_vaddr;	/* Virtual address at which to resume */
296 	int	pr_filler[8];	/* Filler area for future expansion */
297 } prrun_t;
298 
299 #define	PRCSIG		0x001	/* Clear current signal */
300 #define	PRCFAULT	0x002	/* Clear current fault */
301 #define	PRSTRACE	0x004	/* Use traced-signal set in pr_trace */
302 #define	PRSHOLD		0x008	/* Use held-signal set in pr_sighold */
303 #define	PRSFAULT	0x010	/* Use traced-fault set in pr_fault */
304 #define	PRSVADDR	0x020	/* Resume at virtual address in pr_vaddr */
305 #define	PRSTEP		0x040	/* Direct the lwp to single-step */
306 #define	PRSABORT	0x080	/* Abort syscall */
307 #define	PRSTOP		0x100	/* Set directed stop request */
308 
309 /* Memory-management interface */
310 
311 typedef struct prmap {
312 	caddr_t		pr_vaddr;	/* Virtual address */
313 	size_t		pr_size;	/* Size of mapping in bytes */
314 	off_t		pr_off;		/* Offset into mapped object, if any */
315 	uint_t		pr_mflags;	/* Protection and attribute flags */
316 	uint_t		pr_pagesize;	/* pagesize (bytes) for this mapping */
317 	long		pr_filler[3];	/* Filler for future expansion */
318 } prmap_t;
319 
320 /* Protection and attribute flags */
321 
322 #define	MA_READ		0x04	/* Readable by the traced process */
323 #define	MA_WRITE	0x02	/* Writable by the traced process */
324 #define	MA_EXEC		0x01	/* Executable by the traced process */
325 #define	MA_SHARED	0x08	/* Changes are shared by mapped object */
326 /*
327  * These are obsolete and unreliable.
328  * They are included here only for historical compatibility.
329  */
330 #define	MA_BREAK	0x10	/* Grown by brk(2) */
331 #define	MA_STACK	0x20	/* Grown automatically on stack faults */
332 
333 /* Process credentials */
334 
335 typedef struct prcred {
336 	uid_t	pr_euid;	/* Effective user id */
337 	uid_t	pr_ruid;	/* Real user id */
338 	uid_t	pr_suid;	/* Saved user id (from exec) */
339 	gid_t	pr_egid;	/* Effective group id */
340 	gid_t	pr_rgid;	/* Real group id */
341 	gid_t	pr_sgid;	/* Saved group id (from exec) */
342 	uint_t	pr_ngroups;	/* Number of supplementary groups */
343 } prcred_t;
344 
345 /* Resource usage */
346 
347 typedef struct prusage {
348 	id_t		pr_lwpid;	/* lwp id.  0: process or defunct */
349 	int		pr_count;	/* number of contributing lwps */
350 	timestruc_t	pr_tstamp;	/* current time stamp */
351 	timestruc_t	pr_create;	/* process/lwp creation time stamp */
352 	timestruc_t	pr_term;	/* process/lwp termination time stamp */
353 	timestruc_t	pr_rtime;	/* total lwp real (elapsed) time */
354 	timestruc_t	pr_utime;	/* user level CPU time */
355 	timestruc_t	pr_stime;	/* system call CPU time */
356 	timestruc_t	pr_ttime;	/* other system trap CPU time */
357 	timestruc_t	pr_tftime;	/* text page fault sleep time */
358 	timestruc_t	pr_dftime;	/* data page fault sleep time */
359 	timestruc_t	pr_kftime;	/* kernel page fault sleep time */
360 	timestruc_t	pr_ltime;	/* user lock wait sleep time */
361 	timestruc_t	pr_slptime;	/* all other sleep time */
362 	timestruc_t	pr_wtime;	/* wait-cpu (latency) time */
363 	timestruc_t	pr_stoptime;	/* stopped time */
364 	timestruc_t	filltime[6];	/* filler for future expansion */
365 	ulong_t		pr_minf;	/* minor page faults */
366 	ulong_t		pr_majf;	/* major page faults */
367 	ulong_t		pr_nswap;	/* swaps */
368 	ulong_t		pr_inblk;	/* input blocks */
369 	ulong_t		pr_oublk;	/* output blocks */
370 	ulong_t		pr_msnd;	/* messages sent */
371 	ulong_t		pr_mrcv;	/* messages received */
372 	ulong_t		pr_sigs;	/* signals received */
373 	ulong_t		pr_vctx;	/* voluntary context switches */
374 	ulong_t		pr_ictx;	/* involuntary context switches */
375 	ulong_t		pr_sysc;	/* system calls */
376 	ulong_t		pr_ioch;	/* chars read and written */
377 	ulong_t		filler[10];	/* filler for future expansion */
378 } prusage_t;
379 
380 /* Page data */
381 
382 /* page data file header */
383 typedef struct prpageheader {
384 	timestruc_t	pr_tstamp;	/* real time stamp */
385 	ulong_t		pr_nmap;	/* number of address space mappings */
386 	ulong_t		pr_npage;	/* total number of pages */
387 } prpageheader_t;
388 
389 /* page data mapping header */
390 typedef struct prasmap {
391 	caddr_t		pr_vaddr;	/* virtual address */
392 	size_t		pr_npage;	/* number of pages in mapping */
393 	off_t		pr_off;		/* offset into mapped object, if any */
394 	uint_t		pr_mflags;	/* protection and attribute flags */
395 	uint_t		pr_pagesize;	/* pagesize (bytes) for this mapping */
396 	long		pr_filler[3];	/* filler for future expansion */
397 } prasmap_t;
398 
399 /*
400  * npage bytes (rounded up to a sizeof (long)-byte boundary) follow
401  * each mapping header, containing zero or more of these flags.
402  */
403 #define	PG_REFERENCED	0x02		/* page referenced since last read */
404 #define	PG_MODIFIED	0x01		/* page modified since last read */
405 #define	PG_HWMAPPED	0x04		/* page is present and mapped */
406 
407 /*
408  * Macros for manipulating sets of flags.
409  * sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
410  * flag must be a member of the enumeration corresponding to *sp.
411  */
412 
413 /* turn on all flags in set */
414 #define	prfillset(sp) \
415 	{ register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
416 		while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0xFFFFFFFF; }
417 
418 /* turn off all flags in set */
419 #define	premptyset(sp) \
420 	{ register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
421 		while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0; }
422 
423 /* turn on specified flag in set */
424 #define	praddset(sp, flag) \
425 	((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
426 	(((uint32_t *)(sp))[((flag)-1)/32] |= (1UL<<(((flag)-1)%32))) : 0))
427 
428 /* turn off specified flag in set */
429 #define	prdelset(sp, flag) \
430 	((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
431 	    (((uint32_t *)(sp))[((flag)-1)/32] &= ~(1UL<<(((flag)-1)%32))) : 0))
432 
433 /* query: != 0 iff flag is turned on in set */
434 #define	prismember(sp, flag) \
435 	(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) && \
436 	    (((uint32_t *)(sp))[((flag)-1)/32] & (1UL<<(((flag)-1)%32))))
437 
438 #endif	/* _STRUCTURED_PROC == 0 */
439 
440 #ifdef _SYSCALL32
441 
442 #if _STRUCTURED_PROC == 0
443 
444 /*
445  * dev32_t version of PRNODEV
446  */
447 #define	PRNODEV32 (dev32_t)(-1)
448 
449 /*
450  * Kernel view of structures used by _ILP32 programs.
451  */
452 
453 #endif	/* _STRUCTURED_PROC == 0 */
454 
455 typedef struct prstatus32 {
456 	int32_t	pr_flags;	/* Flags */
457 	short	pr_why;		/* Reason for process stop (if stopped) */
458 	short	pr_what;	/* More detailed reason */
459 	siginfo32_t pr_info;	/* Info associated with signal or fault */
460 	short	pr_cursig;	/* Current signal */
461 	ushort_t pr_nlwp;	/* Number of lwps in the process */
462 	sigset_t pr_sigpend;	/* Set of signals pending to the process */
463 	sigset_t pr_sighold;	/* Set of signals held (blocked) by the lwp */
464 	struct	sigaltstack32 pr_altstack; /* Alternate signal stack info */
465 	struct	sigaction32 pr_action; /* Signal action for current signal */
466 	pid32_t	pr_pid;		/* Process id */
467 	pid32_t	pr_ppid;	/* Parent process id */
468 	pid32_t	pr_pgrp;	/* Process group id */
469 	pid32_t	pr_sid;		/* Session id */
470 	timestruc32_t pr_utime;	/* Process user cpu time */
471 	timestruc32_t pr_stime;	/* Process system cpu time */
472 	timestruc32_t pr_cutime; /* Sum of children's user times */
473 	timestruc32_t pr_cstime; /* Sum of children's system times */
474 	char	pr_clname[PRCLSZ]; /* Scheduling class name */
475 	short	pr_syscall;	/* System call number (if in syscall) */
476 	short	pr_nsysarg;	/* Number of arguments to this syscall */
477 	int32_t	pr_sysarg[PRSYSARGS]; /* Arguments to this syscall */
478 	id32_t	pr_who;		/* Specific lwp identifier */
479 	sigset_t pr_lwppend;	/* Set of signals pending to the lwp */
480 	caddr32_t pr_oldcontext; /* Address of previous ucontext */
481 	caddr32_t pr_brkbase;	/* Address of the process heap */
482 	size32_t pr_brksize;	/* Size of the process heap, in bytes */
483 	caddr32_t pr_stkbase;	/* Address of the process stack */
484 	size32_t pr_stksize;	/* Size of the process stack, in bytes */
485 	short	pr_processor;	/* processor which last ran this LWP */
486 	short	pr_bind;	/* processor LWP bound to or PBIND_NONE */
487 	int32_t	pr_instr;	/* Current instruction */
488 	prgregset32_t pr_reg;	/* General registers */
489 } prstatus32_t;
490 
491 typedef struct prpsinfo32 {
492 	char	pr_state;	/* numeric process state (see pr_sname) */
493 	char	pr_sname;	/* printable character representing pr_state */
494 	char	pr_zomb;	/* !=0: process terminated but not waited for */
495 	char	pr_nice;	/* nice for cpu usage */
496 	uint32_t pr_flag;	/* process flags */
497 	uid32_t	pr_uid;		/* real user id */
498 	gid32_t	pr_gid;		/* real group id */
499 	pid32_t	pr_pid;		/* unique process id */
500 	pid32_t	pr_ppid;	/* process id of parent */
501 	pid32_t	pr_pgrp;	/* pid of process group leader */
502 	pid32_t	pr_sid;		/* session id */
503 	caddr32_t pr_addr;	/* physical address of process */
504 	size32_t pr_size;	/* size of process image in pages */
505 	size32_t pr_rssize;	/* resident set size in pages */
506 	caddr32_t pr_wchan;	/* wait addr for sleeping process */
507 	timestruc32_t pr_start;	/* process start time, sec+nsec since epoch */
508 	timestruc32_t pr_time;	/* usr+sys cpu time for this process */
509 	int32_t	pr_pri;		/* priority, high value is high priority */
510 	char	pr_oldpri;	/* pre-SVR4, low value is high priority */
511 	char	pr_cpu;		/* pre-SVR4, cpu usage for scheduling */
512 	o_dev_t	pr_ottydev;	/* short tty device number */
513 	dev32_t	pr_lttydev;	/* controlling tty device (PRNODEV if none) */
514 	char	pr_clname[PRCLSZ];	/* scheduling class name */
515 	char	pr_fname[PRFNSZ];	/* last component of execed pathname */
516 	char	pr_psargs[PRARGSZ];	/* initial characters of arg list */
517 	short	pr_syscall;	/* system call number (if in syscall) */
518 	short	pr_fill;
519 	timestruc32_t pr_ctime;	/* usr+sys cpu time for reaped children */
520 	size32_t pr_bysize;	/* size of process image in bytes */
521 	size32_t pr_byrssize;	/* resident set size in bytes */
522 	int	pr_argc;	/* initial argument count */
523 	caddr32_t pr_argv;	/* initial argument vector */
524 	caddr32_t pr_envp;	/* initial environment vector */
525 	int	pr_wstat;	/* if zombie, the wait() status */
526 	ushort_t pr_pctcpu;	/* % of recent cpu time, one or all lwps */
527 	ushort_t pr_pctmem;	/* % of of system memory used by the process */
528 	uid32_t	pr_euid;	/* effective user id */
529 	gid32_t	pr_egid;	/* effective group id */
530 	id32_t	pr_aslwpid;	/* historical; now always zero */
531 	char	pr_dmodel;	/* data model of the process */
532 	char	pr_pad[3];
533 	int32_t	pr_filler[6];	/* for future expansion */
534 } prpsinfo32_t;
535 
536 #if _STRUCTURED_PROC == 0
537 
538 typedef struct prrun32 {
539 	int32_t	pr_flags;	/* Flags */
540 	sigset_t pr_trace;	/* Set of signals to be traced */
541 	sigset_t pr_sighold;	/* Set of signals to be held */
542 	fltset_t pr_fault;	/* Set of faults to be traced */
543 	caddr32_t pr_vaddr;	/* Virtual address at which to resume */
544 	int32_t	pr_filler[8];	/* Filler area for future expansion */
545 } prrun32_t;
546 
547 typedef struct ioc_prmap32 {
548 	caddr32_t	pr_vaddr;	/* Virtual address */
549 	size32_t	pr_size;	/* Size of mapping in bytes */
550 	off32_t		pr_off;		/* Offset into mapped object, if any */
551 	uint32_t	pr_mflags;	/* Protection and attribute flags */
552 	uint32_t	pr_pagesize;	/* pagesize (bytes) for this mapping */
553 	int32_t		pr_filler[3];	/* Filler for future expansion */
554 } ioc_prmap32_t;
555 
556 typedef struct prusage32 {
557 	id32_t		pr_lwpid;	/* lwp id.  0: process or defunct */
558 	int32_t		pr_count;	/* number of contributing lwps */
559 	timestruc32_t	pr_tstamp;	/* current time stamp */
560 	timestruc32_t	pr_create;	/* process/lwp creation time stamp */
561 	timestruc32_t	pr_term;	/* process/lwp termination time stamp */
562 	timestruc32_t	pr_rtime;	/* total lwp real (elapsed) time */
563 	timestruc32_t	pr_utime;	/* user level cpu time */
564 	timestruc32_t	pr_stime;	/* system call cpu time */
565 	timestruc32_t	pr_ttime;	/* other system trap cpu time */
566 	timestruc32_t	pr_tftime;	/* text page fault sleep time */
567 	timestruc32_t	pr_dftime;	/* data page fault sleep time */
568 	timestruc32_t	pr_kftime;	/* kernel page fault sleep time */
569 	timestruc32_t	pr_ltime;	/* user lock wait sleep time */
570 	timestruc32_t	pr_slptime;	/* all other sleep time */
571 	timestruc32_t	pr_wtime;	/* wait-cpu (latency) time */
572 	timestruc32_t	pr_stoptime;	/* stopped time */
573 	timestruc32_t	filltime[6];	/* filler for future expansion */
574 	uint32_t	pr_minf;	/* minor page faults */
575 	uint32_t	pr_majf;	/* major page faults */
576 	uint32_t	pr_nswap;	/* swaps */
577 	uint32_t	pr_inblk;	/* input blocks */
578 	uint32_t	pr_oublk;	/* output blocks */
579 	uint32_t	pr_msnd;	/* messages sent */
580 	uint32_t	pr_mrcv;	/* messages received */
581 	uint32_t	pr_sigs;	/* signals received */
582 	uint32_t	pr_vctx;	/* voluntary context switches */
583 	uint32_t	pr_ictx;	/* involuntary context switches */
584 	uint32_t	pr_sysc;	/* system calls */
585 	uint32_t	pr_ioch;	/* chars read and written */
586 	uint32_t	filler[10];	/* filler for future expansion */
587 } prusage32_t;
588 
589 typedef struct ioc_prpageheader32 {
590 	timestruc32_t	pr_tstamp;	/* real time stamp */
591 	uint32_t	pr_nmap;	/* number of address space mappings */
592 	uint32_t	pr_npage;	/* total number of pages */
593 } ioc_prpageheader32_t;
594 
595 typedef struct ioc_prasmap32 {
596 	caddr32_t	pr_vaddr;	/* virtual address */
597 	size32_t	pr_npage;	/* number of pages in mapping */
598 	off32_t		pr_off;		/* offset into mapped object, if any */
599 	uint32_t	pr_mflags;	/* protection and attribute flags */
600 	uint32_t	pr_pagesize;	/* pagesize (bytes) for this mapping */
601 	int32_t		pr_filler[3];	/* filler for future expansion */
602 } ioc_prasmap32_t;
603 
604 #endif	/* _STRUCTURED_PROC == 0 */
605 
606 #endif	/* _SYSCALL32 */
607 
608 #ifdef	__cplusplus
609 }
610 #endif
611 
612 #endif	/* _SYS_OLD_PROCFS_H */
613