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