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