Print this page
12046 Provide /proc/<PID>/fdinfo/
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/procfs.h
+++ new/usr/src/uts/common/sys/procfs.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26 /*
27 27 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
28 28 * Copyright 2018 Joyent, Inc.
29 + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
29 30 */
30 31
31 32 #ifndef _SYS_PROCFS_H
32 33 #define _SYS_PROCFS_H
33 34
34 35 #ifdef __cplusplus
35 36 extern "C" {
36 37 #endif
37 38
38 39 /*
39 40 * This definition is temporary. Structured proc is the preferred API,
40 41 * and the older ioctl-based interface will be removed in a future version
41 42 * of Solaris. Until then, by default, including <sys/procfs.h> will
42 43 * provide the older ioctl-based /proc definitions. To get the structured
43 44 * /proc definitions, either include <procfs.h> or define _STRUCTURED_PROC
44 45 * to be 1 before including <sys/procfs.h>.
45 46 */
46 47 #ifndef _STRUCTURED_PROC
47 48 #define _STRUCTURED_PROC 0
48 49 #endif
49 50
50 51 #if !defined(_KERNEL) && _STRUCTURED_PROC == 0
51 52
52 53 #include <sys/old_procfs.h>
53 54
54 55 #else /* !defined(_KERNEL) && _STRUCTURED_PROC == 0 */
55 56
56 57 #include <sys/feature_tests.h>
57 58 #include <sys/types.h>
58 59 #include <sys/time_impl.h>
59 60 #include <sys/signal.h>
60 61 #include <sys/siginfo.h>
61 62 #include <sys/fault.h>
62 63 #include <sys/syscall.h>
63 64 #include <sys/pset.h>
64 65 #include <sys/procfs_isa.h>
65 66 #include <sys/priv.h>
66 67 #include <sys/stat.h>
67 68 #include <sys/param.h>
68 69 #include <sys/secflags.h>
69 70 #include <sys/thread.h>
70 71
71 72 /*
72 73 * System call interfaces for /proc.
73 74 */
74 75
75 76 /*
76 77 * Control codes (long values) for messages written to ctl and lwpctl files.
77 78 */
78 79 #define PCNULL 0L /* null request, advance to next message */
79 80 #define PCSTOP 1L /* direct process or lwp to stop and wait for stop */
80 81 #define PCDSTOP 2L /* direct process or lwp to stop */
81 82 #define PCWSTOP 3L /* wait for process or lwp to stop, no timeout */
82 83 #define PCTWSTOP 4L /* wait for stop, with long millisecond timeout arg */
83 84 #define PCRUN 5L /* make process/lwp runnable, w/ long flags argument */
84 85 #define PCCSIG 6L /* clear current signal from lwp */
85 86 #define PCCFAULT 7L /* clear current fault from lwp */
86 87 #define PCSSIG 8L /* set current signal from siginfo_t argument */
87 88 #define PCKILL 9L /* post a signal to process/lwp, long argument */
88 89 #define PCUNKILL 10L /* delete a pending signal from process/lwp, long arg */
89 90 #define PCSHOLD 11L /* set lwp signal mask from sigset_t argument */
90 91 #define PCSTRACE 12L /* set traced signal set from sigset_t argument */
91 92 #define PCSFAULT 13L /* set traced fault set from fltset_t argument */
92 93 #define PCSENTRY 14L /* set traced syscall entry set from sysset_t arg */
93 94 #define PCSEXIT 15L /* set traced syscall exit set from sysset_t arg */
94 95 #define PCSET 16L /* set modes from long argument */
95 96 #define PCUNSET 17L /* unset modes from long argument */
96 97 #define PCSREG 18L /* set lwp general registers from prgregset_t arg */
97 98 #define PCSFPREG 19L /* set lwp floating-point registers from prfpregset_t */
98 99 #define PCSXREG 20L /* set lwp extra registers from prxregset_t arg */
99 100 #define PCNICE 21L /* set nice priority from long argument */
100 101 #define PCSVADDR 22L /* set %pc virtual address from long argument */
101 102 #define PCWATCH 23L /* set/unset watched memory area from prwatch_t arg */
102 103 #define PCAGENT 24L /* create agent lwp with regs from prgregset_t arg */
103 104 #define PCREAD 25L /* read from the address space via priovec_t arg */
104 105 #define PCWRITE 26L /* write to the address space via priovec_t arg */
105 106 #define PCSCRED 27L /* set process credentials from prcred_t argument */
106 107 #define PCSASRS 28L /* set ancillary state registers from asrset_t arg */
107 108 #define PCSPRIV 29L /* set process privileges from prpriv_t argument */
108 109 #define PCSZONE 30L /* set zoneid from zoneid_t argument */
109 110 #define PCSCREDX 31L /* as PCSCRED but with supplemental groups */
110 111 /*
111 112 * PCRUN long operand flags.
112 113 */
113 114 #define PRCSIG 0x01 /* clear current signal, if any */
114 115 #define PRCFAULT 0x02 /* clear current fault, if any */
115 116 #define PRSTEP 0x04 /* direct the lwp to single-step */
116 117 #define PRSABORT 0x08 /* abort syscall, if in syscall */
117 118 #define PRSTOP 0x10 /* set directed stop request */
118 119
119 120 /*
120 121 * lwp status file. /proc/<pid>/lwp/<lwpid>/lwpstatus
121 122 */
122 123 #define PRCLSZ 8 /* maximum size of scheduling class name */
123 124 #define PRSYSARGS 8 /* maximum number of syscall arguments */
124 125 typedef struct lwpstatus {
125 126 int pr_flags; /* flags (see below) */
126 127 id_t pr_lwpid; /* specific lwp identifier */
127 128 short pr_why; /* reason for lwp stop, if stopped */
128 129 short pr_what; /* more detailed reason */
129 130 short pr_cursig; /* current signal, if any */
130 131 short pr_pad1;
131 132 siginfo_t pr_info; /* info associated with signal or fault */
132 133 sigset_t pr_lwppend; /* set of signals pending to the lwp */
133 134 sigset_t pr_lwphold; /* set of signals blocked by the lwp */
134 135 struct sigaction pr_action; /* signal action for current signal */
135 136 stack_t pr_altstack; /* alternate signal stack info */
136 137 uintptr_t pr_oldcontext; /* address of previous ucontext */
137 138 short pr_syscall; /* system call number (if in syscall) */
138 139 short pr_nsysarg; /* number of arguments to this syscall */
139 140 int pr_errno; /* errno for failed syscall, 0 if successful */
140 141 long pr_sysarg[PRSYSARGS]; /* arguments to this syscall */
141 142 long pr_rval1; /* primary syscall return value */
142 143 long pr_rval2; /* second syscall return value, if any */
143 144 char pr_clname[PRCLSZ]; /* scheduling class name */
144 145 timestruc_t pr_tstamp; /* real-time time stamp of stop */
145 146 timestruc_t pr_utime; /* lwp user cpu time */
146 147 timestruc_t pr_stime; /* lwp system cpu time */
147 148 int pr_filler[11 - 2 * sizeof (timestruc_t) / sizeof (int)];
148 149 int pr_errpriv; /* missing privilege */
149 150 uintptr_t pr_ustack; /* address of stack boundary data (stack_t) */
150 151 ulong_t pr_instr; /* current instruction */
151 152 prgregset_t pr_reg; /* general registers */
152 153 prfpregset_t pr_fpreg; /* floating-point registers */
153 154 } lwpstatus_t;
154 155
155 156 /*
156 157 * process status file. /proc/<pid>/status
157 158 */
158 159 typedef struct pstatus {
159 160 int pr_flags; /* flags (see below) */
160 161 int pr_nlwp; /* number of active lwps in the process */
161 162 pid_t pr_pid; /* process id */
162 163 pid_t pr_ppid; /* parent process id */
163 164 pid_t pr_pgid; /* process group id */
164 165 pid_t pr_sid; /* session id */
165 166 id_t pr_aslwpid; /* historical; now always zero */
166 167 id_t pr_agentid; /* lwp id of the /proc agent lwp, if any */
167 168 sigset_t pr_sigpend; /* set of process pending signals */
168 169 uintptr_t pr_brkbase; /* address of the process heap */
169 170 size_t pr_brksize; /* size of the process heap, in bytes */
170 171 uintptr_t pr_stkbase; /* address of the process stack */
171 172 size_t pr_stksize; /* size of the process stack, in bytes */
172 173 timestruc_t pr_utime; /* process user cpu time */
173 174 timestruc_t pr_stime; /* process system cpu time */
174 175 timestruc_t pr_cutime; /* sum of children's user times */
175 176 timestruc_t pr_cstime; /* sum of children's system times */
176 177 sigset_t pr_sigtrace; /* set of traced signals */
177 178 fltset_t pr_flttrace; /* set of traced faults */
178 179 sysset_t pr_sysentry; /* set of system calls traced on entry */
179 180 sysset_t pr_sysexit; /* set of system calls traced on exit */
180 181 char pr_dmodel; /* data model of the process (see below) */
181 182 char pr_pad[3];
182 183 taskid_t pr_taskid; /* task id */
183 184 projid_t pr_projid; /* project id */
184 185 int pr_nzomb; /* number of zombie lwps in the process */
185 186 zoneid_t pr_zoneid; /* zone id */
186 187 int pr_filler[15]; /* reserved for future use */
187 188 lwpstatus_t pr_lwp; /* status of the representative lwp */
188 189 } pstatus_t;
189 190
190 191 /*
191 192 * pr_flags (same values appear in both pstatus_t and lwpstatus_t pr_flags).
192 193 *
193 194 * These flags do *not* apply to psinfo_t.pr_flag or lwpsinfo_t.pr_flag
194 195 * (which are both deprecated).
195 196 */
196 197 /* The following flags apply to the specific or representative lwp */
197 198 #define PR_STOPPED 0x00000001 /* lwp is stopped */
198 199 #define PR_ISTOP 0x00000002 /* lwp is stopped on an event of interest */
199 200 #define PR_DSTOP 0x00000004 /* lwp has a stop directive in effect */
200 201 #define PR_STEP 0x00000008 /* lwp has a single-step directive in effect */
201 202 #define PR_ASLEEP 0x00000010 /* lwp is sleeping in a system call */
202 203 #define PR_PCINVAL 0x00000020 /* contents of pr_instr undefined */
203 204 #define PR_ASLWP 0x00000040 /* obsolete flag; never set */
204 205 #define PR_AGENT 0x00000080 /* this lwp is the /proc agent lwp */
205 206 #define PR_DETACH 0x00000100 /* this is a detached lwp */
206 207 #define PR_DAEMON 0x00000200 /* this is a daemon lwp */
207 208 #define PR_IDLE 0x00000400 /* lwp is a cpu's idle thread */
208 209 /* The following flags apply to the process, not to an individual lwp */
209 210 #define PR_ISSYS 0x00001000 /* this is a system process */
210 211 #define PR_VFORKP 0x00002000 /* process is the parent of a vfork()d child */
211 212 #define PR_ORPHAN 0x00004000 /* process's process group is orphaned */
212 213 #define PR_NOSIGCHLD 0x00008000 /* process will not generate SIGCHLD on exit */
213 214 #define PR_WAITPID 0x00010000 /* only waitid(P_PID, pid) can reap the child */
214 215 /* The following process flags are modes settable by PCSET/PCUNSET */
215 216 #define PR_FORK 0x00100000 /* inherit-on-fork is in effect */
216 217 #define PR_RLC 0x00200000 /* run-on-last-close is in effect */
217 218 #define PR_KLC 0x00400000 /* kill-on-last-close is in effect */
218 219 #define PR_ASYNC 0x00800000 /* asynchronous-stop is in effect */
219 220 #define PR_MSACCT 0x01000000 /* micro-state usage accounting is in effect */
220 221 #define PR_BPTADJ 0x02000000 /* breakpoint trap pc adjustment is in effect */
221 222 #define PR_PTRACE 0x04000000 /* ptrace-compatibility mode is in effect */
222 223 #define PR_MSFORK 0x08000000 /* micro-state accounting inherited on fork */
223 224
224 225 /*
225 226 * See <sys/procfs_isa.h> for possible values of pr_dmodel.
226 227 */
227 228
228 229 /*
229 230 * Reasons for stopping (pr_why).
230 231 */
231 232 #define PR_REQUESTED 1
232 233 #define PR_SIGNALLED 2
233 234 #define PR_SYSENTRY 3
234 235 #define PR_SYSEXIT 4
235 236 #define PR_JOBCONTROL 5
236 237 #define PR_FAULTED 6
237 238 #define PR_SUSPENDED 7
238 239 #define PR_CHECKPOINT 8
239 240
240 241 /*
241 242 * lwp ps(1) information file. /proc/<pid>/lwp/<lwpid>/lwpsinfo
242 243 */
243 244 #define PRFNSZ 16 /* Maximum size of execed filename */
244 245 typedef struct lwpsinfo {
245 246 int pr_flag; /* lwp flags (DEPRECATED; do not use) */
246 247 id_t pr_lwpid; /* lwp id */
247 248 uintptr_t pr_addr; /* internal address of lwp */
248 249 uintptr_t pr_wchan; /* wait addr for sleeping lwp */
249 250 char pr_stype; /* synchronization event type */
250 251 char pr_state; /* numeric lwp state */
251 252 char pr_sname; /* printable character for pr_state */
252 253 char pr_nice; /* nice for cpu usage */
253 254 short pr_syscall; /* system call number (if in syscall) */
254 255 char pr_oldpri; /* pre-SVR4, low value is high priority */
255 256 char pr_cpu; /* pre-SVR4, cpu usage for scheduling */
256 257 int pr_pri; /* priority, high value is high priority */
257 258 /* The following percent number is a 16-bit binary */
258 259 /* fraction [0 .. 1] with the binary point to the */
259 260 /* right of the high-order bit (1.0 == 0x8000) */
260 261 ushort_t pr_pctcpu; /* % of recent cpu time used by this lwp */
261 262 ushort_t pr_pad;
262 263 timestruc_t pr_start; /* lwp start time, from the epoch */
263 264 timestruc_t pr_time; /* usr+sys cpu time for this lwp */
264 265 char pr_clname[PRCLSZ]; /* scheduling class name */
265 266 char pr_name[PRFNSZ]; /* name of system lwp */
266 267 processorid_t pr_onpro; /* processor which last ran this lwp */
267 268 processorid_t pr_bindpro; /* processor to which lwp is bound */
268 269 psetid_t pr_bindpset; /* processor set to which lwp is bound */
269 270 int pr_lgrp; /* lwp home lgroup */
270 271 int pr_filler[4]; /* reserved for future use */
271 272 } lwpsinfo_t;
272 273
273 274 /*
274 275 * process ps(1) information file. /proc/<pid>/psinfo
275 276 */
276 277 #define PRARGSZ 80 /* number of chars of arguments */
277 278 typedef struct psinfo {
278 279 int pr_flag; /* process flags (DEPRECATED; do not use) */
279 280 int pr_nlwp; /* number of active lwps in the process */
280 281 pid_t pr_pid; /* unique process id */
281 282 pid_t pr_ppid; /* process id of parent */
282 283 pid_t pr_pgid; /* pid of process group leader */
283 284 pid_t pr_sid; /* session id */
284 285 uid_t pr_uid; /* real user id */
285 286 uid_t pr_euid; /* effective user id */
286 287 gid_t pr_gid; /* real group id */
287 288 gid_t pr_egid; /* effective group id */
288 289 uintptr_t pr_addr; /* address of process */
289 290 size_t pr_size; /* size of process image in Kbytes */
290 291 size_t pr_rssize; /* resident set size in Kbytes */
291 292 size_t pr_pad1;
292 293 dev_t pr_ttydev; /* controlling tty device (or PRNODEV) */
293 294 /* The following percent numbers are 16-bit binary */
294 295 /* fractions [0 .. 1] with the binary point to the */
295 296 /* right of the high-order bit (1.0 == 0x8000) */
296 297 ushort_t pr_pctcpu; /* % of recent cpu time used by all lwps */
297 298 ushort_t pr_pctmem; /* % of system memory used by process */
298 299 timestruc_t pr_start; /* process start time, from the epoch */
299 300 timestruc_t pr_time; /* usr+sys cpu time for this process */
300 301 timestruc_t pr_ctime; /* usr+sys cpu time for reaped children */
301 302 char pr_fname[PRFNSZ]; /* name of execed file */
302 303 char pr_psargs[PRARGSZ]; /* initial characters of arg list */
303 304 int pr_wstat; /* if zombie, the wait() status */
304 305 int pr_argc; /* initial argument count */
305 306 uintptr_t pr_argv; /* address of initial argument vector */
306 307 uintptr_t pr_envp; /* address of initial environment vector */
307 308 char pr_dmodel; /* data model of the process */
308 309 char pr_pad2[3];
309 310 taskid_t pr_taskid; /* task id */
310 311 projid_t pr_projid; /* project id */
311 312 int pr_nzomb; /* number of zombie lwps in the process */
312 313 poolid_t pr_poolid; /* pool id */
313 314 zoneid_t pr_zoneid; /* zone id */
314 315 id_t pr_contract; /* process contract */
315 316 int pr_filler[1]; /* reserved for future use */
316 317 lwpsinfo_t pr_lwp; /* information for representative lwp */
317 318 } psinfo_t;
318 319
319 320 #define PRNODEV (dev_t)(-1) /* non-existent device */
320 321
321 322 /*
322 323 * Memory-map interface. /proc/<pid>/map /proc/<pid>/rmap
323 324 */
324 325 #define PRMAPSZ 64
325 326 typedef struct prmap {
326 327 uintptr_t pr_vaddr; /* virtual address of mapping */
327 328 size_t pr_size; /* size of mapping in bytes */
328 329 char pr_mapname[PRMAPSZ]; /* name in /proc/<pid>/object */
329 330 offset_t pr_offset; /* offset into mapped object, if any */
330 331 int pr_mflags; /* protection and attribute flags (see below) */
331 332 int pr_pagesize; /* pagesize (bytes) for this mapping */
332 333 int pr_shmid; /* SysV shmid, -1 if not SysV shared memory */
333 334 int pr_filler[1]; /* filler for future expansion */
334 335 } prmap_t;
335 336
336 337 /*
337 338 * HAT memory-map interface. /proc/<pid>/xmap
338 339 */
339 340 typedef struct prxmap {
340 341 uintptr_t pr_vaddr; /* virtual address of mapping */
341 342 size_t pr_size; /* size of mapping in bytes */
342 343 char pr_mapname[PRMAPSZ]; /* name in /proc/<pid>/object */
343 344 offset_t pr_offset; /* offset into mapped object, if any */
344 345 int pr_mflags; /* protection and attribute flags (see below) */
345 346 int pr_pagesize; /* pagesize (bytes) for this mapping */
346 347 int pr_shmid; /* SysV shmid, -1 if not SysV shared memory */
347 348 dev_t pr_dev; /* st_dev from stat64() of mapped object, or PRNODEV */
348 349 uint64_t pr_ino; /* st_ino from stat64() of mapped object, if any */
349 350 size_t pr_rss; /* pages of resident memory */
350 351 size_t pr_anon; /* pages of resident anonymous memory */
351 352 size_t pr_locked; /* pages of locked memory */
352 353 size_t pr_pad; /* currently unused */
353 354 uint64_t pr_hatpagesize; /* pagesize of the hat mapping */
354 355 #ifdef _ILP32
355 356 ulong_t pr_filler[6]; /* filler for future expansion */
356 357 #else
357 358 ulong_t pr_filler[7]; /* filler for future expansion */
358 359 #endif
359 360 } prxmap_t;
360 361
361 362
362 363 /* Protection and attribute flags */
363 364 #define MA_READ 0x04 /* readable by the traced process */
364 365 #define MA_WRITE 0x02 /* writable by the traced process */
365 366 #define MA_EXEC 0x01 /* executable by the traced process */
366 367 #define MA_SHARED 0x08 /* changes are shared by mapped object */
367 368 #define MA_ANON 0x40 /* anonymous memory (e.g. /dev/zero) */
368 369 #define MA_ISM 0x80 /* intimate shared mem (shared MMU resources) */
369 370 #define MA_NORESERVE 0x100 /* mapped with MAP_NORESERVE */
370 371 #define MA_SHM 0x200 /* System V shared memory */
371 372 #define MA_RESERVED1 0x400 /* reserved for future use */
372 373
373 374 /*
374 375 * These are obsolete and unreliable.
375 376 * They are included here only for historical compatibility.
376 377 */
377 378 #define MA_BREAK 0x10 /* grown by brk(2) */
378 379 #define MA_STACK 0x20 /* grown automatically on stack faults */
379 380
380 381 /*
381 382 * Process credentials. PCSCRED and /proc/<pid>/cred
382 383 */
383 384 typedef struct prcred {
384 385 uid_t pr_euid; /* effective user id */
385 386 uid_t pr_ruid; /* real user id */
386 387 uid_t pr_suid; /* saved user id (from exec) */
387 388 gid_t pr_egid; /* effective group id */
388 389 gid_t pr_rgid; /* real group id */
389 390 gid_t pr_sgid; /* saved group id (from exec) */
390 391 int pr_ngroups; /* number of supplementary groups */
391 392 gid_t pr_groups[1]; /* array of supplementary groups */
392 393 } prcred_t;
393 394
394 395 /*
395 396 * Process privileges. PCSPRIV and /proc/<pid>/priv
396 397 */
397 398 typedef struct prpriv {
398 399 uint32_t pr_nsets; /* number of privilege set */
399 400 uint32_t pr_setsize; /* size of privilege set */
400 401 uint32_t pr_infosize; /* size of supplementary data */
401 402 priv_chunk_t pr_sets[1]; /* array of sets */
402 403 } prpriv_t;
403 404
404 405 #define PRSECFLAGS_VERSION_1 1
405 406 #define PRSECFLAGS_VERSION_CURRENT PRSECFLAGS_VERSION_1
406 407 typedef struct prsecflags {
407 408 uint32_t pr_version;
408 409 char pr_pad[4];
409 410 secflagset_t pr_effective;
410 411 secflagset_t pr_inherit;
411 412 secflagset_t pr_lower;
412 413 secflagset_t pr_upper;
413 414 } prsecflags_t;
414 415
415 416 /*
416 417 * Watchpoint interface. PCWATCH and /proc/<pid>/watch
417 418 */
418 419 typedef struct prwatch {
419 420 uintptr_t pr_vaddr; /* virtual address of watched area */
420 421 size_t pr_size; /* size of watched area in bytes */
421 422 int pr_wflags; /* watch type flags */
422 423 int pr_pad;
423 424 } prwatch_t;
424 425
425 426 /* pr_wflags */
426 427 #define WA_READ 0x04 /* trap on read access */
427 428 #define WA_WRITE 0x02 /* trap on write access */
428 429 #define WA_EXEC 0x01 /* trap on execute access */
429 430 #define WA_TRAPAFTER 0x08 /* trap after instruction completes */
430 431
431 432 /*
432 433 * PCREAD/PCWRITE I/O interface.
433 434 */
434 435 typedef struct priovec {
435 436 void *pio_base; /* buffer in controlling process */
436 437 size_t pio_len; /* size of read/write request */
437 438 off_t pio_offset; /* virtual address in target process */
438 439 } priovec_t;
439 440
440 441 /*
441 442 * Resource usage. /proc/<pid>/usage /proc/<pid>/lwp/<lwpid>/lwpusage
442 443 */
443 444 typedef struct prusage {
444 445 id_t pr_lwpid; /* lwp id. 0: process or defunct */
445 446 int pr_count; /* number of contributing lwps */
446 447 timestruc_t pr_tstamp; /* current time stamp */
447 448 timestruc_t pr_create; /* process/lwp creation time stamp */
448 449 timestruc_t pr_term; /* process/lwp termination time stamp */
449 450 timestruc_t pr_rtime; /* total lwp real (elapsed) time */
450 451 timestruc_t pr_utime; /* user level cpu time */
451 452 timestruc_t pr_stime; /* system call cpu time */
452 453 timestruc_t pr_ttime; /* other system trap cpu time */
453 454 timestruc_t pr_tftime; /* text page fault sleep time */
454 455 timestruc_t pr_dftime; /* data page fault sleep time */
455 456 timestruc_t pr_kftime; /* kernel page fault sleep time */
456 457 timestruc_t pr_ltime; /* user lock wait sleep time */
457 458 timestruc_t pr_slptime; /* all other sleep time */
458 459 timestruc_t pr_wtime; /* wait-cpu (latency) time */
459 460 timestruc_t pr_stoptime; /* stopped time */
460 461 timestruc_t filltime[6]; /* filler for future expansion */
461 462 ulong_t pr_minf; /* minor page faults */
462 463 ulong_t pr_majf; /* major page faults */
463 464 ulong_t pr_nswap; /* swaps */
464 465 ulong_t pr_inblk; /* input blocks */
465 466 ulong_t pr_oublk; /* output blocks */
466 467 ulong_t pr_msnd; /* messages sent */
467 468 ulong_t pr_mrcv; /* messages received */
468 469 ulong_t pr_sigs; /* signals received */
469 470 ulong_t pr_vctx; /* voluntary context switches */
470 471 ulong_t pr_ictx; /* involuntary context switches */
471 472 ulong_t pr_sysc; /* system calls */
472 473 ulong_t pr_ioch; /* chars read and written */
473 474 ulong_t filler[10]; /* filler for future expansion */
474 475 } prusage_t;
475 476
476 477 /*
477 478 * Page data file. /proc/<pid>/pagedata
478 479 */
479 480
480 481 /* page data file header */
481 482 typedef struct prpageheader {
482 483 timestruc_t pr_tstamp; /* real time stamp */
483 484 long pr_nmap; /* number of address space mappings */
484 485 long pr_npage; /* total number of pages */
485 486 } prpageheader_t;
486 487
487 488 /* page data mapping header */
488 489 typedef struct prasmap {
489 490 uintptr_t pr_vaddr; /* virtual address of mapping */
490 491 size_t pr_npage; /* number of pages in mapping */
491 492 char pr_mapname[PRMAPSZ]; /* name in /proc/<pid>/object */
492 493 offset_t pr_offset; /* offset into mapped object, if any */
493 494 int pr_mflags; /* protection and attribute flags */
494 495 int pr_pagesize; /* pagesize (bytes) for this mapping */
495 496 int pr_shmid; /* SysV shmid, -1 if not SysV shared memory */
496 497 int pr_filler[1]; /* filler for future expansion */
497 498 } prasmap_t;
498 499
499 500 /*
500 501 * pr_npage bytes (plus 0-7 null bytes to round up to an 8-byte boundary)
501 502 * follow each mapping header, each containing zero or more of these flags.
502 503 */
503 504 #define PG_REFERENCED 0x02 /* page referenced since last read */
504 505 #define PG_MODIFIED 0x01 /* page modified since last read */
505 506 #define PG_HWMAPPED 0x04 /* page is present and mapped */
↓ open down ↓ |
467 lines elided |
↑ open up ↑ |
506 507
507 508 /*
508 509 * Open files. Only in core files (for now). Note that we'd like to use
509 510 * the stat or stat64 structure, but both of these structures are unfortunately
510 511 * not consistent between 32 and 64 bit modes. To keep our lives simpler, we
511 512 * just define our own structure with types that are not sensitive to this
512 513 * difference. Also, it turns out that pfiles omits a lot of info from the
513 514 * struct stat (e.g. times, device sizes, etc.) so we don't bother adding those
514 515 * here.
515 516 */
516 -typedef struct prfdinfo {
517 +typedef struct prfdinfov1 {
517 518 int pr_fd;
518 519 mode_t pr_mode;
519 520
520 521 uid_t pr_uid;
521 522 gid_t pr_gid;
522 523
523 524 major_t pr_major; /* think stat.st_dev */
524 525 minor_t pr_minor;
525 526
526 527 major_t pr_rmajor; /* think stat.st_rdev */
527 528 minor_t pr_rminor;
528 529
529 530 ino64_t pr_ino;
530 531 off64_t pr_offset;
531 532 off64_t pr_size;
532 533
533 534 int pr_fileflags; /* fcntl(F_GETXFL), etc */
534 535 int pr_fdflags; /* fcntl(F_GETFD), etc. */
535 536
536 537 char pr_path[MAXPATHLEN];
537 -} prfdinfo_t;
538 +} prfdinfov1_t;
538 539
540 +typedef prfdinfov1_t prfdinfo_t;
541 +
542 +typedef struct prfdinfov2 {
543 + int pr_fd; /* file descriptor number */
544 + mode_t pr_mode; /* (see st_mode in stat(2)) */
545 + ino64_t pr_ino; /* inode number */
546 + off64_t pr_size; /* file size */
547 + off64_t pr_offset; /* current offset of file descriptor */
548 + uid_t pr_uid; /* owner's user id */
549 + gid_t pr_gid; /* owner's group id */
550 + major_t pr_major; /* major number of device */
551 + minor_t pr_minor; /* minor number of device */
552 + major_t pr_rmajor; /* major number (if special file) */
553 + minor_t pr_rminor; /* minor number (if special file) */
554 + int pr_fileflags; /* (see F_GETXFL in fcntl(2)) */
555 + int pr_fdflags; /* (see F_GETFD in fcntl(2)) */
556 + short pr_locktype; /* (see F_GETLK in fcntl(2)) */
557 + pid_t pr_lockpid; /* process holding file lock */
558 + /* (see F_GETLK) */
559 + int pr_locksysid; /* sysid of locking process */
560 + /* (see F_GETLK) */
561 + pid_t pr_peerpid; /* peer process (socket, door) */
562 + int pr_filler[25]; /* reserved for future use */
563 + char pr_peername[PRFNSZ]; /* peer process name */
564 +#if __STDC_VERSION__ >= 199901L
565 + char pr_misc[]; /* self describing structures */
566 +#else
567 + char pr_misc[1];
568 +#endif
569 +} prfdinfov2_t;
570 +
571 +typedef struct pr_misc_header {
572 + uint_t pr_misc_size;
573 + uint_t pr_misc_type;
574 +} pr_misc_header_t;
575 +
576 +enum PR_MISC_TYPES
577 +{
578 + PR_PATHNAME,
579 + PR_SOCKETNAME,
580 + PR_PEERSOCKNAME,
581 + PR_SOCKOPTS_BOOL_OPTS,
582 + PR_SOCKOPT_LINGER,
583 + PR_SOCKOPT_SNDBUF,
584 + PR_SOCKOPT_RCVBUF,
585 + PR_SOCKOPT_IP_NEXTHOP,
586 + PR_SOCKOPT_IPV6_NEXTHOP,
587 + PR_SOCKOPT_TYPE,
588 + __UNIMPL_PR_SOCKOPT_LISTENQLIMIT,
589 + PR_SOCKOPT_TCP_CONGESTION,
590 + __UNIMPL_PR_SOCKOPT_FLOW_NAME,
591 + __UNIMPL_PR_SOCKOPTS_PRIV,
592 + PR_SOCKFILTERS_PRIV,
593 + PR_MISC_TYPES_MAX
594 +};
595 +
596 +typedef struct prsockopts_bool_opts {
597 + unsigned int prsock_bool_opts;
598 +} prsockopts_bool_opts_t;
599 +
600 +#define PR_SO_DEBUG (1 << 0)
601 +#define PR_SO_REUSEADDR (1 << 1)
602 +#define PR_SO_REUSEPORT (1 << 2)
603 +#define PR_SO_KEEPALIVE (1 << 3)
604 +#define PR_SO_DONTROUTE (1 << 4)
605 +#define PR_SO_BROADCAST (1 << 5)
606 +#define PR_SO_OOBINLINE (1 << 7)
607 +#define PR_SO_DGRAM_ERRIND (1 << 8)
608 +#define PR_SO_ALLZONES (1 << 9)
609 +#define PR_SO_MAC_EXEMPT (1 << 10)
610 +#define PR_SO_EXCLBIND (1 << 11)
611 +#define PR_SO_PASSIVE_CONNECT (1 << 12)
612 +#define PR_SO_ACCEPTCONN (1 << 13)
613 +#define PR_UDP_NAT_T_ENDPOINT (1 << 14)
614 +#define PR_SO_VRRP (1 << 15)
615 +#define PR_SO_MAC_IMPLICIT (1 << 16)
616 +
539 617 /*
540 618 * Representation of LWP name in core files. In /proc, we use a simple char
541 619 * array, but in core files we need to make it easy to correlate the note back
542 620 * to the right LWP. For simplicity, we'll use 32/64 consistent types.
543 621 */
544 622 typedef struct prlwpname {
545 623 uint64_t pr_lwpid;
546 624 char pr_lwpname[THREAD_NAME_MAX];
547 625 } prlwpname_t;
548 626
549 627 /*
550 628 * Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage
551 629 */
552 630 typedef struct prheader {
553 631 long pr_nent; /* number of entries */
554 632 long pr_entsize; /* size of each entry, in bytes */
555 633 } prheader_t;
556 634
557 635 /*
558 636 * Macros for manipulating sets of flags.
559 637 * sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
560 638 * flag must be a member of the enumeration corresponding to *sp.
561 639 */
562 640
563 641 /* turn on all flags in set */
564 642 #define prfillset(sp) \
565 643 { register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
566 644 while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0xFFFFFFFF; }
567 645
568 646 /* turn off all flags in set */
569 647 #define premptyset(sp) \
570 648 { register int _i_ = sizeof (*(sp))/sizeof (uint32_t); \
571 649 while (_i_) ((uint32_t *)(sp))[--_i_] = (uint32_t)0; }
572 650
573 651 /* turn on specified flag in set */
574 652 #define praddset(sp, flag) \
575 653 ((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
576 654 (((uint32_t *)(sp))[((flag)-1)/32] |= (1U<<(((flag)-1)%32))) : 0))
577 655
578 656 /* turn off specified flag in set */
579 657 #define prdelset(sp, flag) \
580 658 ((void)(((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) ? \
581 659 (((uint32_t *)(sp))[((flag)-1)/32] &= ~(1U<<(((flag)-1)%32))) : 0))
582 660
583 661 /* query: != 0 iff flag is turned on in set */
584 662 #define prismember(sp, flag) \
585 663 (((unsigned)((flag)-1) < 32*sizeof (*(sp))/sizeof (uint32_t)) && \
586 664 (((uint32_t *)(sp))[((flag)-1)/32] & (1U<<(((flag)-1)%32))))
587 665
588 666 #if defined(_SYSCALL32)
589 667
590 668 /*
591 669 * dev32_t version of PRNODEV
592 670 */
593 671 #define PRNODEV32 (dev32_t)(-1)
594 672
595 673 /*
596 674 * Kernel view of /proc structures for _ILP32 programs.
597 675 */
598 676
599 677 /*
600 678 * _ILP32 lwp status file. /proc/<pid>/lwp/<lwpid>/lwpstatus
601 679 */
602 680 typedef struct lwpstatus32 {
603 681 int pr_flags; /* flags */
604 682 id32_t pr_lwpid; /* specific lwp identifier */
605 683 short pr_why; /* reason for lwp stop, if stopped */
606 684 short pr_what; /* more detailed reason */
607 685 short pr_cursig; /* current signal, if any */
608 686 short pr_pad1;
609 687 siginfo32_t pr_info; /* info associated with signal or fault */
610 688 sigset_t pr_lwppend; /* set of signals pending to the lwp */
611 689 sigset_t pr_lwphold; /* set of signals blocked by the lwp */
612 690 struct sigaction32 pr_action; /* signal action for current signal */
613 691 stack32_t pr_altstack; /* alternate signal stack info */
614 692 caddr32_t pr_oldcontext; /* address of previous ucontext */
615 693 short pr_syscall; /* system call number (if in syscall) */
616 694 short pr_nsysarg; /* number of arguments to this syscall */
617 695 int pr_errno; /* errno for failed syscall, 0 if successful */
618 696 int32_t pr_sysarg[PRSYSARGS]; /* arguments to this syscall */
619 697 int32_t pr_rval1; /* primary syscall return value */
620 698 int32_t pr_rval2; /* second syscall return value, if any */
621 699 char pr_clname[PRCLSZ]; /* scheduling class name */
622 700 timestruc32_t pr_tstamp; /* real-time time stamp of stop */
623 701 timestruc32_t pr_utime; /* lwp user cpu time */
624 702 timestruc32_t pr_stime; /* lwp system cpu time */
625 703 int pr_filler[11 - 2 * sizeof (timestruc32_t) / sizeof (int)];
626 704 int pr_errpriv; /* missing privilege */
627 705 caddr32_t pr_ustack; /* address of stack boundary data (stack32_t) */
628 706 uint32_t pr_instr; /* current instruction */
629 707 prgregset32_t pr_reg; /* general registers */
630 708 prfpregset32_t pr_fpreg; /* floating-point registers */
631 709 } lwpstatus32_t;
632 710
633 711 /*
634 712 * _ILP32 process status file. /proc/<pid>/status
635 713 */
636 714 typedef struct pstatus32 {
637 715 int pr_flags; /* flags */
638 716 int pr_nlwp; /* number of active lwps in the process */
639 717 pid32_t pr_pid; /* process id */
640 718 pid32_t pr_ppid; /* parent process id */
641 719 pid32_t pr_pgid; /* process group id */
642 720 pid32_t pr_sid; /* session id */
643 721 id32_t pr_aslwpid; /* historical; now always zero */
644 722 id32_t pr_agentid; /* lwp id of the /proc agent lwp, if any */
645 723 sigset_t pr_sigpend; /* set of process pending signals */
646 724 caddr32_t pr_brkbase; /* address of the process heap */
647 725 size32_t pr_brksize; /* size of the process heap, in bytes */
648 726 caddr32_t pr_stkbase; /* address of the process stack */
649 727 size32_t pr_stksize; /* size of the process stack, in bytes */
650 728 timestruc32_t pr_utime; /* process user cpu time */
651 729 timestruc32_t pr_stime; /* process system cpu time */
652 730 timestruc32_t pr_cutime; /* sum of children's user times */
653 731 timestruc32_t pr_cstime; /* sum of children's system times */
654 732 sigset_t pr_sigtrace; /* set of traced signals */
655 733 fltset_t pr_flttrace; /* set of traced faults */
656 734 sysset_t pr_sysentry; /* set of system calls traced on entry */
657 735 sysset_t pr_sysexit; /* set of system calls traced on exit */
658 736 char pr_dmodel; /* data model of the process */
659 737 char pr_pad[3];
660 738 id32_t pr_taskid; /* task id */
661 739 id32_t pr_projid; /* project id */
662 740 int pr_nzomb; /* number of zombie lwps in the process */
663 741 id32_t pr_zoneid; /* zone id */
664 742 int pr_filler[15]; /* reserved for future use */
665 743 lwpstatus32_t pr_lwp; /* status of the representative lwp */
666 744 } pstatus32_t;
667 745
668 746 /*
669 747 * _ILP32 lwp ps(1) information file. /proc/<pid>/lwp/<lwpid>/lwpsinfo
670 748 */
671 749 typedef struct lwpsinfo32 {
672 750 int pr_flag; /* lwp flags */
673 751 id32_t pr_lwpid; /* lwp id */
674 752 caddr32_t pr_addr; /* internal address of lwp */
675 753 caddr32_t pr_wchan; /* wait addr for sleeping lwp */
676 754 char pr_stype; /* synchronization event type */
677 755 char pr_state; /* numeric lwp state */
678 756 char pr_sname; /* printable character for pr_state */
679 757 char pr_nice; /* nice for cpu usage */
680 758 short pr_syscall; /* system call number (if in syscall) */
681 759 char pr_oldpri; /* pre-SVR4, low value is high priority */
682 760 char pr_cpu; /* pre-SVR4, cpu usage for scheduling */
683 761 int pr_pri; /* priority, high value is high priority */
684 762 /* The following percent number is a 16-bit binary */
685 763 /* fraction [0 .. 1] with the binary point to the */
686 764 /* right of the high-order bit (1.0 == 0x8000) */
687 765 ushort_t pr_pctcpu; /* % of recent cpu time used by this lwp */
688 766 ushort_t pr_pad;
689 767 timestruc32_t pr_start; /* lwp start time, from the epoch */
690 768 timestruc32_t pr_time; /* usr+sys cpu time for this lwp */
691 769 char pr_clname[PRCLSZ]; /* scheduling class name */
692 770 char pr_name[PRFNSZ]; /* name of system lwp */
693 771 processorid_t pr_onpro; /* processor which last ran this lwp */
694 772 processorid_t pr_bindpro; /* processor to which lwp is bound */
695 773 psetid_t pr_bindpset; /* processor set to which lwp is bound */
696 774 int pr_lgrp; /* lwp home lgroup */
697 775 int pr_filler[4]; /* reserved for future use */
698 776 } lwpsinfo32_t;
699 777
700 778 /*
701 779 * _ILP32 process ps(1) information file. /proc/<pid>/psinfo
702 780 */
703 781 typedef struct psinfo32 {
704 782 int pr_flag; /* process flags */
705 783 int pr_nlwp; /* number of active lwps in the process */
706 784 pid32_t pr_pid; /* unique process id */
707 785 pid32_t pr_ppid; /* process id of parent */
708 786 pid32_t pr_pgid; /* pid of process group leader */
709 787 pid32_t pr_sid; /* session id */
710 788 uid32_t pr_uid; /* real user id */
711 789 uid32_t pr_euid; /* effective user id */
712 790 gid32_t pr_gid; /* real group id */
713 791 gid32_t pr_egid; /* effective group id */
714 792 caddr32_t pr_addr; /* address of process */
715 793 size32_t pr_size; /* size of process image in Kbytes */
716 794 size32_t pr_rssize; /* resident set size in Kbytes */
717 795 size32_t pr_pad1;
718 796 dev32_t pr_ttydev; /* controlling tty device (or PRNODEV) */
719 797 ushort_t pr_pctcpu; /* % of recent cpu time used by all lwps */
720 798 ushort_t pr_pctmem; /* % of system memory used by process */
721 799 timestruc32_t pr_start; /* process start time, from the epoch */
722 800 timestruc32_t pr_time; /* usr+sys cpu time for this process */
723 801 timestruc32_t pr_ctime; /* usr+sys cpu time for reaped children */
724 802 char pr_fname[PRFNSZ]; /* name of execed file */
725 803 char pr_psargs[PRARGSZ]; /* initial characters of arg list */
726 804 int pr_wstat; /* if zombie, the wait() status */
727 805 int pr_argc; /* initial argument count */
728 806 caddr32_t pr_argv; /* address of initial argument vector */
729 807 caddr32_t pr_envp; /* address of initial environment vector */
730 808 char pr_dmodel; /* data model of the process */
731 809 char pr_pad2[3];
732 810 id32_t pr_taskid; /* task id */
733 811 id32_t pr_projid; /* project id */
734 812 int pr_nzomb; /* number of zombie lwps in the process */
735 813 id32_t pr_poolid; /* pool id */
736 814 id32_t pr_zoneid; /* zone id */
737 815 id32_t pr_contract; /* process contract */
738 816 int pr_filler[1]; /* reserved for future use */
739 817 lwpsinfo32_t pr_lwp; /* information for representative lwp */
740 818 } psinfo32_t;
741 819
742 820 /*
743 821 * _ILP32 Memory-management interface. /proc/<pid>/map /proc/<pid>/rmap
744 822 */
745 823 typedef struct prmap32 {
746 824 caddr32_t pr_vaddr; /* virtual address of mapping */
747 825 size32_t pr_size; /* size of mapping in bytes */
748 826 char pr_mapname[64]; /* name in /proc/<pid>/object */
749 827 offset_t pr_offset; /* offset into mapped object, if any */
750 828 int pr_mflags; /* protection and attribute flags */
751 829 int pr_pagesize; /* pagesize (bytes) for this mapping */
752 830 int pr_shmid; /* SysV shmid, -1 if not SysV shared memory */
753 831 int pr_filler[1]; /* filler for future expansion */
754 832 } prmap32_t;
755 833
756 834 /*
757 835 * _ILP32 HAT memory-map interface. /proc/<pid>/xmap
758 836 */
759 837 typedef struct prxmap32 {
760 838 caddr32_t pr_vaddr; /* virtual address of mapping */
761 839 size32_t pr_size; /* size of mapping in bytes */
762 840 char pr_mapname[PRMAPSZ]; /* name in /proc/<pid>/object */
763 841 offset_t pr_offset; /* offset into mapped object, if any */
764 842 int pr_mflags; /* protection and attribute flags (see below) */
765 843 int pr_pagesize; /* pagesize (bytes) for this mapping */
766 844 int pr_shmid; /* SysV shmid, -1 if not SysV shared memory */
767 845 dev32_t pr_dev; /* st_dev from stat64() of mapped object, or PRNODEV */
768 846 uint64_t pr_ino; /* st_ino from stat64() of mapped object, if any */
769 847 uint32_t pr_rss; /* pages of resident memory */
770 848 uint32_t pr_anon; /* pages of resident anonymous memory */
771 849 uint32_t pr_locked; /* pages of locked memory */
772 850 uint32_t pr_pad; /* currently unused */
773 851 uint64_t pr_hatpagesize; /* pagesize of the hat mapping */
774 852 uint32_t pr_filler[6]; /* filler for future expansion */
775 853 } prxmap32_t;
776 854
777 855 /*
778 856 * _ILP32 Process credentials. PCSCRED and /proc/<pid>/cred
779 857 */
780 858 typedef struct prcred32 {
781 859 uid32_t pr_euid; /* effective user id */
782 860 uid32_t pr_ruid; /* real user id */
783 861 uid32_t pr_suid; /* saved user id (from exec) */
784 862 gid32_t pr_egid; /* effective group id */
785 863 gid32_t pr_rgid; /* real group id */
786 864 gid32_t pr_sgid; /* saved group id (from exec) */
787 865 int pr_ngroups; /* number of supplementary groups */
788 866 gid32_t pr_groups[1]; /* array of supplementary groups */
789 867 } prcred32_t;
790 868
791 869 /*
792 870 * _ILP32 Watchpoint interface. PCWATCH and /proc/<pid>/watch
793 871 */
794 872 typedef struct prwatch32 {
795 873 caddr32_t pr_vaddr; /* virtual address of watched area */
796 874 size32_t pr_size; /* size of watched area in bytes */
797 875 int pr_wflags; /* watch type flags */
798 876 int pr_pad;
799 877 } prwatch32_t;
800 878
801 879 /*
802 880 * _ILP32 PCREAD/PCWRITE I/O interface.
803 881 */
804 882 typedef struct priovec32 {
805 883 caddr32_t pio_base; /* buffer in controlling process */
806 884 size32_t pio_len; /* size of read/write request */
807 885 off32_t pio_offset; /* virtual address in target process */
808 886 } priovec32_t;
809 887
810 888 /*
811 889 * _ILP32 Resource usage. /proc/<pid>/usage /proc/<pid>/lwp/<lwpid>/lwpusage
812 890 */
813 891 typedef struct prusage32 {
814 892 id32_t pr_lwpid; /* lwp id. 0: process or defunct */
815 893 int32_t pr_count; /* number of contributing lwps */
816 894 timestruc32_t pr_tstamp; /* current time stamp */
817 895 timestruc32_t pr_create; /* process/lwp creation time stamp */
818 896 timestruc32_t pr_term; /* process/lwp termination time stamp */
819 897 timestruc32_t pr_rtime; /* total lwp real (elapsed) time */
820 898 timestruc32_t pr_utime; /* user level cpu time */
821 899 timestruc32_t pr_stime; /* system call cpu time */
822 900 timestruc32_t pr_ttime; /* other system trap cpu time */
823 901 timestruc32_t pr_tftime; /* text page fault sleep time */
824 902 timestruc32_t pr_dftime; /* data page fault sleep time */
825 903 timestruc32_t pr_kftime; /* kernel page fault sleep time */
826 904 timestruc32_t pr_ltime; /* user lock wait sleep time */
827 905 timestruc32_t pr_slptime; /* all other sleep time */
828 906 timestruc32_t pr_wtime; /* wait-cpu (latency) time */
829 907 timestruc32_t pr_stoptime; /* stopped time */
830 908 timestruc32_t filltime[6]; /* filler for future expansion */
831 909 uint32_t pr_minf; /* minor page faults */
832 910 uint32_t pr_majf; /* major page faults */
833 911 uint32_t pr_nswap; /* swaps */
834 912 uint32_t pr_inblk; /* input blocks */
835 913 uint32_t pr_oublk; /* output blocks */
836 914 uint32_t pr_msnd; /* messages sent */
837 915 uint32_t pr_mrcv; /* messages received */
838 916 uint32_t pr_sigs; /* signals received */
839 917 uint32_t pr_vctx; /* voluntary context switches */
840 918 uint32_t pr_ictx; /* involuntary context switches */
841 919 uint32_t pr_sysc; /* system calls */
842 920 uint32_t pr_ioch; /* chars read and written */
843 921 uint32_t filler[10]; /* filler for future expansion */
844 922 } prusage32_t;
845 923
846 924 /*
847 925 * _ILP32 Page data file. /proc/<pid>/pagedata
848 926 */
849 927
850 928 /* _ILP32 page data file header */
851 929 typedef struct prpageheader32 {
852 930 timestruc32_t pr_tstamp; /* real time stamp */
853 931 int32_t pr_nmap; /* number of address space mappings */
854 932 int32_t pr_npage; /* total number of pages */
855 933 } prpageheader32_t;
856 934
857 935 /* _ILP32 page data mapping header */
858 936 typedef struct prasmap32 {
859 937 caddr32_t pr_vaddr; /* virtual address of mapping */
860 938 size32_t pr_npage; /* number of pages in mapping */
861 939 char pr_mapname[64]; /* name in /proc/<pid>/object */
862 940 offset_t pr_offset; /* offset into mapped object, if any */
863 941 int pr_mflags; /* protection and attribute flags */
864 942 int pr_pagesize; /* pagesize (bytes) for this mapping */
865 943 int pr_shmid; /* SysV shmid, -1 if not SysV shared memory */
866 944 int pr_filler[1]; /* filler for future expansion */
867 945 } prasmap32_t;
868 946
869 947 /*
870 948 * _ILP32 Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage
871 949 */
872 950 typedef struct prheader32 {
873 951 int32_t pr_nent; /* number of entries */
874 952 int32_t pr_entsize; /* size of each entry, in bytes */
875 953 } prheader32_t;
876 954
877 955 #endif /* _SYSCALL32 */
878 956
879 957 #endif /* !_KERNEL && _STRUCTURED_PROC == 0 */
880 958
881 959 #ifdef __cplusplus
882 960 }
883 961 #endif
884 962
885 963 #endif /* _SYS_PROCFS_H */
↓ open down ↓ |
337 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX