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