/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
*/
extern "C" {
#endif
/*
* This definition is temporary. Structured proc is the preferred API,
* and the older ioctl-based interface will be removed in a future version
* of Solaris. Until then, by default, including <sys/procfs.h> will * provide the older ioctl-based /proc definitions. To get the structured
* /proc definitions, either include <procfs.h> or define _STRUCTURED_PROC */
#endif
#else /* !defined(_KERNEL) && _STRUCTURED_PROC == 0 */
/*
* System call interfaces for /proc.
*/
/*
* Control codes (long values) for messages written to ctl and lwpctl files.
*/
#
define PCNULL 0L
/* null request, advance to next message */#
define PCSTOP 1L /* direct process or lwp to stop and wait for stop */#
define PCDSTOP 2L /* direct process or lwp to stop */#
define PCWSTOP 3L /* wait for process or lwp to stop, no timeout */#
define PCTWSTOP 4L /* wait for stop, with long millisecond timeout arg */#
define PCCSIG 6L /* clear current signal from lwp */#
define PCCFAULT 7L /* clear current fault from lwp */#
define PCSSIG 8L /* set current signal from siginfo_t argument */#
define PCSHOLD 11L /* set lwp signal mask from sigset_t argument */#
define PCSTRACE 12L /* set traced signal set from sigset_t argument */#
define PCSFAULT 13L /* set traced fault set from fltset_t argument */#
define PCSENTRY 14L /* set traced syscall entry set from sysset_t arg */#
define PCSEXIT 15L /* set traced syscall exit set from sysset_t arg */#
define PCSET 16L /* set modes from long argument */#
define PCUNSET 17L /* unset modes from long argument */#
define PCSREG 18L /* set lwp general registers from prgregset_t arg */#
define PCSFPREG 19L /* set lwp floating-point registers from prfpregset_t */#
define PCSXREG 20L /* set lwp extra registers from prxregset_t arg */#
define PCNICE 21L /* set nice priority from long argument */#
define PCSVADDR 22L /* set %pc virtual address from long argument */#
define PCAGENT 24L /* create agent lwp with regs from prgregset_t arg */#
define PCREAD 25L /* read from the address space via priovec_t arg */#
define PCWRITE 26L /* write to the address space via priovec_t arg */#
define PCSCRED 27L /* set process credentials from prcred_t argument */#
define PCSASRS 28L /* set ancillary state registers from asrset_t arg */#
define PCSPRIV 29L /* set process privileges from prpriv_t argument */#
define PCSZONE 30L /* set zoneid from zoneid_t argument */#
define PCSCREDX 31L /* as PCSCRED but with supplemental groups *//*
* PCRUN long operand flags.
*/
#
define PRCSIG 0x01 /* clear current signal, if any */#
define PRCFAULT 0x02 /* clear current fault, if any */#
define PRSTEP 0x04 /* direct the lwp to single-step */#
define PRSABORT 0x08 /* abort syscall, if in syscall */#
define PRSTOP 0x10 /* set directed stop request */
/*
* lwp status file. /proc/<pid>/lwp/<lwpid>/lwpstatus
*/
#
define PRCLSZ 8 /* maximum size of scheduling class name */#
define PRSYSARGS 8 /* maximum number of syscall arguments */ short pr_why;
/* reason for lwp stop, if stopped */ short pr_what;
/* more detailed reason */ short pr_cursig;
/* current signal, if any */ short pr_syscall;
/* system call number (if in syscall) */ short pr_nsysarg;
/* number of arguments to this syscall */ int pr_errno;
/* errno for failed syscall, 0 if successful */ long pr_rval1;
/* primary syscall return value */ long pr_rval2;
/* second syscall return value, if any */
/*
* process status file. /proc/<pid>/status
*/
int pr_nlwp;
/* number of active lwps in the process */ char pr_dmodel;
/* data model of the process (see below) */ int pr_nzomb;
/* number of zombie lwps in the process */ int pr_filler[
15];
/* reserved for future use */
/*
* pr_flags (same values appear in both pstatus_t and lwpstatus_t pr_flags).
*
* These flags do *not* apply to psinfo_t.pr_flag or lwpsinfo_t.pr_flag
* (which are both deprecated).
*/
/* The following flags apply to the specific or representative lwp */
#
define PR_STOPPED 0x00000001 /* lwp is stopped */#
define PR_ISTOP 0x00000002 /* lwp is stopped on an event of interest */#
define PR_DSTOP 0x00000004 /* lwp has a stop directive in effect */#
define PR_STEP 0x00000008 /* lwp has a single-step directive in effect */#
define PR_ASLEEP 0x00000010 /* lwp is sleeping in a system call */#
define PR_PCINVAL 0x00000020 /* contents of pr_instr undefined */#
define PR_ASLWP 0x00000040 /* obsolete flag; never set */#
define PR_AGENT 0x00000080 /* this lwp is the /proc agent lwp */#
define PR_DETACH 0x00000100 /* this is a detached lwp */#
define PR_DAEMON 0x00000200 /* this is a daemon lwp */#
define PR_IDLE 0x00000400 /* lwp is a cpu's idle thread *//* The following flags apply to the process, not to an individual lwp */
#
define PR_ISSYS 0x00001000 /* this is a system process */#
define PR_VFORKP 0x00002000 /* process is the parent of a vfork()d child */#
define PR_ORPHAN 0x00004000 /* process's process group is orphaned */#
define PR_NOSIGCHLD 0x00008000 /* process will not generate SIGCHLD on exit */#
define PR_WAITPID 0x00010000 /* only waitid(P_PID, pid) can reap the child *//* The following process flags are modes settable by PCSET/PCUNSET */ #
define PR_FORK 0x00100000 /* inherit-on-fork is in effect */#
define PR_RLC 0x00200000 /* run-on-last-close is in effect */#
define PR_KLC 0x00400000 /* kill-on-last-close is in effect */#
define PR_ASYNC 0x00800000 /* asynchronous-stop is in effect */#
define PR_MSACCT 0x01000000 /* micro-state usage accounting is in effect */#
define PR_BPTADJ 0x02000000 /* breakpoint trap pc adjustment is in effect */#
define PR_PTRACE 0x04000000 /* ptrace-compatibility mode is in effect */#
define PR_MSFORK 0x08000000 /* micro-state accounting inherited on fork */
/*
*/
/*
* Reasons for stopping (pr_why).
*/
/*
* lwp ps(1) information file. /proc/<pid>/lwp/<lwpid>/lwpsinfo
*/
#
define PRFNSZ 16 /* Maximum size of execed filename */ int pr_flag;
/* lwp flags (DEPRECATED; do not use) */ char pr_stype;
/* synchronization event type */ char pr_sname;
/* printable character for pr_state */ char pr_nice;
/* nice for cpu usage */ short pr_syscall;
/* system call number (if in syscall) */ char pr_oldpri;
/* pre-SVR4, low value is high priority */ char pr_cpu;
/* pre-SVR4, cpu usage for scheduling */ int pr_pri;
/* priority, high value is high priority */ /* The following percent number is a 16-bit binary */
/* fraction [0 .. 1] with the binary point to the */
/* right of the high-order bit (1.0 == 0x8000) */
int pr_filler[
4];
/* reserved for future use */
/*
* process ps(1) information file. /proc/<pid>/psinfo
*/
#
define PRARGSZ 80 /* number of chars of arguments */ int pr_flag;
/* process flags (DEPRECATED; do not use) */ int pr_nlwp;
/* number of active lwps in the process */ /* The following percent numbers are 16-bit binary */
/* fractions [0 .. 1] with the binary point to the */
/* right of the high-order bit (1.0 == 0x8000) */
int pr_wstat;
/* if zombie, the wait() status */ int pr_argc;
/* initial argument count */ char pr_dmodel;
/* data model of the process */ int pr_nzomb;
/* number of zombie lwps in the process */ int pr_filler[
1];
/* reserved for future use */
/*
* Memory-map interface. /proc/<pid>/map /proc/<pid>/rmap
*/
int pr_mflags;
/* protection and attribute flags (see below) */ int pr_pagesize;
/* pagesize (bytes) for this mapping */ int pr_shmid;
/* SysV shmid, -1 if not SysV shared memory */ int pr_filler[
1];
/* filler for future expansion */
/*
* HAT memory-map interface. /proc/<pid>/xmap
*/
int pr_mflags;
/* protection and attribute flags (see below) */ int pr_pagesize;
/* pagesize (bytes) for this mapping */ int pr_shmid;
/* SysV shmid, -1 if not SysV shared memory */ dev_t pr_dev;
/* st_dev from stat64() of mapped object, or PRNODEV */ #else
#endif
/* Protection and attribute flags */
#
define MA_READ 0x04 /* readable by the traced process */#
define MA_WRITE 0x02 /* writable by the traced process */#
define MA_EXEC 0x01 /* executable by the traced process */#
define MA_SHARED 0x08 /* changes are shared by mapped object */#
define MA_ISM 0x80 /* intimate shared mem (shared MMU resources) */#
define MA_SHM 0x200 /* System V shared memory */
/*
* These are obsolete and unreliable.
* They are included here only for historical compatibility.
*/
#
define MA_BREAK 0x10 /* grown by brk(2) */#
define MA_STACK 0x20 /* grown automatically on stack faults */
/*
* Process credentials. PCSCRED and /proc/<pid>/cred
*/
int pr_ngroups;
/* number of supplementary groups */
/*
* Process privileges. PCSPRIV and /proc/<pid>/priv
*/
/*
* Watchpoint interface. PCWATCH and /proc/<pid>/watch
*/
/* pr_wflags */
#
define WA_READ 0x04 /* trap on read access */#
define WA_WRITE 0x02 /* trap on write access */#
define WA_EXEC 0x01 /* trap on execute access */#
define WA_TRAPAFTER 0x08 /* trap after instruction completes */
/*
*/
void *
pio_base;
/* buffer in controlling process */
/*
* Resource usage. /proc/<pid>/usage /proc/<pid>/lwp/<lwpid>/lwpusage
*/
int pr_count;
/* number of contributing lwps */
/*
* Page data file. /proc/<pid>/pagedata
*/
/* page data file header */
long pr_nmap;
/* number of address space mappings */ long pr_npage;
/* total number of pages */
/* page data mapping header */
int pr_mflags;
/* protection and attribute flags */ int pr_pagesize;
/* pagesize (bytes) for this mapping */ int pr_shmid;
/* SysV shmid, -1 if not SysV shared memory */ int pr_filler[
1];
/* filler for future expansion */
/*
* pr_npage bytes (plus 0-7 null bytes to round up to an 8-byte boundary)
* follow each mapping header, each containing zero or more of these flags.
*/
#
define PG_MODIFIED 0x01 /* page modified since last read */#
define PG_HWMAPPED 0x04 /* page is present and mapped */
/*
* Open files. Only in core files (for now). Note that we'd like to use
* the stat or stat64 structure, but both of these structures are unfortunately
* not consistent between 32 and 64 bit modes. To keep our lives simpler, we
* just define our own structure with types that are not sensitive to this
* difference. Also, it turns out that pfiles omits a lot of info from the
* struct stat (e.g. times, device sizes, etc.) so we don't bother adding those
* here.
*/
/*
* Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage
*/
long pr_nent;
/* number of entries */ long pr_entsize;
/* size of each entry, in bytes */
/*
* Macros for manipulating sets of flags.
* sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
* flag must be a member of the enumeration corresponding to *sp.
*/
/* turn on all flags in set */
/* turn off all flags in set */
/* turn on specified flag in set */
((
void)(((
unsigned)((
flag)-
1) <
32*
sizeof (*(
sp))/
sizeof (
uint32_t)) ? \
/* turn off specified flag in set */
((
void)(((
unsigned)((
flag)-
1) <
32*
sizeof (*(
sp))/
sizeof (
uint32_t)) ? \
/* query: != 0 iff flag is turned on in set */
/*
* dev32_t version of PRNODEV
*/
/*
* Kernel view of /proc structures for _ILP32 programs.
*/
/*
* _ILP32 lwp status file. /proc/<pid>/lwp/<lwpid>/lwpstatus
*/
short pr_why;
/* reason for lwp stop, if stopped */ short pr_what;
/* more detailed reason */ short pr_cursig;
/* current signal, if any */ short pr_syscall;
/* system call number (if in syscall) */ short pr_nsysarg;
/* number of arguments to this syscall */ int pr_errno;
/* errno for failed syscall, 0 if successful */
/*
* _ILP32 process status file. /proc/<pid>/status
*/
int pr_nlwp;
/* number of active lwps in the process */ char pr_dmodel;
/* data model of the process */ int pr_nzomb;
/* number of zombie lwps in the process */ int pr_filler[
15];
/* reserved for future use */
/*
* _ILP32 lwp ps(1) information file. /proc/<pid>/lwp/<lwpid>/lwpsinfo
*/
char pr_stype;
/* synchronization event type */ char pr_sname;
/* printable character for pr_state */ char pr_nice;
/* nice for cpu usage */ short pr_syscall;
/* system call number (if in syscall) */ char pr_oldpri;
/* pre-SVR4, low value is high priority */ char pr_cpu;
/* pre-SVR4, cpu usage for scheduling */ int pr_pri;
/* priority, high value is high priority */ /* The following percent number is a 16-bit binary */
/* fraction [0 .. 1] with the binary point to the */
/* right of the high-order bit (1.0 == 0x8000) */
int pr_filler[
4];
/* reserved for future use */
/*
* _ILP32 process ps(1) information file. /proc/<pid>/psinfo
*/
int pr_nlwp;
/* number of active lwps in the process */ int pr_wstat;
/* if zombie, the wait() status */ int pr_argc;
/* initial argument count */ char pr_dmodel;
/* data model of the process */ int pr_nzomb;
/* number of zombie lwps in the process */ int pr_filler[
1];
/* reserved for future use */
/*
* _ILP32 Memory-management interface. /proc/<pid>/map /proc/<pid>/rmap
*/
char pr_mapname[
64];
/* name in /proc/<pid>/object */ int pr_mflags;
/* protection and attribute flags */ int pr_pagesize;
/* pagesize (bytes) for this mapping */ int pr_shmid;
/* SysV shmid, -1 if not SysV shared memory */ int pr_filler[
1];
/* filler for future expansion */
/*
* _ILP32 HAT memory-map interface. /proc/<pid>/xmap
*/
int pr_mflags;
/* protection and attribute flags (see below) */ int pr_pagesize;
/* pagesize (bytes) for this mapping */ int pr_shmid;
/* SysV shmid, -1 if not SysV shared memory */ dev32_t pr_dev;
/* st_dev from stat64() of mapped object, or PRNODEV */
/*
* _ILP32 Process credentials. PCSCRED and /proc/<pid>/cred
*/
int pr_ngroups;
/* number of supplementary groups */
/*
* _ILP32 Watchpoint interface. PCWATCH and /proc/<pid>/watch
*/
/*
*/
/*
* _ILP32 Resource usage. /proc/<pid>/usage /proc/<pid>/lwp/<lwpid>/lwpusage
*/
/*
* _ILP32 Page data file. /proc/<pid>/pagedata
*/
/* _ILP32 page data file header */
/* _ILP32 page data mapping header */
char pr_mapname[
64];
/* name in /proc/<pid>/object */ int pr_mflags;
/* protection and attribute flags */ int pr_pagesize;
/* pagesize (bytes) for this mapping */ int pr_shmid;
/* SysV shmid, -1 if not SysV shared memory */ int pr_filler[
1];
/* filler for future expansion */
/*
* _ILP32 Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage
*/
#endif /* _SYSCALL32 */
#endif /* !_KERNEL && _STRUCTURED_PROC == 0 */
}
#endif
#endif /* _SYS_PROCFS_H */