xref: /titanic_41/usr/src/uts/intel/sys/old_procfs.h (revision 7c2fbfb345896881c631598ee3852ce9ce33fb07)
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  * Intel-specific interfaces.
141  */
142 #define	PIOCNLDT	(PIOC|103)	/* get number of LDT entries */
143 #define	PIOCLDT		(PIOC|104)	/* get LDT (see sys/sysi86.h) */
144 
145 /* Process/lwp status structure */
146 
147 #define	PRCLSZ		8	/* maximum size of scheduling class name */
148 #define	PRSYSARGS	8	/* maximum number of syscall arguments */
149 
150 #endif	/* _STRUCTURED_PROC == 0 */
151 
152 typedef struct prstatus {
153 	int	pr_flags;	/* Flags (see below) */
154 	short	pr_why;		/* Reason for process stop (if stopped) */
155 	short	pr_what;	/* More detailed reason */
156 	siginfo_t pr_info;	/* Info associated with signal or fault */
157 	short	pr_cursig;	/* Current signal */
158 	ushort_t pr_nlwp;	/* Number of lwps in the process */
159 	sigset_t pr_sigpend;	/* Set of signals pending to the process */
160 	sigset_t pr_sighold;	/* Set of signals held (blocked) by the lwp */
161 	struct	sigaltstack pr_altstack; /* Alternate signal stack info */
162 	struct	sigaction pr_action; /* Signal action for current signal */
163 	pid_t	pr_pid;		/* Process id */
164 	pid_t	pr_ppid;	/* Parent process id */
165 	pid_t	pr_pgrp;	/* Process group id */
166 	pid_t	pr_sid;		/* Session id */
167 	timestruc_t pr_utime;	/* Process user cpu time */
168 	timestruc_t pr_stime;	/* Process system cpu time */
169 	timestruc_t pr_cutime;	/* Sum of children's user times */
170 	timestruc_t pr_cstime;	/* Sum of children's system times */
171 	char	pr_clname[PRCLSZ]; /* Scheduling class name */
172 	short	pr_syscall;	/* System call number (if in syscall) */
173 	short	pr_nsysarg;	/* Number of arguments to this syscall */
174 	long	pr_sysarg[PRSYSARGS]; /* Arguments to this syscall */
175 	id_t	pr_who;		/* Specific lwp identifier */
176 	sigset_t pr_lwppend;	/* Set of signals pending to the lwp */
177 	struct ucontext *pr_oldcontext; /* Address of previous ucontext */
178 	caddr_t	pr_brkbase;	/* Address of the process heap */
179 	size_t	pr_brksize;	/* Size of the process heap, in bytes */
180 	caddr_t	pr_stkbase;	/* Address of the process stack */
181 	size_t	pr_stksize;	/* Size of the process stack, in bytes */
182 	short	pr_processor;	/* processor which last ran this LWP */
183 	short	pr_bind;	/* processor LWP bound to or PBIND_NONE */
184 	long	pr_instr;	/* Current instruction */
185 	prgregset_t pr_reg;	/* General registers */
186 } prstatus_t;
187 
188 #if _STRUCTURED_PROC == 0
189 
190 /* pr_flags */
191 
192 #define	PR_STOPPED	0x0001	/* lwp is stopped */
193 #define	PR_ISTOP	0x0002	/* lwp is stopped on an event of interest */
194 #define	PR_DSTOP	0x0004	/* lwp has a stop directive in effect */
195 #define	PR_ASLEEP	0x0008	/* lwp is sleeping in a system call */
196 #define	PR_FORK		0x0010	/* inherit-on-fork is in effect */
197 #define	PR_RLC		0x0020	/* run-on-last-close is in effect */
198 #define	PR_PTRACE	0x0040	/* obsolete, never set in SunOS5.0 */
199 #define	PR_PCINVAL	0x0080	/* contents of pr_instr undefined */
200 #define	PR_ISSYS	0x0100	/* system process */
201 #define	PR_STEP		0x0200	/* lwp has a single-step directive in effect */
202 #define	PR_KLC		0x0400	/* kill-on-last-close is in effect */
203 #define	PR_ASYNC	0x0800	/* asynchronous-stop is in effect */
204 #define	PR_PCOMPAT	0x1000	/* ptrace-compatibility mode is in effect */
205 #define	PR_MSACCT	0x2000	/* micro-state usage accounting is in effect */
206 #define	PR_BPTADJ	0x4000	/* breakpoint trap pc adjustment is in effect */
207 #define	PR_ASLWP	0x8000	/* obsolete flag; never set */
208 
209 /* Reasons for stopping */
210 
211 #define	PR_REQUESTED	1
212 #define	PR_SIGNALLED	2
213 #define	PR_SYSENTRY	3
214 #define	PR_SYSEXIT	4
215 #define	PR_JOBCONTROL	5
216 #define	PR_FAULTED	6
217 #define	PR_SUSPENDED	7
218 #define	PR_CHECKPOINT	8
219 
220 /* Information for the ps(1) command */
221 
222 #define	PRFNSZ		16		/* max size of execed filename */
223 #define	PRARGSZ		80		/* Number of chars of arguments */
224 
225 #endif	/* _STRUCTURED_PROC == 0 */
226 
227 typedef struct prpsinfo {
228 	char	pr_state;	/* numeric process state (see pr_sname) */
229 	char	pr_sname;	/* printable character representing pr_state */
230 	char	pr_zomb;	/* !=0: process terminated but not waited for */
231 	char	pr_nice;	/* nice for cpu usage */
232 	uint_t	pr_flag;	/* process flags */
233 	uid_t	pr_uid;		/* real user id */
234 	gid_t	pr_gid;		/* real group id */
235 	pid_t	pr_pid;		/* unique process id */
236 	pid_t	pr_ppid;	/* process id of parent */
237 	pid_t	pr_pgrp;	/* pid of process group leader */
238 	pid_t	pr_sid;		/* session id */
239 	caddr_t	pr_addr;	/* physical address of process */
240 	size_t	pr_size;	/* size of process image in pages */
241 	size_t	pr_rssize;	/* resident set size in pages */
242 	caddr_t	pr_wchan;	/* wait addr for sleeping process */
243 	timestruc_t pr_start;	/* process start time, sec+nsec since epoch */
244 	timestruc_t pr_time;	/* usr+sys cpu time for this process */
245 	int	pr_pri;		/* priority, high value is high priority */
246 	char	pr_oldpri;	/* pre-SVR4, low value is high priority */
247 	char	pr_cpu;		/* pre-SVR4, cpu usage for scheduling */
248 	o_dev_t	pr_ottydev;	/* short tty device number */
249 	dev_t	pr_lttydev;	/* controlling tty device (PRNODEV if none) */
250 	char	pr_clname[PRCLSZ];	/* scheduling class name */
251 	char	pr_fname[PRFNSZ];	/* last component of execed pathname */
252 	char	pr_psargs[PRARGSZ];	/* initial characters of arg list */
253 	short	pr_syscall;	/* system call number (if in syscall) */
254 	short	pr_fill;
255 	timestruc_t pr_ctime;	/* usr+sys cpu time for reaped children */
256 	size_t	pr_bysize;	/* size of process image in bytes */
257 	size_t	pr_byrssize;	/* resident set size in bytes */
258 	int	pr_argc;	/* initial argument count */
259 	char	**pr_argv;	/* initial argument vector */
260 	char	**pr_envp;	/* initial environment vector */
261 	int	pr_wstat;	/* if zombie, the wait() status */
262 			/* The following percent numbers are 16-bit binary */
263 			/* fractions [0 .. 1] with the binary point to the */
264 			/* right of the high-order bit (one == 0x8000) */
265 	ushort_t pr_pctcpu;	/* % of recent cpu time, one or all lwps */
266 	ushort_t pr_pctmem;	/* % of of system memory used by the process */
267 	uid_t	pr_euid;	/* effective user id */
268 	gid_t	pr_egid;	/* effective group id */
269 	id_t	pr_aslwpid;	/* historical; now always zero */
270 	char	pr_dmodel;	/* data model of the process */
271 	char	pr_pad[3];
272 	int	pr_filler[6];	/* for future expansion */
273 } prpsinfo_t;
274 
275 #if _STRUCTURED_PROC == 0
276 
277 #if !defined(_STYPES)
278 #define	pr_ttydev	pr_lttydev
279 #else
280 #define	pr_ttydev	pr_ottydev
281 #endif
282 
283 #define	PRNODEV	(dev_t)(-1l)	/* non-existent device */
284 
285 /*
286  * See <sys/procfs_isa.h> for possible values of pr_dmodel.
287  */
288 
289 /* Optional actions to take when process continues */
290 
291 typedef struct prrun {
292 	int	pr_flags;	/* Flags */
293 	sigset_t pr_trace;	/* Set of signals to be traced */
294 	sigset_t pr_sighold;	/* Set of signals to be held */
295 	fltset_t pr_fault;	/* Set of faults to be traced */
296 	caddr_t	pr_vaddr;	/* Virtual address at which to resume */
297 	int	pr_filler[8];	/* Filler area for future expansion */
298 } prrun_t;
299 
300 #define	PRCSIG		0x001	/* Clear current signal */
301 #define	PRCFAULT	0x002	/* Clear current fault */
302 #define	PRSTRACE	0x004	/* Use traced-signal set in pr_trace */
303 #define	PRSHOLD		0x008	/* Use held-signal set in pr_sighold */
304 #define	PRSFAULT	0x010	/* Use traced-fault set in pr_fault */
305 #define	PRSVADDR	0x020	/* Resume at virtual address in pr_vaddr */
306 #define	PRSTEP		0x040	/* Direct the lwp to single-step */
307 #define	PRSABORT	0x080	/* Abort syscall */
308 #define	PRSTOP		0x100	/* Set directed stop request */
309 
310 /* Memory-management interface */
311 
312 typedef struct prmap {
313 	caddr_t		pr_vaddr;	/* Virtual address */
314 	size_t		pr_size;	/* Size of mapping in bytes */
315 	off_t		pr_off;		/* Offset into mapped object, if any */
316 	uint_t		pr_mflags;	/* Protection and attribute flags */
317 	uint_t		pr_pagesize;	/* pagesize (bytes) for this mapping */
318 	long		pr_filler[3];	/* Filler for future expansion */
319 } prmap_t;
320 
321 /* Protection and attribute flags */
322 
323 #define	MA_READ		0x04	/* Readable by the traced process */
324 #define	MA_WRITE	0x02	/* Writable by the traced process */
325 #define	MA_EXEC		0x01	/* Executable by the traced process */
326 #define	MA_SHARED	0x08	/* Changes are shared by mapped object */
327 /*
328  * These are obsolete and unreliable.
329  * They are included here only for historical compatibility.
330  */
331 #define	MA_BREAK	0x10	/* Grown by brk(2) */
332 #define	MA_STACK	0x20	/* Grown automatically on stack faults */
333 
334 /* Process credentials */
335 
336 typedef struct prcred {
337 	uid_t	pr_euid;	/* Effective user id */
338 	uid_t	pr_ruid;	/* Real user id */
339 	uid_t	pr_suid;	/* Saved user id (from exec) */
340 	gid_t	pr_egid;	/* Effective group id */
341 	gid_t	pr_rgid;	/* Real group id */
342 	gid_t	pr_sgid;	/* Saved group id (from exec) */
343 	uint_t	pr_ngroups;	/* Number of supplementary groups */
344 } prcred_t;
345 
346 /* Resource usage */
347 
348 typedef struct prusage {
349 	id_t		pr_lwpid;	/* lwp id.  0: process or defunct */
350 	int		pr_count;	/* number of contributing lwps */
351 	timestruc_t	pr_tstamp;	/* current time stamp */
352 	timestruc_t	pr_create;	/* process/lwp creation time stamp */
353 	timestruc_t	pr_term;	/* process/lwp termination time stamp */
354 	timestruc_t	pr_rtime;	/* total lwp real (elapsed) time */
355 	timestruc_t	pr_utime;	/* user level CPU time */
356 	timestruc_t	pr_stime;	/* system call CPU time */
357 	timestruc_t	pr_ttime;	/* other system trap CPU time */
358 	timestruc_t	pr_tftime;	/* text page fault sleep time */
359 	timestruc_t	pr_dftime;	/* data page fault sleep time */
360 	timestruc_t	pr_kftime;	/* kernel page fault sleep time */
361 	timestruc_t	pr_ltime;	/* user lock wait sleep time */
362 	timestruc_t	pr_slptime;	/* all other sleep time */
363 	timestruc_t	pr_wtime;	/* wait-cpu (latency) time */
364 	timestruc_t	pr_stoptime;	/* stopped time */
365 	timestruc_t	filltime[6];	/* filler for future expansion */
366 	ulong_t		pr_minf;	/* minor page faults */
367 	ulong_t		pr_majf;	/* major page faults */
368 	ulong_t		pr_nswap;	/* swaps */
369 	ulong_t		pr_inblk;	/* input blocks */
370 	ulong_t		pr_oublk;	/* output blocks */
371 	ulong_t		pr_msnd;	/* messages sent */
372 	ulong_t		pr_mrcv;	/* messages received */
373 	ulong_t		pr_sigs;	/* signals received */
374 	ulong_t		pr_vctx;	/* voluntary context switches */
375 	ulong_t		pr_ictx;	/* involuntary context switches */
376 	ulong_t		pr_sysc;	/* system calls */
377 	ulong_t		pr_ioch;	/* chars read and written */
378 	ulong_t		filler[10];	/* filler for future expansion */
379 } prusage_t;
380 
381 /* Page data */
382 
383 /* page data file header */
384 typedef struct prpageheader {
385 	timestruc_t	pr_tstamp;	/* real time stamp */
386 	ulong_t		pr_nmap;	/* number of address space mappings */
387 	ulong_t		pr_npage;	/* total number of pages */
388 } prpageheader_t;
389 
390 /* page data mapping header */
391 typedef struct prasmap {
392 	caddr_t		pr_vaddr;	/* virtual address */
393 	size_t		pr_npage;	/* number of pages in mapping */
394 	off_t		pr_off;		/* offset into mapped object, if any */
395 	uint_t		pr_mflags;	/* protection and attribute flags */
396 	uint_t		pr_pagesize;	/* pagesize (bytes) for this mapping */
397 	long		pr_filler[3];	/* filler for future expansion */
398 } prasmap_t;
399 
400 /*
401  * npage bytes (rounded up to a sizeof (long)-byte boundary) follow
402  * each mapping header, containing zero or more of these flags.
403  */
404 #define	PG_REFERENCED	0x02		/* page referenced since last read */
405 #define	PG_MODIFIED	0x01		/* page modified since last read */
406 #define	PG_HWMAPPED	0x04		/* page is present and mapped */
407 
408 /*
409  * Macros for manipulating sets of flags.
410  * sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
411  * flag must be a member of the enumeration corresponding to *sp.
412  */
413 
414 /* turn on all flags in set */
415 #define	prfillset(sp) \
416 	{ register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
417 		while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0xFFFFFFFF; }
418 
419 /* turn off all flags in set */
420 #define	premptyset(sp) \
421 	{ register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
422 		while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0; }
423 
424 /* turn on specified flag in set */
425 #define	praddset(sp, flag) \
426 	((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
427 	(((uint32_t *)(sp))[((flag)-1)/32] |= (1UL<<(((flag)-1)%32))) : 0))
428 
429 /* turn off specified flag in set */
430 #define	prdelset(sp, flag) \
431 	((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
432 	    (((uint32_t *)(sp))[((flag)-1)/32] &= ~(1UL<<(((flag)-1)%32))) : 0))
433 
434 /* query: != 0 iff flag is turned on in set */
435 #define	prismember(sp, flag) \
436 	(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) && \
437 	    (((uint32_t *)(sp))[((flag)-1)/32] & (1UL<<(((flag)-1)%32))))
438 
439 #endif	/* _STRUCTURED_PROC == 0 */
440 
441 #ifdef _SYSCALL32
442 
443 #if _STRUCTURED_PROC == 0
444 
445 /*
446  * dev32_t version of PRNODEV
447  */
448 #define	PRNODEV32 (dev32_t)(-1)
449 
450 /*
451  * Kernel view of structures used by _ILP32 programs.
452  */
453 
454 #endif	/* _STRUCTURED_PROC == 0 */
455 
456 typedef struct prstatus32 {
457 	int32_t	pr_flags;	/* Flags */
458 	short	pr_why;		/* Reason for process stop (if stopped) */
459 	short	pr_what;	/* More detailed reason */
460 	siginfo32_t pr_info;	/* Info associated with signal or fault */
461 	short	pr_cursig;	/* Current signal */
462 	ushort_t pr_nlwp;	/* Number of lwps in the process */
463 	sigset_t pr_sigpend;	/* Set of signals pending to the process */
464 	sigset_t pr_sighold;	/* Set of signals held (blocked) by the lwp */
465 	struct	sigaltstack32 pr_altstack; /* Alternate signal stack info */
466 	struct	sigaction32 pr_action; /* Signal action for current signal */
467 	pid32_t	pr_pid;		/* Process id */
468 	pid32_t	pr_ppid;	/* Parent process id */
469 	pid32_t	pr_pgrp;	/* Process group id */
470 	pid32_t	pr_sid;		/* Session id */
471 	timestruc32_t pr_utime;	/* Process user cpu time */
472 	timestruc32_t pr_stime;	/* Process system cpu time */
473 	timestruc32_t pr_cutime; /* Sum of children's user times */
474 	timestruc32_t pr_cstime; /* Sum of children's system times */
475 	char	pr_clname[PRCLSZ]; /* Scheduling class name */
476 	short	pr_syscall;	/* System call number (if in syscall) */
477 	short	pr_nsysarg;	/* Number of arguments to this syscall */
478 	int32_t	pr_sysarg[PRSYSARGS]; /* Arguments to this syscall */
479 	id32_t	pr_who;		/* Specific lwp identifier */
480 	sigset_t pr_lwppend;	/* Set of signals pending to the lwp */
481 	caddr32_t pr_oldcontext; /* Address of previous ucontext */
482 	caddr32_t pr_brkbase;	/* Address of the process heap */
483 	size32_t pr_brksize;	/* Size of the process heap, in bytes */
484 	caddr32_t pr_stkbase;	/* Address of the process stack */
485 	size32_t pr_stksize;	/* Size of the process stack, in bytes */
486 	short	pr_processor;	/* processor which last ran this LWP */
487 	short	pr_bind;	/* processor LWP bound to or PBIND_NONE */
488 	int32_t	pr_instr;	/* Current instruction */
489 	prgregset32_t pr_reg;	/* General registers */
490 } prstatus32_t;
491 
492 typedef struct prpsinfo32 {
493 	char	pr_state;	/* numeric process state (see pr_sname) */
494 	char	pr_sname;	/* printable character representing pr_state */
495 	char	pr_zomb;	/* !=0: process terminated but not waited for */
496 	char	pr_nice;	/* nice for cpu usage */
497 	uint32_t pr_flag;	/* process flags */
498 	uid32_t	pr_uid;		/* real user id */
499 	gid32_t	pr_gid;		/* real group id */
500 	pid32_t	pr_pid;		/* unique process id */
501 	pid32_t	pr_ppid;	/* process id of parent */
502 	pid32_t	pr_pgrp;	/* pid of process group leader */
503 	pid32_t	pr_sid;		/* session id */
504 	caddr32_t pr_addr;	/* physical address of process */
505 	size32_t pr_size;	/* size of process image in pages */
506 	size32_t pr_rssize;	/* resident set size in pages */
507 	caddr32_t pr_wchan;	/* wait addr for sleeping process */
508 	timestruc32_t pr_start;	/* process start time, sec+nsec since epoch */
509 	timestruc32_t pr_time;	/* usr+sys cpu time for this process */
510 	int32_t	pr_pri;		/* priority, high value is high priority */
511 	char	pr_oldpri;	/* pre-SVR4, low value is high priority */
512 	char	pr_cpu;		/* pre-SVR4, cpu usage for scheduling */
513 	o_dev_t	pr_ottydev;	/* short tty device number */
514 	dev32_t	pr_lttydev;	/* controlling tty device (PRNODEV if none) */
515 	char	pr_clname[PRCLSZ];	/* scheduling class name */
516 	char	pr_fname[PRFNSZ];	/* last component of execed pathname */
517 	char	pr_psargs[PRARGSZ];	/* initial characters of arg list */
518 	short	pr_syscall;	/* system call number (if in syscall) */
519 	short	pr_fill;
520 	timestruc32_t pr_ctime;	/* usr+sys cpu time for reaped children */
521 	size32_t pr_bysize;	/* size of process image in bytes */
522 	size32_t pr_byrssize;	/* resident set size in bytes */
523 	int	pr_argc;	/* initial argument count */
524 	caddr32_t pr_argv;	/* initial argument vector */
525 	caddr32_t pr_envp;	/* initial environment vector */
526 	int	pr_wstat;	/* if zombie, the wait() status */
527 	ushort_t pr_pctcpu;	/* % of recent cpu time, one or all lwps */
528 	ushort_t pr_pctmem;	/* % of of system memory used by the process */
529 	uid32_t	pr_euid;	/* effective user id */
530 	gid32_t	pr_egid;	/* effective group id */
531 	id32_t	pr_aslwpid;	/* historical; now always zero */
532 	char	pr_dmodel;	/* data model of the process */
533 	char	pr_pad[3];
534 	int32_t	pr_filler[6];	/* for future expansion */
535 } prpsinfo32_t;
536 
537 #if _STRUCTURED_PROC == 0
538 
539 typedef struct prrun32 {
540 	int32_t	pr_flags;	/* Flags */
541 	sigset_t pr_trace;	/* Set of signals to be traced */
542 	sigset_t pr_sighold;	/* Set of signals to be held */
543 	fltset_t pr_fault;	/* Set of faults to be traced */
544 	caddr32_t pr_vaddr;	/* Virtual address at which to resume */
545 	int32_t	pr_filler[8];	/* Filler area for future expansion */
546 } prrun32_t;
547 
548 typedef struct ioc_prmap32 {
549 	caddr32_t	pr_vaddr;	/* Virtual address */
550 	size32_t	pr_size;	/* Size of mapping in bytes */
551 	off32_t		pr_off;		/* Offset into mapped object, if any */
552 	uint32_t	pr_mflags;	/* Protection and attribute flags */
553 	uint32_t	pr_pagesize;	/* pagesize (bytes) for this mapping */
554 	int32_t		pr_filler[3];	/* Filler for future expansion */
555 } ioc_prmap32_t;
556 
557 typedef struct prusage32 {
558 	id32_t		pr_lwpid;	/* lwp id.  0: process or defunct */
559 	int32_t		pr_count;	/* number of contributing lwps */
560 	timestruc32_t	pr_tstamp;	/* current time stamp */
561 	timestruc32_t	pr_create;	/* process/lwp creation time stamp */
562 	timestruc32_t	pr_term;	/* process/lwp termination time stamp */
563 	timestruc32_t	pr_rtime;	/* total lwp real (elapsed) time */
564 	timestruc32_t	pr_utime;	/* user level cpu time */
565 	timestruc32_t	pr_stime;	/* system call cpu time */
566 	timestruc32_t	pr_ttime;	/* other system trap cpu time */
567 	timestruc32_t	pr_tftime;	/* text page fault sleep time */
568 	timestruc32_t	pr_dftime;	/* data page fault sleep time */
569 	timestruc32_t	pr_kftime;	/* kernel page fault sleep time */
570 	timestruc32_t	pr_ltime;	/* user lock wait sleep time */
571 	timestruc32_t	pr_slptime;	/* all other sleep time */
572 	timestruc32_t	pr_wtime;	/* wait-cpu (latency) time */
573 	timestruc32_t	pr_stoptime;	/* stopped time */
574 	timestruc32_t	filltime[6];	/* filler for future expansion */
575 	uint32_t	pr_minf;	/* minor page faults */
576 	uint32_t	pr_majf;	/* major page faults */
577 	uint32_t	pr_nswap;	/* swaps */
578 	uint32_t	pr_inblk;	/* input blocks */
579 	uint32_t	pr_oublk;	/* output blocks */
580 	uint32_t	pr_msnd;	/* messages sent */
581 	uint32_t	pr_mrcv;	/* messages received */
582 	uint32_t	pr_sigs;	/* signals received */
583 	uint32_t	pr_vctx;	/* voluntary context switches */
584 	uint32_t	pr_ictx;	/* involuntary context switches */
585 	uint32_t	pr_sysc;	/* system calls */
586 	uint32_t	pr_ioch;	/* chars read and written */
587 	uint32_t	filler[10];	/* filler for future expansion */
588 } prusage32_t;
589 
590 typedef struct ioc_prpageheader32 {
591 	timestruc32_t	pr_tstamp;	/* real time stamp */
592 	uint32_t	pr_nmap;	/* number of address space mappings */
593 	uint32_t	pr_npage;	/* total number of pages */
594 } ioc_prpageheader32_t;
595 
596 typedef struct ioc_prasmap32 {
597 	caddr32_t	pr_vaddr;	/* virtual address */
598 	size32_t	pr_npage;	/* number of pages in mapping */
599 	off32_t		pr_off;		/* offset into mapped object, if any */
600 	uint32_t	pr_mflags;	/* protection and attribute flags */
601 	uint32_t	pr_pagesize;	/* pagesize (bytes) for this mapping */
602 	int32_t		pr_filler[3];	/* filler for future expansion */
603 } ioc_prasmap32_t;
604 
605 #endif	/* _STRUCTURED_PROC == 0 */
606 
607 #endif	/* _SYSCALL32 */
608 
609 #ifdef	__cplusplus
610 }
611 #endif
612 
613 #endif	/* _SYS_OLD_PROCFS_H */
614