1 '\" te 2 .\" Copyright 1989 AT&T 3 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. 4 .\" Copyright (c) 2013, Joyent, Inc. All rights reserved. 5 .\" 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. 6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. 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] 8 .TH PROC 4 "Mar 31, 2013" 9 .SH NAME 10 proc \- /proc, the process file system 11 .SH DESCRIPTION 12 .sp 13 .LP 14 \fB/proc\fR is a file system that provides access to the state of each process 15 and light-weight process (lwp) in the system. The name of each entry in the 16 \fB/proc\fR directory is a decimal number corresponding to a process-ID. These 17 entries are themselves subdirectories. Access to process state is provided by 18 additional files contained within each subdirectory; the hierarchy is described 19 more completely below. In this document, ``\fB/proc\fR file'' refers to a 20 non-directory file within the hierarchy rooted at \fB/proc\fR. The owner of 21 each \fB/proc\fR file and subdirectory is determined by the user-ID of the 22 process. 23 .sp 24 .LP 25 \fB/proc\fR can be mounted on any mount point, in addition to the standard 26 \fB/proc\fR mount point, and can be mounted several places at once. Such 27 additional mounts are allowed in order to facilitate the confinement of 28 processes to subtrees of the file system via \fBchroot\fR(1M) and yet allow 29 such processes access to commands like \fBps\fR(1). 30 .sp 31 .LP 32 Standard system calls are used to access \fB/proc\fR files: \fBopen\fR(2), 33 \fBclose\fR(2), \fBread\fR(2), and \fBwrite\fR(2) (including \fBreadv\fR(2), 34 \fBwritev\fR(2), \fBpread\fR(2), and \fBpwrite\fR(2)). Most files describe 35 process state and can only be opened for reading. \fBctl\fR and \fBlwpctl\fR 36 (control) files permit manipulation of process state and can only be opened for 37 writing. \fBas\fR (address space) files contain the image of the running 38 process and can be opened for both reading and writing. An open for writing 39 allows process control; a read-only open allows inspection but not control. In 40 this document, we refer to the process as open for reading or writing if any of 41 its associated \fB/proc\fR files is open for reading or writing. 42 .sp 43 .LP 44 In general, more than one process can open the same \fB/proc\fR file at the 45 same time. \fIExclusive\fR \fIopen\fR is an advisory mechanism provided to 46 allow controlling processes to avoid collisions with each other. A process can 47 obtain exclusive control of a target process, with respect to other cooperating 48 processes, if it successfully opens any \fB/proc\fR file in the target process 49 for writing (the \fBas\fR or \fBctl\fR files, or the \fBlwpctl\fR file of any 50 lwp) while specifying \fBO_EXCL\fR in the \fBopen\fR(2). Such an open will fail 51 if the target process is already open for writing (that is, if an \fBas\fR, 52 \fBctl\fR, or \fBlwpctl\fR file is already open for writing). There can be any 53 number of concurrent read-only opens; \fBO_EXCL\fR is ignored on opens for 54 reading. It is recommended that the first open for writing by a controlling 55 process use the \fBO_EXCL\fR flag; multiple controlling processes usually 56 result in chaos. 57 .sp 58 .LP 59 If a process opens one of its own \fB/proc\fR files for writing, the open 60 succeeds regardless of \fBO_EXCL\fR and regardless of whether some other 61 process has the process open for writing. Self-opens do not count when another 62 process attempts an exclusive open. (A process cannot exclude a debugger by 63 opening itself for writing and the application of a debugger cannot prevent a 64 process from opening itself.) All self-opens for writing are forced to be 65 close-on-exec (see the \fBF_SETFD\fR operation of \fBfcntl\fR(2)). 66 .sp 67 .LP 68 Data may be transferred from or to any locations in the address space of the 69 traced process by applying \fBlseek\fR(2) to position the \fBas\fR file at the 70 virtual address of interest followed by \fBread\fR(2) or \fBwrite\fR(2) (or by 71 using \fBpread\fR(2) or \fBpwrite\fR(2) for the combined operation). The 72 address-map files \fB/proc/\fR\fIpid\fR\fB/map\fR and 73 \fB/proc/\fR\fIpid\fR\fB/xmap\fR can be read to determine the accessible areas 74 (mappings) of the address space. \fBI/O\fR transfers may span contiguous 75 mappings. An \fBI/O\fR request extending into an unmapped area is truncated at 76 the boundary. A write request beginning at an unmapped virtual address fails 77 with \fBEIO\fR; a read request beginning at an unmapped virtual address returns 78 zero (an end-of-file indication). 79 .sp 80 .LP 81 Information and control operations are provided through additional files. 82 \fB<procfs.h>\fR contains definitions of data structures and message formats 83 used with these files. Some of these definitions involve the use of sets of 84 flags. The set types \fBsigset_t\fR, \fBfltset_t\fR, and \fBsysset_t\fR 85 correspond, respectively, to signal, fault, and system call enumerations 86 defined in \fB<sys/signal.h>\fR, \fB<sys/fault.h>\fR, and 87 \fB<sys/syscall.h>\fR\&. Each set type is large enough to hold flags for its 88 own enumeration. Although they are of different sizes, they have a common 89 structure and can be manipulated by these macros: 90 .sp 91 .in +2 92 .nf 93 prfillset(&set); /* turn on all flags in set */ 94 premptyset(&set); /* turn off all flags in set */ 95 praddset(&set, flag); /* turn on the specified flag */ 96 prdelset(&set, flag); /* turn off the specified flag */ 97 r = prismember(&set, flag); /* != 0 iff flag is turned on */ 98 .fi 99 .in -2 100 101 .sp 102 .LP 103 One of \fBprfillset()\fR or \fBpremptyset()\fR must be used to initialize 104 \fBset\fR before it is used in any other operation. \fBflag\fR must be a member 105 of the enumeration corresponding to \fBset\fR. 106 .sp 107 .LP 108 Every process contains at least one \fIlight-weight process\fR, or \fIlwp\fR. 109 Each lwp represents a flow of execution that is independently scheduled by the 110 operating system. All lwps in a process share its address space as well as many 111 other attributes. Through the use of \fBlwpctl\fR and \fBctl\fR files as 112 described below, it is possible to affect individual lwps in a process or to 113 affect all of them at once, depending on the operation. 114 .sp 115 .LP 116 When the process has more than one lwp, a representative lwp is chosen by the 117 system for certain process status files and control operations. The 118 representative lwp is a stopped lwp only if all of the process's lwps are 119 stopped; is stopped on an event of interest only if all of the lwps are so 120 stopped (excluding \fBPR_SUSPENDED\fR lwps); is in a \fBPR_REQUESTED\fR stop 121 only if there are no other events of interest to be found; or, failing 122 everything else, is in a \fBPR_SUSPENDED\fR stop (implying that the process is 123 deadlocked). See the description of the \fBstatus\fR file for definitions of 124 stopped states. See the \fBPCSTOP\fR control operation for the definition of 125 ``event of interest''. 126 .sp 127 .LP 128 The representative lwp remains fixed (it will be chosen again on the next 129 operation) as long as all of the lwps are stopped on events of interest or are 130 in a \fBPR_SUSPENDED\fR stop and the \fBPCRUN\fR control operation is not 131 applied to any of them. 132 .sp 133 .LP 134 When applied to the process control file, every \fB/proc\fR control operation 135 that must act on an lwp uses the same algorithm to choose which lwp to act 136 upon. Together with synchronous stopping (see \fBPCSET\fR), this enables a 137 debugger to control a multiple-lwp process using only the process-level status 138 and control files if it so chooses. More fine-grained control can be achieved 139 using the lwp-specific files. 140 .sp 141 .LP 142 The system supports two process data models, the traditional 32-bit data model 143 in which ints, longs and pointers are all 32 bits wide (the ILP32 data model), 144 and on some platforms the 64-bit data model in which longs and pointers, but 145 not ints, are 64 bits in width (the LP64 data model). In the LP64 data model 146 some system data types, notably \fBsize_t\fR, \fBoff_t\fR, \fBtime_t\fR and 147 \fBdev_t\fR, grow from 32 bits to 64 bits as well. 148 .sp 149 .LP 150 The \fB/proc\fR interfaces described here are available to both 32-bit and 151 64-bit controlling processes. However, many operations attempted by a 32-bit 152 controlling process on a 64-bit target process will fail with \fBEOVERFLOW\fR 153 because the address space range of a 32-bit process cannot encompass a 64-bit 154 process or because the data in some 64-bit system data type cannot be 155 compressed to fit into the corresponding 32-bit type without loss of 156 information. Operations that fail in this circumstance include reading and 157 writing the address space, reading the address-map files, and setting the 158 target process's registers. There is no restriction on operations applied by a 159 64-bit process to either a 32-bit or a 64-bit target processes. 160 .sp 161 .LP 162 The format of the contents of any \fB/proc\fR file depends on the data model of 163 the observer (the controlling process), not on the data model of the target 164 process. A 64-bit debugger does not have to translate the information it reads 165 from a \fB/proc\fR file for a 32-bit process from 32-bit format to 64-bit 166 format. However, it usually has to be aware of the data model of the target 167 process. The \fBpr_dmodel\fR field of the \fBstatus\fR files indicates the 168 target process's data model. 169 .sp 170 .LP 171 To help deal with system data structures that are read from 32-bit processes, a 172 64-bit controlling program can be compiled with the C preprocessor symbol 173 \fB_SYSCALL32\fR defined before system header files are included. This makes 174 explicit 32-bit fixed-width data structures (like \fBcstruct stat32\fR) visible 175 to the 64-bit program. See \fBtypes32.h\fR(3HEAD). 176 .SH DIRECTORY STRUCTURE 177 .sp 178 .LP 179 At the top level, the directory \fB/proc\fR contains entries each of which 180 names an existing process in the system. These entries are themselves 181 directories. Except where otherwise noted, the files described below can be 182 opened for reading only. In addition, if a process becomes a \fIzombie\fR (one 183 that has exited but whose parent has not yet performed a \fBwait\fR(3C) upon 184 it), most of its associated \fB/proc\fR files disappear from the hierarchy; 185 subsequent attempts to open them, or to read or write files opened before the 186 process exited, will elicit the error \fBENOENT\fR. 187 .sp 188 .LP 189 Although process state and consequently the contents of \fB/proc\fR files can 190 change from instant to instant, a single \fBread\fR(2) of a \fB/proc\fR file is 191 guaranteed to return a sane representation of state; that is, the read will be 192 atomic with respect to the state of the process. No such guarantee applies to 193 successive reads applied to a \fB/proc\fR file for a running process. In 194 addition, atomicity is not guaranteed for \fBI/O\fR applied to the \fBas\fR 195 (address-space) file for a running process or for a process whose address space 196 contains memory shared by another running process. 197 .sp 198 .LP 199 A number of structure definitions are used to describe the files. These 200 structures may grow by the addition of elements at the end in future releases 201 of the system and it is not legitimate for a program to assume that they will 202 not. 203 .SH STRUCTURE OF \fB/proc/\fR\fIpid\fR 204 .sp 205 .LP 206 A given directory \fB/proc/\fR\fIpid\fR contains the following entries. A 207 process can use the invisible alias \fB/proc/self\fR if it wishes to open one 208 of its own \fB/proc\fR files (invisible in the sense that the name ``self'' 209 does not appear in a directory listing of \fB/proc\fR obtained from 210 \fBls\fR(1), \fBgetdents\fR(2), or \fBreaddir\fR(3C)). 211 .SS "contracts" 212 .sp 213 .LP 214 A directory containing references to the contracts held by the process. Each 215 entry is a symlink to the contract's directory under \fB/system/contract\fR. 216 See \fBcontract\fR(4). 217 .SS "as" 218 .sp 219 .LP 220 Contains the address-space image of the process; it can be opened for both 221 reading and writing. \fBlseek\fR(2) is used to position the file at the virtual 222 address of interest and then the address space can be examined or changed 223 through \fBread\fR(2) or \fBwrite\fR(2) (or by using \fBpread\fR(2) or 224 \fBpwrite\fR(2) for the combined operation). 225 .SS "ctl" 226 .sp 227 .LP 228 A write-only file to which structured messages are written directing the system 229 to change some aspect of the process's state or control its behavior in some 230 way. The seek offset is not relevant when writing to this file. Individual lwps 231 also have associated \fBlwpctl\fR files in the lwp subdirectories. A control 232 message may be written either to the process's \fBctl\fR file or to a specific 233 \fBlwpctl\fR file with operation-specific effects. The effect of a control 234 message is immediately reflected in the state of the process visible through 235 appropriate status and information files. The types of control messages are 236 described in detail later. See \fBCONTROL MESSAGES\fR. 237 .SS "status" 238 .sp 239 .LP 240 Contains state information about the process and the representative lwp. The 241 file contains a \fBpstatus\fR structure which contains an embedded 242 \fBlwpstatus\fR structure for the representative lwp, as follows: 243 .sp 244 .in +2 245 .nf 246 typedef struct pstatus { 247 int pr_flags; /* flags (see below) */ 248 int pr_nlwp; /* number of active lwps in the process */ 249 int pr_nzomb; /* number of zombie lwps in the process */ 250 pid_tpr_pid; /* process id */ 251 pid_tpr_ppid; /* parent process id */ 252 pid_tpr_pgid; /* process group id */ 253 pid_tpr_sid; /* session id */ 254 id_t pr_aslwpid; /* obsolete */ 255 id_t pr_agentid; /* lwp-id of the agent lwp, if any */ 256 sigset_t pr_sigpend; /* set of process pending signals */ 257 uintptr_t pr_brkbase; /* virtual address of the process heap */ 258 size_t pr_brksize; /* size of the process heap, in bytes */ 259 uintptr_t pr_stkbase; /* virtual address of the process stack */ 260 size_tpr_stksize; /* size of the process stack, in bytes */ 261 timestruc_t pr_utime; /* process user cpu time */ 262 timestruc_t pr_stime; /* process system cpu time */ 263 timestruc_t pr_cutime; /* sum of children's user times */ 264 timestruc_t pr_cstime; /* sum of children's system times */ 265 sigset_t pr_sigtrace; /* set of traced signals */ 266 fltset_t pr_flttrace; /* set of traced faults */ 267 sysset_t pr_sysentry; /* set of system calls traced on entry */ 268 sysset_t pr_sysexit; /* set of system calls traced on exit */ 269 char pr_dmodel; /* data model of the process */ 270 taskid_t pr_taskid; /* task id */ 271 projid_t pr_projid; /* project id */ 272 zoneid_t pr_zoneid; /* zone id */ 273 lwpstatus_t pr_lwp; /* status of the representative lwp */ 274 } pstatus_t; 275 .fi 276 .in -2 277 278 .sp 279 .LP 280 \fBpr_flags\fR is a bit-mask holding the following process flags. For 281 convenience, it also contains the lwp flags for the representative lwp, 282 described later. 283 .sp 284 .ne 2 285 .na 286 \fB\fBPR_ISSYS\fR\fR 287 .ad 288 .RS 13n 289 process is a system process (see \fBPCSTOP\fR). 290 .RE 291 292 .sp 293 .ne 2 294 .na 295 \fB\fBPR_VFORKP\fR\fR 296 .ad 297 .RS 13n 298 process is the parent of a vforked child (see \fBPCWATCH\fR). 299 .RE 300 301 .sp 302 .ne 2 303 .na 304 \fB\fBPR_FORK\fR\fR 305 .ad 306 .RS 13n 307 process has its inherit-on-fork mode set (see \fBPCSET\fR). 308 .RE 309 310 .sp 311 .ne 2 312 .na 313 \fB\fBPR_RLC\fR\fR 314 .ad 315 .RS 13n 316 process has its run-on-last-close mode set (see \fBPCSET\fR). 317 .RE 318 319 .sp 320 .ne 2 321 .na 322 \fB\fBPR_KLC\fR\fR 323 .ad 324 .RS 13n 325 process has its kill-on-last-close mode set (see \fBPCSET\fR). 326 .RE 327 328 .sp 329 .ne 2 330 .na 331 \fB\fBPR_ASYNC\fR\fR 332 .ad 333 .RS 13n 334 process has its asynchronous-stop mode set (see \fBPCSET\fR). 335 .RE 336 337 .sp 338 .ne 2 339 .na 340 \fB\fBPR_MSACCT\fR\fR 341 .ad 342 .RS 13n 343 Set by default in all processes to indicate that microstate accounting is 344 enabled. However, this flag has been deprecated and no longer has any effect. 345 Microstate accounting may not be disabled; however, it is still possible to 346 toggle the flag. 347 .RE 348 349 .sp 350 .ne 2 351 .na 352 \fB\fBPR_MSFORK\fR\fR 353 .ad 354 .RS 13n 355 Set by default in all processes to indicate that microstate accounting will be 356 enabled for processes that this parent forks(). However, this flag has been 357 deprecated and no longer has any effect. It is possible to toggle this flag; 358 however, it is not possible to disable microstate accounting. 359 .RE 360 361 .sp 362 .ne 2 363 .na 364 \fB\fBPR_BPTADJ\fR\fR 365 .ad 366 .RS 13n 367 process has its breakpoint adjustment mode set (see \fBPCSET\fR). 368 .RE 369 370 .sp 371 .ne 2 372 .na 373 \fB\fBPR_PTRACE\fR\fR 374 .ad 375 .RS 13n 376 process has its ptrace-compatibility mode set (see \fBPCSET\fR). 377 .RE 378 379 .sp 380 .LP 381 \fBpr_nlwp\fR is the total number of active lwps in the process. pr_nzomb is 382 the total number of zombie lwps in the process. A zombie lwp is a non-detached 383 lwp that has terminated but has not been reaped with \fBthr_join\fR(3C) or 384 \fBpthread_join\fR(3C). 385 .sp 386 .LP 387 \fBpr_pid\fR, \fBpr_ppid\fR, \fBpr_pgid\fR, and \fBpr_sid\fR are, respectively, 388 the process ID, the ID of the process's parent, the process's process group ID, 389 and the process's session ID. 390 .sp 391 .LP 392 \fBpr_aslwpid\fR is obsolete and is always zero. 393 .sp 394 .LP 395 \fBpr_agentid\fR is the lwp-ID for the \fB/proc\fR agent lwp (see the 396 \fBPCAGENT\fR control operation). It is zero if there is no agent lwp in the 397 process. 398 .sp 399 .LP 400 \fBpr_sigpend\fR identifies asynchronous signals pending for the process. 401 .sp 402 .LP 403 \fBpr_brkbase\fR is the virtual address of the process heap and 404 \fBpr_brksize\fR is its size in bytes. The address formed by the sum of these 405 values is the process \fBbreak\fR (see \fBbrk\fR(2)). \fBpr_stkbase\fR and 406 \fBpr_stksize\fR are, respectively, the virtual address of the process stack 407 and its size in bytes. (Each lwp runs on a separate stack; the distinguishing 408 characteristic of the process stack is that the operating system will grow it 409 when necessary.) 410 .sp 411 .LP 412 \fBpr_utime\fR, \fBpr_stime\fR, \fBpr_cutime\fR, and \fBpr_cstime\fR are, 413 respectively, the user \fBCPU\fR and system \fBCPU\fR time consumed by the 414 process, and the cumulative user \fBCPU\fR and system \fBCPU\fR time consumed 415 by the process's children, in seconds and nanoseconds. 416 .sp 417 .LP 418 \fBpr_sigtrace\fR and \fBpr_flttrace\fR contain, respectively, the set of 419 signals and the set of hardware faults that are being traced (see 420 \fBPCSTRACE\fR and \fBPCSFAULT\fR). 421 .sp 422 .LP 423 \fBpr_sysentry\fR and \fBpr_sysexit\fR contain, respectively, the sets of 424 system calls being traced on entry and exit (see \fBPCSENTRY\fR and 425 \fBPCSEXIT\fR). 426 .sp 427 .LP 428 \fBpr_dmodel\fR indicates the data model of the process. Possible values are: 429 .sp 430 .ne 2 431 .na 432 \fB\fBPR_MODEL_ILP32\fR\fR 433 .ad 434 .RS 19n 435 process data model is ILP32. 436 .RE 437 438 .sp 439 .ne 2 440 .na 441 \fB\fBPR_MODEL_LP64\fR\fR 442 .ad 443 .RS 19n 444 process data model is LP64. 445 .RE 446 447 .sp 448 .ne 2 449 .na 450 \fB\fBPR_MODEL_NATIVE\fR\fR 451 .ad 452 .RS 19n 453 process data model is native. 454 .RE 455 456 .sp 457 .LP 458 The \fBpr_taskid\fR, \fBpr_projid\fR, and \fBpr_zoneid\fR fields contain 459 respectively, the numeric \fBID\fRs of the task, project, and zone in which the 460 process was running. 461 .sp 462 .LP 463 The constant \fBPR_MODEL_NATIVE\fR reflects the data model of the controlling 464 process, \fIthat is\fR, its value is \fBPR_MODEL_ILP32\fR or 465 \fBPR_MODEL_LP64\fR according to whether the controlling process has been 466 compiled as a 32-bit program or a 64-bit program, respectively. 467 .sp 468 .LP 469 \fBpr_lwp\fR contains the status information for the representative lwp: 470 .sp 471 .in +2 472 .nf 473 typedef struct lwpstatus { 474 int pr_flags; /* flags (see below) */ 475 id_t pr_lwpid; /* specific lwp identifier */ 476 short pr_why; /* reason for lwp stop, if stopped */ 477 short pr_what; /* more detailed reason */ 478 short pr_cursig; /* current signal, if any */ 479 siginfo_t pr_info; /* info associated with signal or fault */ 480 sigset_t pr_lwppend; /* set of signals pending to the lwp */ 481 sigset_t pr_lwphold; /* set of signals blocked by the lwp */ 482 struct sigaction pr_action;/* signal action for current signal */ 483 stack_t pr_altstack; /* alternate signal stack info */ 484 uintptr_t pr_oldcontext; /* address of previous ucontext */ 485 short pr_syscall; /* system call number (if in syscall) */ 486 short pr_nsysarg; /* number of arguments to this syscall */ 487 int pr_errno; /* errno for failed syscall */ 488 long pr_sysarg[PRSYSARGS]; /* arguments to this syscall */ 489 long pr_rval1; /* primary syscall return value */ 490 long pr_rval2; /* second syscall return value, if any */ 491 char pr_clname[PRCLSZ]; /* scheduling class name */ 492 timestruc_t pr_tstamp; /* real-time time stamp of stop */ 493 timestruc_t pr_utime; /* lwp user cpu time */ 494 timestruc_t pr_stime; /* lwp system cpu time */ 495 uintptr_t pr_ustack; /* stack boundary data (stack_t) address */ 496 ulong_t pr_instr; /* current instruction */ 497 prgregset_t pr_reg; /* general registers */ 498 prfpregset_t pr_fpreg; /* floating-point registers */ 499 } lwpstatus_t; 500 .fi 501 .in -2 502 503 .sp 504 .LP 505 \fBpr_flags\fR is a bit-mask holding the following lwp flags. For convenience, 506 it also contains the process flags, described previously. 507 .sp 508 .ne 2 509 .na 510 \fB\fBPR_STOPPED\fR\fR 511 .ad 512 .RS 14n 513 The lwp is stopped. 514 .RE 515 516 .sp 517 .ne 2 518 .na 519 \fB\fBPR_ISTOP\fR\fR 520 .ad 521 .RS 14n 522 The lwp is stopped on an event of interest (see \fBPCSTOP\fR). 523 .RE 524 525 .sp 526 .ne 2 527 .na 528 \fB\fBPR_DSTOP\fR\fR 529 .ad 530 .RS 14n 531 The lwp has a stop directive in effect (see \fBPCSTOP\fR). 532 .RE 533 534 .sp 535 .ne 2 536 .na 537 \fB\fBPR_STEP\fR\fR 538 .ad 539 .RS 14n 540 The lwp has a single-step directive in effect (see \fBPCRUN\fR). 541 .RE 542 543 .sp 544 .ne 2 545 .na 546 \fB\fBPR_ASLEEP\fR\fR 547 .ad 548 .RS 14n 549 The lwp is in an interruptible sleep within a system call. 550 .RE 551 552 .sp 553 .ne 2 554 .na 555 \fB\fBPR_PCINVAL\fR\fR 556 .ad 557 .RS 14n 558 The lwp's current instruction (\fBpr_instr\fR) is undefined. 559 .RE 560 561 .sp 562 .ne 2 563 .na 564 \fB\fBPR_DETACH\fR\fR 565 .ad 566 .RS 14n 567 This is a detached lwp (see \fBpthread_create\fR(3C) and 568 \fBpthread_join\fR(3C)). 569 .RE 570 571 .sp 572 .ne 2 573 .na 574 \fB\fBPR_DAEMON\fR\fR 575 .ad 576 .RS 14n 577 This is a daemon lwp (see \fBpthread_create\fR(3C)). 578 .RE 579 580 .sp 581 .ne 2 582 .na 583 \fB\fBPR_ASLWP\fR\fR 584 .ad 585 .RS 14n 586 This flag is obsolete and is never set. 587 .RE 588 589 .sp 590 .ne 2 591 .na 592 \fB\fBPR_AGENT\fR\fR 593 .ad 594 .RS 14n 595 This is the \fB/proc\fR agent lwp for the process. 596 .RE 597 598 .sp 599 .LP 600 \fBpr_lwpid\fR names the specific lwp. 601 .sp 602 .LP 603 \fBpr_why\fR and \fBpr_what\fR together describe, for a stopped lwp, the reason 604 for the stop. Possible values of \fBpr_why\fR and the associated \fBpr_what\fR 605 are: 606 .sp 607 .ne 2 608 .na 609 \fB\fBPR_REQUESTED\fR\fR 610 .ad 611 .RS 17n 612 indicates that the stop occurred in response to a stop directive, normally 613 because \fBPCSTOP\fR was applied or because another lwp stopped on an event of 614 interest and the asynchronous-stop flag (see \fBPCSET\fR) was not set for the 615 process. \fBpr_what\fR is unused in this case. 616 .RE 617 618 .sp 619 .ne 2 620 .na 621 \fB\fBPR_SIGNALLED\fR\fR 622 .ad 623 .RS 17n 624 indicates that the lwp stopped on receipt of a signal (see \fBPCSTRACE\fR); 625 \fBpr_what\fR holds the signal number that caused the stop (for a newly-stopped 626 lwp, the same value is in \fBpr_cursig\fR). 627 .RE 628 629 .sp 630 .ne 2 631 .na 632 \fB\fBPR_FAULTED\fR\fR 633 .ad 634 .RS 17n 635 indicates that the lwp stopped on incurring a hardware fault (see 636 \fBPCSFAULT\fR); \fBpr_what\fR holds the fault number that caused the stop. 637 .RE 638 639 .sp 640 .ne 2 641 .na 642 \fB\fBPR_SYSENTRY\fR\fR 643 .ad 644 .br 645 .na 646 \fB\fBPR_SYSEXIT\fR\fR 647 .ad 648 .RS 17n 649 indicate a stop on entry to or exit from a system call (see \fBPCSENTRY\fR and 650 \fBPCSEXIT\fR); \fBpr_what\fR holds the system call number. 651 .RE 652 653 .sp 654 .ne 2 655 .na 656 \fB\fBPR_JOBCONTROL\fR\fR 657 .ad 658 .RS 17n 659 indicates that the lwp stopped due to the default action of a job control stop 660 signal (see \fBsigaction\fR(2)); \fBpr_what\fR holds the stopping signal 661 number. 662 .RE 663 664 .sp 665 .ne 2 666 .na 667 \fB\fBPR_SUSPENDED\fR\fR 668 .ad 669 .RS 17n 670 indicates that the lwp stopped due to internal synchronization of lwps within 671 the process. \fBpr_what\fR is unused in this case. 672 .RE 673 674 .sp 675 .LP 676 \fBpr_cursig\fR names the current signal, that is, the next signal to be 677 delivered to the lwp, if any. \fBpr_info\fR, when the lwp is in a 678 \fBPR_SIGNALLED\fR or \fBPR_FAULTED\fR stop, contains additional information 679 pertinent to the particular signal or fault (see \fB<sys/siginfo.h>\fR). 680 .sp 681 .LP 682 \fBpr_lwppend\fR identifies any synchronous or directed signals pending for the 683 lwp. \fBpr_lwphold\fR identifies those signals whose delivery is being blocked 684 by the lwp (the signal mask). 685 .sp 686 .LP 687 \fBpr_action\fR contains the signal action information pertaining to the 688 current signal (see \fBsigaction\fR(2)); it is undefined if \fBpr_cursig\fR is 689 zero. \fBpr_altstack\fR contains the alternate signal stack information for the 690 lwp (see \fBsigaltstack\fR(2)). 691 .sp 692 .LP 693 \fBpr_oldcontext\fR, if not zero, contains the address on the lwp stack of a 694 \fBucontext\fR structure describing the previous user-level context (see 695 \fBucontext.h\fR(3HEAD)). It is non-zero only if the lwp is executing in the 696 context of a signal handler. 697 .sp 698 .LP 699 \fBpr_syscall\fR is the number of the system call, if any, being executed by 700 the lwp; it is non-zero if and only if the lwp is stopped on \fBPR_SYSENTRY\fR 701 or \fBPR_SYSEXIT\fR, or is asleep within a system call ( \fBPR_ASLEEP\fR is 702 set). If \fBpr_syscall\fR is non-zero, \fBpr_nsysarg\fR is the number of 703 arguments to the system call and \fBpr_sysarg\fR contains the actual arguments. 704 .sp 705 .LP 706 \fBpr_rval1\fR, \fBpr_rval2\fR, and \fBpr_errno\fR are defined only if the lwp 707 is stopped on \fBPR_SYSEXIT\fR or if the \fBPR_VFORKP\fR flag is set. If 708 \fBpr_errno\fR is zero, \fBpr_rval1\fR and \fBpr_rval2\fR contain the return 709 values from the system call. Otherwise, \fBpr_errno\fR contains the error 710 number for the failing system call (see \fB<sys/errno.h>\fR). 711 .sp 712 .LP 713 \fBpr_clname\fR contains the name of the lwp's scheduling class. 714 .sp 715 .LP 716 \fBpr_tstamp\fR, if the lwp is stopped, contains a time stamp marking when the 717 lwp stopped, in real time seconds and nanoseconds since an arbitrary time in 718 the past. 719 .sp 720 .LP 721 \fBpr_utime\fR is the amount of user level CPU time used by this LWP. 722 .sp 723 .LP 724 \fBpr_stime\fR is the amount of system level CPU time used by this LWP. 725 .sp 726 .LP 727 \fBpr_ustack\fR is the virtual address of the \fBstack_t\fR that contains the 728 stack boundaries for this LWP. See \fBgetustack\fR(2) and 729 \fB_stack_grow\fR(3C). 730 .sp 731 .LP 732 \fBpr_instr\fR contains the machine instruction to which the lwp's program 733 counter refers. The amount of data retrieved from the process is 734 machine-dependent. On SPARC based machines, it is a 32-bit word. On x86-based 735 machines, it is a single byte. In general, the size is that of the machine's 736 smallest instruction. If \fBPR_PCINVAL\fR is set, \fBpr_instr\fR is undefined; 737 this occurs whenever the lwp is not stopped or when the program counter refers 738 to an invalid virtual address. 739 .sp 740 .LP 741 \fBpr_reg\fR is an array holding the contents of a stopped lwp's general 742 registers. 743 .sp 744 .ne 2 745 .na 746 \fBSPARC\fR 747 .ad 748 .RS 21n 749 On SPARC-based machines, the predefined constants \fBR_G0\fR ... \fBR_G7\fR, 750 \fBR_O0\fR ... \fBR_O7\fR, \fBR_L0\fR ... \fBR_L7\fR, \fBR_I0\fR ... 751 \fBR_I7\fR, \fBR_PC\fR, \fBR_nPC\fR, and \fBR_Y\fR can be used as indices to 752 refer to the corresponding registers; previous register windows can be read 753 from their overflow locations on the stack (however, see the \fBgwindows\fR 754 file in the \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR subdirectory). 755 .RE 756 757 .sp 758 .ne 2 759 .na 760 \fBSPARC V8 (32-bit)\fR 761 .ad 762 .RS 21n 763 For SPARC V8 (32-bit) controlling processes, the predefined constants 764 \fBR_PSR\fR, \fBR_WIM\fR, and \fBR_TBR\fR can be used as indices to refer to 765 the corresponding special registers. For SPARC V9 (64-bit) controlling 766 processes, the predefined constants \fBR_CCR\fR, \fBR_ASI\fR, and \fBR_FPRS\fR 767 can be used as indices to refer to the corresponding special registers. 768 .RE 769 770 .sp 771 .ne 2 772 .na 773 \fBx86 (32-bit)\fR 774 .ad 775 .RS 21n 776 For 32-bit x86 processes, the predefined constants listed belowcan be used as 777 indices to refer to the corresponding registers. 778 .sp 779 .in +2 780 .nf 781 SS 782 UESP 783 EFL 784 CS 785 EIP 786 ERR 787 TRAPNO 788 EAX 789 ECX 790 EDX 791 EBX 792 ESP 793 EBP 794 ESI 795 EDI 796 DS 797 ES 798 GS 799 .fi 800 .in -2 801 802 The preceding constants are listed in \fB<sys/regset.h>\fR\&. 803 .sp 804 Note that a 32-bit process can run on an x86 64-bit system, using the constants 805 listed above. 806 .RE 807 808 .sp 809 .ne 2 810 .na 811 \fBx86 (64-bit)\fR 812 .ad 813 .RS 21n 814 To read the registers of a 32- \fBor\fR a 64-bit process, a 64-bit x86 process 815 should use the predefined constants listed below. 816 .sp 817 .in +2 818 .nf 819 REG_GSBASE 820 REG_FSBASE 821 REG_DS 822 REG_ES 823 REG_GS 824 REG_FS 825 REG_SS 826 REG_RSP 827 REG_RFL 828 REG_CS 829 REG_RIP 830 REG_ERR 831 REG_TRAPNO 832 REG_RAX 833 REG_RCX 834 REG_RDX 835 REG_RBX 836 REG_RBP 837 REG_RSI 838 REG_RDI 839 REG_R8 840 REG_R9 841 REG_R10 842 REG_R11 843 REG_R12 844 REG_R13 845 REG_R14 846 REG_R15 847 .fi 848 .in -2 849 850 The preceding constants are listed in \fB<sys/regset.h>\fR\&. 851 .RE 852 853 .sp 854 .LP 855 \fBpr_fpreg\fR is a structure holding the contents of the floating-point 856 registers. 857 .sp 858 .LP 859 SPARC registers, both general and floating-point, as seen by a 64-bit 860 controlling process are the V9 versions of the registers, even if the target 861 process is a 32-bit (V8) process. V8 registers are a subset of the V9 862 registers. 863 .sp 864 .LP 865 If the lwp is not stopped, all register values are undefined. 866 .SS "psinfo" 867 .sp 868 .LP 869 Contains miscellaneous information about the process and the representative lwp 870 needed by the \fBps\fR(1) command. \fBpsinfo\fR remains accessible after a 871 process becomes a \fIzombie\fR. The file contains a \fBpsinfo\fR structure 872 which contains an embedded \fBlwpsinfo\fR structure for the representative lwp, 873 as follows: 874 .sp 875 .in +2 876 .nf 877 typedef struct psinfo { 878 int pr_flag; /* process flags (DEPRECATED: see below) */ 879 int pr_nlwp; /* number of active lwps in the process */ 880 int pr_nzomb; /* number of zombie lwps in the process */ 881 pid_t pr_pid; /* process id */ 882 pid_t pr_ppid; /* process id of parent */ 883 pid_t pr_pgid; /* process id of process group leader */ 884 pid_t pr_sid; /* session id */ 885 uid_t pr_uid; /* real user id */ 886 uid_t pr_euid; /* effective user id */ 887 gid_t pr_gid; /* real group id */ 888 gid_t pr_egid; /* effective group id */ 889 uintptr_t pr_addr; /* address of process */ 890 size_t pr_size; /* size of process image in Kbytes */ 891 size_t pr_rssize; /* resident set size in Kbytes */ 892 dev_t pr_ttydev; /* controlling tty device (or PRNODEV) */ 893 ushort_t pr_pctcpu; /* % of recent cpu time used by all lwps */ 894 ushort_t pr_pctmem; /* % of system memory used by process */ 895 timestruc_t pr_start; /* process start time, from the epoch */ 896 timestruc_t pr_time; /* cpu time for this process */ 897 timestruc_t pr_ctime; /* cpu time for reaped children */ 898 char pr_fname[PRFNSZ]; /* name of exec'ed file */ 899 char pr_psargs[PRARGSZ]; /* initial characters of arg list */ 900 int pr_wstat; /* if zombie, the wait() status */ 901 int pr_argc; /* initial argument count */ 902 uintptr_t pr_argv; /* address of initial argument vector */ 903 uintptr_t pr_envp; /* address of initial environment vector */ 904 char pr_dmodel; /* data model of the process */ 905 lwpsinfo_t pr_lwp; /* information for representative lwp */ 906 taskid_t pr_taskid; /* task id */ 907 projid_t pr_projid; /* project id */ 908 poolid_t pr_poolid; /* pool id */ 909 zoneid_t pr_zoneid; /* zone id */ 910 ctid_t pr_contract; /* process contract id */ 911 } psinfo_t; 912 .fi 913 .in -2 914 915 .sp 916 .LP 917 Some of the entries in \fBpsinfo\fR, such as \fBpr_addr\fR, refer to internal 918 kernel data structures and should not be expected to retain their meanings 919 across different versions of the operating system. 920 .sp 921 .LP 922 \fBpsinfo_t.pr_flag\fR is a deprecated interface that should no longer be used. 923 Applications currently relying on the \fBSSYS\fR bit in \fBpr_flag\fR should 924 migrate to checking \fBPR_ISSYS\fR in the \fBpstatus\fR structure's 925 \fBpr_flags\fR field. 926 .sp 927 .LP 928 \fBpr_pctcpu\fR and \fBpr_pctmem\fR are 16-bit binary fractions in the range 929 0.0 to 1.0 with the binary point to the right of the high-order bit (1.0 == 930 0x8000). \fBpr_pctcpu\fR is the summation over all lwps in the process. 931 .sp 932 .LP 933 \fBpr_lwp\fR contains the \fBps\fR(1) information for the representative lwp. 934 If the process is a \fIzombie\fR, \fBpr_nlwp\fR, \fBpr_nzomb\fR, and 935 \fBpr_lwp.pr_lwpid\fR are zero and the other fields of \fBpr_lwp\fR are 936 undefined: 937 .sp 938 .in +2 939 .nf 940 typedef struct lwpsinfo { 941 int pr_flag; /* lwp flags (DEPRECATED: see below) */ 942 id_t pr_lwpid; /* lwp id */ 943 uintptr_t pr_addr; /* internal address of lwp */ 944 uintptr_t pr_wchan; /* wait addr for sleeping lwp */ 945 char pr_stype; /* synchronization event type */ 946 char pr_state; /* numeric lwp state */ 947 char pr_sname; /* printable character for pr_state */ 948 char pr_nice; /* nice for cpu usage */ 949 short pr_syscall; /* system call number (if in syscall) */ 950 char pr_oldpri; /* pre-SVR4, low value is high priority */ 951 char pr_cpu; /* pre-SVR4, cpu usage for scheduling */ 952 int pr_pri; /* priority, high value = high priority */ 953 ushort_t pr_pctcpu; /* % of recent cpu time used by this lwp */ 954 timestruc_t pr_start; /* lwp start time, from the epoch */ 955 timestruc_t pr_time; /* cpu time for this lwp */ 956 char pr_clname[PRCLSZ]; /* scheduling class name */ 957 char pr_name[PRFNSZ]; /* name of system lwp */ 958 processorid_t pr_onpro; /* processor which last ran this lwp */ 959 processorid_t pr_bindpro;/* processor to which lwp is bound */ 960 psetid_t pr_bindpset; /* processor set to which lwp is bound */ 961 lgrp_id_t pr_lgrp /* home lgroup */ 962 } lwpsinfo_t; 963 .fi 964 .in -2 965 966 .sp 967 .LP 968 Some of the entries in \fBlwpsinfo\fR, such as \fBpr_addr\fR, \fBpr_wchan\fR, 969 \fBpr_stype\fR, \fBpr_state\fR, and \fBpr_name\fR, refer to internal kernel 970 data structures and should not be expected to retain their meanings across 971 different versions of the operating system. 972 .sp 973 .LP 974 \fBlwpsinfo_t.pr_flag\fR is a deprecated interface that should no longer be 975 used. 976 .sp 977 .LP 978 \fBpr_pctcpu\fR is a 16-bit binary fraction, as described above. It represents 979 the \fBCPU\fR time used by the specific lwp. On a multi-processor machine, the 980 maximum value is 1/N, where N is the number of \fBCPU\fRs. 981 .sp 982 .LP 983 \fBpr_contract\fR is the id of the process contract of which the process is a 984 member. See \fBcontract\fR(4) and \fBprocess\fR(4). 985 .SS "cred" 986 .sp 987 .LP 988 Contains a description of the credentials associated with the process: 989 .sp 990 .in +2 991 .nf 992 typedef struct prcred { 993 uid_t pr_euid; /* effective user id */ 994 uid_t pr_ruid; /* real user id */ 995 uid_t pr_suid; /* saved user id (from exec) */ 996 gid_t pr_egid; /* effective group id */ 997 gid_t pr_rgid; /* real group id */ 998 gid_t pr_sgid; /* saved group id (from exec) */ 999 int pr_ngroups; /* number of supplementary groups */ 1000 gid_t pr_groups[1]; /* array of supplementary groups */ 1001 } prcred_t; 1002 .fi 1003 .in -2 1004 .sp 1005 1006 .sp 1007 .LP 1008 The array of associated supplementary groups in \fBpr_groups\fR is of variable 1009 length; the \fBcred\fR file contains all of the supplementary groups. 1010 \fBpr_ngroups\fR indicates the number of supplementary groups. (See also the 1011 \fBPCSCRED\fR and \fBPCSCREDX\fR control operations.) 1012 .SS "priv" 1013 .sp 1014 .LP 1015 Contains a description of the privileges associated with the process: 1016 .sp 1017 .in +2 1018 .nf 1019 typedef struct prpriv { 1020 uint32_t pr_nsets; /* number of privilege set */ 1021 uint32_t pr_setsize; /* size of privilege set */ 1022 uint32_t pr_infosize; /* size of supplementary data */ 1023 priv_chunk_t pr_sets[1]; /* array of sets */ 1024 } prpriv_t; 1025 .fi 1026 .in -2 1027 1028 .sp 1029 .LP 1030 The actual dimension of the \fBpr_sets\fR[] field is 1031 .sp 1032 .in +2 1033 .nf 1034 pr_sets[pr_nsets][pr_setsize] 1035 .fi 1036 .in -2 1037 1038 .sp 1039 .LP 1040 which is followed by additional information about the process state 1041 \fBpr_infosize\fR bytes in size. 1042 .sp 1043 .LP 1044 The full size of the structure can be computed using 1045 \fBPRIV_PRPRIV_SIZE\fR(\fBprpriv_t *\fR). 1046 .SS "sigact" 1047 .sp 1048 .LP 1049 Contains an array of \fBsigaction structures\fR describing the current 1050 dispositions of all signals associated with the traced process (see 1051 \fBsigaction\fR(2)). Signal numbers are displaced by 1 from array indices, so 1052 that the action for signal number \fIn\fR appears in position \fIn\fR-1 of the 1053 array. 1054 .SS "auxv" 1055 .sp 1056 .LP 1057 Contains the initial values of the process's aux vector in an array of 1058 \fBauxv_t\fR structures (see \fB<sys/auxv.h>\fR). The values are those that 1059 were passed by the operating system as startup information to the dynamic 1060 linker. 1061 .SS "ldt" 1062 .sp 1063 .LP 1064 This file exists only on x86-based machines. It is non-empty only if the 1065 process has established a local descriptor table (\fBLDT\fR). If non-empty, the 1066 file contains the array of currently active \fBLDT\fR entries in an array of 1067 elements of type \fBstruct ssd\fR, defined in \fB<sys/sysi86.h>\fR, one element 1068 for each active \fBLDT\fR entry. 1069 .SS "map, xmap" 1070 .sp 1071 .LP 1072 Contain information about the virtual address map of the process. The map file 1073 contains an array of \fBprmap\fR structures while the xmap file contains an 1074 array of \fBprxmap\fR structures. Each structure describes a contiguous virtual 1075 address region in the address space of the traced process: 1076 .sp 1077 .in +2 1078 .nf 1079 typedef struct prmap { 1080 uintptr_tpr_vaddr; /* virtual address of mapping */ 1081 size_t pr_size; /* size of mapping in bytes */ 1082 char pr_mapname[PRMAPSZ]; /* name in /proc/pid/object */ 1083 offset_t pr_offset; /* offset into mapped object, if any */ 1084 int pr_mflags; /* protection and attribute flags */ 1085 int pr_pagesize; /* pagesize for this mapping in bytes */ 1086 int pr_shmid; /* SysV shared memory identifier */ 1087 } prmap_t; 1088 .fi 1089 .in -2 1090 .sp 1091 1092 .sp 1093 .in +2 1094 .nf 1095 typedef struct prxmap { 1096 uintptr_t pr_vaddr; /* virtual address of mapping */ 1097 size_t pr_size; /* size of mapping in bytes */ 1098 char pr_mapname[PRMAPSZ]; /* name in /proc/pid/object */ 1099 offset_t pr_offset; /* offset into mapped object, if any */ 1100 int pr_mflags; /* protection and attribute flags */ 1101 int pr_pagesize; /* pagesize for this mapping in bytes */ 1102 int pr_shmid; /* SysV shared memory identifier */ 1103 dev_t pr_dev; /* device of mapped object, if any */ 1104 uint64_t pr_ino; /* inode of mapped object, if any */ 1105 size_t pr_rss; /* pages of resident memory */ 1106 size_t pr_anon; /* pages of resident anonymous memory */ 1107 size_t pr_locked; /* pages of locked memory */ 1108 uint64_t pr_hatpagesize; /* pagesize of mapping */ 1109 } prxmap_t; 1110 .fi 1111 .in -2 1112 .sp 1113 1114 .sp 1115 .LP 1116 \fBpr_vaddr\fR is the virtual address of the mapping within the traced process 1117 and \fBpr_size\fR is its size in bytes. \fBpr_mapname\fR, if it does not 1118 contain a null string, contains the name of a file in the \fBobject\fR 1119 directory (see below) that can be opened read-only to obtain a file descriptor 1120 for the mapped file associated with the mapping. This enables a debugger to 1121 find object file symbol tables without having to know the real path names of 1122 the executable file and shared libraries of the process. \fBpr_offset\fR is the 1123 64-bit offset within the mapped file (if any) to which the virtual address is 1124 mapped. 1125 .sp 1126 .LP 1127 \fBpr_mflags\fR is a bit-mask of protection and attribute flags: 1128 .sp 1129 .ne 2 1130 .na 1131 \fB\fBMA_READ\fR\fR 1132 .ad 1133 .RS 17n 1134 mapping is readable by the traced process. 1135 .RE 1136 1137 .sp 1138 .ne 2 1139 .na 1140 \fB\fBMA_WRITE\fR\fR 1141 .ad 1142 .RS 17n 1143 mapping is writable by the traced process. 1144 .RE 1145 1146 .sp 1147 .ne 2 1148 .na 1149 \fB\fBMA_EXEC\fR\fR 1150 .ad 1151 .RS 17n 1152 mapping is executable by the traced process. 1153 .RE 1154 1155 .sp 1156 .ne 2 1157 .na 1158 \fB\fBMA_SHARED\fR\fR 1159 .ad 1160 .RS 17n 1161 mapping changes are shared by the mapped object. 1162 .RE 1163 1164 .sp 1165 .ne 2 1166 .na 1167 \fB\fBMA_ISM\fR\fR 1168 .ad 1169 .RS 17n 1170 mapping is intimate shared memory (shared MMU resources) 1171 .RE 1172 1173 .sp 1174 .ne 2 1175 .na 1176 \fB\fBMAP_NORESERVE\fR\fR 1177 .ad 1178 .RS 17n 1179 mapping does not have swap space reserved (mapped with MAP_NORESERVE) 1180 .RE 1181 1182 .sp 1183 .ne 2 1184 .na 1185 \fB\fBMA_SHM\fR\fR 1186 .ad 1187 .RS 17n 1188 mapping System V shared memory 1189 .RE 1190 1191 .sp 1192 .LP 1193 A contiguous area of the address space having the same underlying mapped object 1194 may appear as multiple mappings due to varying read, write, and execute 1195 attributes. The underlying mapped object does not change over the range of a 1196 single mapping. An \fBI/O\fR operation to a mapping marked \fBMA_SHARED\fR 1197 fails if applied at a virtual address not corresponding to a valid page in the 1198 underlying mapped object. A write to a \fBMA_SHARED\fR mapping that is not 1199 marked \fBMA_WRITE\fR fails. Reads and writes to private mappings always 1200 succeed. Reads and writes to unmapped addresses fail. 1201 .sp 1202 .LP 1203 \fBpr_pagesize\fR is the page size for the mapping, currently always the system 1204 pagesize. 1205 .sp 1206 .LP 1207 \fBpr_shmid\fR is the shared memory identifier, if any, for the mapping. Its 1208 value is \fB\(mi1\fR if the mapping is not System V shared memory. See 1209 \fBshmget\fR(2). 1210 .sp 1211 .LP 1212 \fBpr_dev\fR is the device of the mapped object, if any, for the mapping. Its 1213 value is \fBPRNODEV\fR (-1) if the mapping does not have a device. 1214 .sp 1215 .LP 1216 \fBpr_ino\fR is the inode of the mapped object, if any, for the mapping. Its 1217 contents are only valid if \fBpr_dev\fR is not \fBPRNODEV.\fR 1218 .sp 1219 .LP 1220 \fBpr_rss\fR is the number of resident pages of memory for the mapping. The 1221 number of resident bytes for the mapping may be determined by multiplying 1222 \fBpr_rss\fR by the page size given by \fBpr_pagesize.\fR 1223 .sp 1224 .LP 1225 \fBpr_anon\fR is the number of resident anonymous memory pages (pages which are 1226 private to this process) for the mapping. 1227 .sp 1228 .LP 1229 \fBpr_locked\fR is the number of locked pages for the mapping. Pages which are 1230 locked are always resident in memory. 1231 .sp 1232 .LP 1233 \fBpr_hatpagesize\fR is the size, in bytes, of the \fBHAT\fR (\fBMMU\fR) 1234 translation for the mapping. \fBpr_hatpagesize\fR may be different than 1235 \fBpr_pagesize.\fR The possible values are hardware architecture specific, and 1236 may change over a mapping's lifetime. 1237 .SS "rmap" 1238 .sp 1239 .LP 1240 Contains information about the reserved address ranges of the process. The file 1241 contains an array of \fBprmap\fR structures, as defined above for the \fBmap\fR 1242 file. Each structure describes a contiguous virtual address region in the 1243 address space of the traced process that is reserved by the system in the sense 1244 that an \fBmmap\fR(2) system call that does not specify \fBMAP_FIXED\fR will 1245 not use any part of it for the new mapping. Examples of such reservations 1246 include the address ranges reserved for the process stack and the individual 1247 thread stacks of a multi-threaded process. 1248 .SS "cwd" 1249 .sp 1250 .LP 1251 A symbolic link to the process's current working directory. See \fBchdir\fR(2). 1252 A \fBreadlink\fR(2) of \fB/proc/\fIpid\fR/cwd\fR yields a null string. However, 1253 it can be opened, listed, and searched as a directory, and can be the target of 1254 \fBchdir\fR(2). 1255 .SS "root" 1256 .sp 1257 .LP 1258 A symbolic link to the process's root directory. 1259 \fB/proc/\fR\fIpid\fR\fB/root\fR can differ from the system root directory if 1260 the process or one of its ancestors executed \fBchroot\fR(2) as super user. It 1261 has the same semantics as \fB/proc/\fR\fIpid\fR\fB/cwd\fR. 1262 .SS "fd" 1263 .sp 1264 .LP 1265 A directory containing references to the open files of the process. Each entry 1266 is a decimal number corresponding to an open file descriptor in the process. 1267 .sp 1268 .LP 1269 If an entry refers to a regular file, it can be opened with normal file system 1270 semantics but, to ensure that the controlling process cannot gain greater 1271 access than the controlled process, with no file access modes other than its 1272 read/write open modes in the controlled process. If an entry refers to a 1273 directory, it can be accessed with the same semantics as 1274 \fB/proc/\fIpid\fR/cwd\fR. An attempt to open any other type of entry fails 1275 with \fBEACCES\fR. 1276 .SS "object" 1277 .sp 1278 .LP 1279 A directory containing read-only files with names corresponding to the 1280 \fBpr_mapname\fR entries in the \fBmap\fR and \fBpagedata\fR files. Opening 1281 such a file yields a file descriptor for the underlying mapped file associated 1282 with an address-space mapping in the process. The file name \fBa.out\fR appears 1283 in the directory as an alias for the process's executable file. 1284 .sp 1285 .LP 1286 The \fBobject\fR directory makes it possible for a controlling process to gain 1287 access to the object file and any shared libraries (and consequently the symbol 1288 tables) without having to know the actual path names of the executable files. 1289 .SS "path" 1290 .sp 1291 .LP 1292 A directory containing symbolic links to files opened by the process. The 1293 directory includes one entry for \fBcwd\fR and \fBroot\fR. The directory also 1294 contains a numerical entry for each file descriptor in the \fBfd\fR directory, 1295 and entries matching those in the \fBobject\fR directory. If this information 1296 is not available, any attempt to read the contents of the symbolic link will 1297 fail. This is most common for files that do not exist in the filesystem 1298 namespace (such as \fBFIFO\fRs and sockets), but can also happen for regular 1299 files. For the file descriptor entries, the path may be different from the one 1300 used by the process to open the file. 1301 .SS "pagedata" 1302 .sp 1303 .LP 1304 Opening the page data file enables tracking of address space references and 1305 modifications on a per-page basis. 1306 .sp 1307 .LP 1308 A \fBread\fR(2) of the page data file descriptor returns structured page data 1309 and atomically clears the page data maintained for the file by the system. That 1310 is to say, each read returns data collected since the last read; the first read 1311 returns data collected since the file was opened. When the call completes, the 1312 read buffer contains the following structure as its header and thereafter 1313 contains a number of section header structures and associated byte arrays that 1314 must be accessed by walking linearly through the buffer. 1315 .sp 1316 .in +2 1317 .nf 1318 typedef struct prpageheader { 1319 timestruc_t pr_tstamp; /* real time stamp, time of read() */ 1320 ulong_t pr_nmap; /* number of address space mappings */ 1321 ulong_t pr_npage; /* total number of pages */ 1322 } prpageheader_t; 1323 .fi 1324 .in -2 1325 1326 .sp 1327 .LP 1328 The header is followed by \fBpr_nmap prasmap\fR structures and associated data 1329 arrays. The \fBprasmap\fR structure contains the following elements: 1330 .sp 1331 .in +2 1332 .nf 1333 typedef struct prasmap { 1334 uintptr_t pr_vaddr; /* virtual address of mapping */ 1335 ulong_t pr_npage; /* number of pages in mapping */ 1336 char pr_mapname[PRMAPSZ]; /* name in /proc/pid/object */ 1337 offset_t pr_offset; /* offset into mapped object, if any */ 1338 int pr_mflags; /* protection and attribute flags */ 1339 int pr_pagesize; /* pagesize for this mapping in bytes */ 1340 int pr_shmid; /* SysV shared memory identifier */ 1341 } prasmap_t; 1342 .fi 1343 .in -2 1344 1345 .sp 1346 .LP 1347 Each section header is followed by \fBpr_npage\fR bytes, one byte for each page 1348 in the mapping, plus 0-7 null bytes at the end so that the next \fBprasmap\fR 1349 structure begins on an eight-byte aligned boundary. Each data byte may contain 1350 these flags: 1351 .sp 1352 .ne 2 1353 .na 1354 \fB\fBPG_REFERENCED\fR\fR 1355 .ad 1356 .RS 17n 1357 page has been referenced. 1358 .RE 1359 1360 .sp 1361 .ne 2 1362 .na 1363 \fB\fBPG_MODIFIED\fR\fR 1364 .ad 1365 .RS 17n 1366 page has been modified. 1367 .RE 1368 1369 .sp 1370 .LP 1371 If the read buffer is not large enough to contain all of the page data, the 1372 read fails with \fBE2BIG\fR and the page data is not cleared. The required size 1373 of the read buffer can be determined through \fBfstat\fR(2). Application of 1374 \fBlseek\fR(2) to the page data file descriptor is ineffective; every read 1375 starts from the beginning of the file. Closing the page data file descriptor 1376 terminates the system overhead associated with collecting the data. 1377 .sp 1378 .LP 1379 More than one page data file descriptor for the same process can be opened, up 1380 to a system-imposed limit per traced process. A read of one does not affect the 1381 data being collected by the system for the others. An open of the page data 1382 file will fail with \fBENOMEM\fR if the system-imposed limit would be exceeded. 1383 .SS "watch" 1384 .sp 1385 .LP 1386 Contains an array of \fBprwatch\fR structures, one for each watched area 1387 established by the \fBPCWATCH\fR control operation. See \fBPCWATCH\fR for 1388 details. 1389 .SS "usage" 1390 .sp 1391 .LP 1392 Contains process usage information described by a \fBprusage\fR structure which 1393 contains at least the following fields: 1394 .sp 1395 .in +2 1396 .nf 1397 typedef struct prusage { 1398 id_t pr_lwpid; /* lwp id. 0: process or defunct */ 1399 int pr_count; /* number of contributing lwps */ 1400 timestruc_t pr_tstamp; /* real time stamp, time of read() */ 1401 timestruc_t pr_create; /* process/lwp creation time stamp */ 1402 timestruc_t pr_term; /* process/lwp termination time stamp */ 1403 timestruc_t pr_rtime; /* total lwp real (elapsed) time */ 1404 timestruc_t pr_utime; /* user level CPU time */ 1405 timestruc_t pr_stime; /* system call CPU time */ 1406 timestruc_t pr_ttime; /* other system trap CPU time */ 1407 timestruc_t pr_tftime; /* text page fault sleep time */ 1408 timestruc_t pr_dftime; /* data page fault sleep time */ 1409 timestruc_t pr_kftime; /* kernel page fault sleep time */ 1410 timestruc_t pr_ltime; /* user lock wait sleep time */ 1411 timestruc_t pr_slptime; /* all other sleep time */ 1412 timestruc_t pr_wtime; /* wait-cpu (latency) time */ 1413 timestruc_t pr_stoptime; /* stopped time */ 1414 ulong_t pr_minf; /* minor page faults */ 1415 ulong_t pr_majf; /* major page faults */ 1416 ulong_t pr_nswap; /* swaps */ 1417 ulong_t pr_inblk; /* input blocks */ 1418 ulong_t pr_oublk; /* output blocks */ 1419 ulong_t pr_msnd; /* messages sent */ 1420 ulong_t pr_mrcv; /* messages received */ 1421 ulong_t pr_sigs; /* signals received */ 1422 ulong_t pr_vctx; /* voluntary context switches */ 1423 ulong_t pr_ictx; /* involuntary context switches */ 1424 ulong_t pr_sysc; /* system calls */ 1425 ulong_t pr_ioch; /* chars read and written */ 1426 } prusage_t; 1427 .fi 1428 .in -2 1429 1430 .sp 1431 .LP 1432 Microstate accounting is now continuously enabled. While this information was 1433 previously an estimate, if microstate accounting were not enabled, the current 1434 information is now never an estimate represents time the process has spent in 1435 various states. 1436 .SS "lstatus" 1437 .sp 1438 .LP 1439 Contains a \fBprheader\fR structure followed by an array of \fBlwpstatus\fR 1440 structures, one for each active lwp in the process (see also 1441 \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR/\fBlwpstatus\fR, below). The 1442 \fBprheader\fR structure describes the number and size of the array entries 1443 that follow. 1444 .sp 1445 .in +2 1446 .nf 1447 typedef struct prheader { 1448 long pr_nent; /* number of entries */ 1449 size_t pr_entsize; /* size of each entry, in bytes */ 1450 } prheader_t; 1451 .fi 1452 .in -2 1453 1454 .sp 1455 .LP 1456 The \fBlwpstatus\fR structure may grow by the addition of elements at the end 1457 in future releases of the system. Programs must use \fBpr_entsize\fR in the 1458 file header to index through the array. These comments apply to all \fB/proc\fR 1459 files that include a \fBprheader\fR structure (\fBlpsinfo\fR and \fBlusage\fR, 1460 below). 1461 .SS "lpsinfo" 1462 .sp 1463 .LP 1464 Contains a \fBprheader\fR structure followed by an array of \fBlwpsinfo\fR 1465 structures, one for eachactive and zombie lwp in the process. See also 1466 \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR/\fBlwpsinfo\fR, below. 1467 .SS "lusage" 1468 .sp 1469 .LP 1470 Contains a \fBprheader\fR structure followed by an array of \fBprusage\fR 1471 structures, one for each active lwp in the process, plus an additional element 1472 at the beginning that contains the summation over all defunct lwps (lwps that 1473 once existed but no longer exist in the process). Excluding the \fBpr_lwpid\fR, 1474 \fBpr_tstamp\fR, \fBpr_create\fR, and \fBpr_term\fR entries, the entry-by-entry 1475 summation over all these structures is the definition of the process usage 1476 information obtained from the \fBusage\fR file. (See also 1477 \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR/\fBlwpusage\fR, below.) 1478 .SS "lwp" 1479 .sp 1480 .LP 1481 A directory containing entries each of which names an active or zombie lwp 1482 within the process. These entries are themselves directories containing 1483 additional files as described below. Only the \fBlwpsinfo\fR file exists in the 1484 directory of a zombie lwp. 1485 .SH STRUCTURE OF \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR 1486 .sp 1487 .LP 1488 A given directory \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid\fR contains the 1489 following entries: 1490 .SS "lwpctl" 1491 .sp 1492 .LP 1493 Write-only control file. The messages written to this file affect the specific 1494 lwp rather than the representative lwp, as is the case for the process's 1495 \fBctl\fR file. 1496 .SS "lwpstatus" 1497 .sp 1498 .LP 1499 lwp-specific state information. This file contains the \fBlwpstatus\fR 1500 structure for the specific lwp as described above for the representative lwp in 1501 the process's \fBstatus\fR file. 1502 .SS "lwpsinfo" 1503 .sp 1504 .LP 1505 lwp-specific \fBps\fR(1) information. This file contains the \fBlwpsinfo\fR 1506 structure for the specific lwp as described above for the representative lwp in 1507 the process's \fBpsinfo\fR file. The \fBlwpsinfo\fR file remains accessible 1508 after an lwp becomes a zombie. 1509 .SS "lwpusage" 1510 .sp 1511 .LP 1512 This file contains the \fBprusage\fR structure for the specific lwp as 1513 described above for the process's \fBusage\fR file. 1514 .SS "gwindows" 1515 .sp 1516 .LP 1517 This file exists only on SPARC based machines. If it is non-empty, it contains 1518 a \fBgwindows_t\fR structure, defined in \fB<sys/regset.h>\fR, with the values 1519 of those SPARC register windows that could not be stored on the stack when the 1520 lwp stopped. Conditions under which register windows are not stored on the 1521 stack are: the stack pointer refers to nonexistent process memory or the stack 1522 pointer is improperly aligned. If the lwp is not stopped or if there are no 1523 register windows that could not be stored on the stack, the file is empty (the 1524 usual case). 1525 .SS "xregs" 1526 .sp 1527 .LP 1528 Extra state registers. The extra state register set is architecture dependent; 1529 this file is empty if the system does not support extra state registers. If the 1530 file is non-empty, it contains an architecture dependent structure of type 1531 \fBprxregset_t\fR, defined in \fB<procfs.h>\fR, with the values of the lwp's 1532 extra state registers. If the lwp is not stopped, all register values are 1533 undefined. See also the \fBPCSXREG\fR control operation, below. 1534 .SS "asrs" 1535 .sp 1536 .LP 1537 This file exists only for 64-bit SPARC V9 processes. It contains an 1538 \fBasrset_t\fR structure, defined in <\fBsys/regset.h\fR>, containing the 1539 values of the lwp's platform-dependent ancillary state registers. If the lwp is 1540 not stopped, all register values are undefined. See also the \fBPCSASRS\fR 1541 control operation, below. 1542 .SS "spymaster" 1543 .sp 1544 .LP 1545 For an agent lwp (see \fBPCAGENT\fR), this file contains a \fBpsinfo_t\fR 1546 structure that corresponds to the process that created the agent lwp at the 1547 time the agent was created. This structure is identical to that retrieved via 1548 the \fBpsinfo\fR file, with one modification: the \fBpr_time\fR field does not 1549 correspond to the CPU time for the process, but rather to the creation time of 1550 the agent lwp. 1551 .SS "templates" 1552 .sp 1553 .LP 1554 A directory which contains references to the active templates for the lwp, 1555 named by the contract type. Changes made to an active template descriptor do 1556 not affect the original template which was activated, though they do affect the 1557 active template. It is not possible to activate an active template descriptor. 1558 See \fBcontract\fR(4). 1559 .SH CONTROL MESSAGES 1560 .sp 1561 .LP 1562 Process state changes are effected through messages written to a process's 1563 \fBctl\fR file or to an individual lwp's \fBlwpctl\fR file. All control 1564 messages consist of a \fBlong\fR that names the specific operation followed by 1565 additional data containing the operand, if any. 1566 .sp 1567 .LP 1568 Multiple control messages may be combined in a single \fBwrite\fR(2) (or 1569 \fBwritev\fR(2)) to a control file, but no partial writes are permitted. That 1570 is, each control message, operation code plus operand, if any, must be 1571 presented in its entirety to the \fBwrite\fR(2) and not in pieces over several 1572 system calls. If a control operation fails, no subsequent operations contained 1573 in the same \fBwrite\fR(2) are attempted. 1574 .sp 1575 .LP 1576 Descriptions of the allowable control messages follow. In all cases, writing a 1577 message to a control file for a process or lwp that has terminated elicits the 1578 error \fBENOENT\fR. 1579 .SS "PCSTOP PCDSTOP PCWSTOP PCTWSTOP" 1580 .sp 1581 .LP 1582 When applied to the process control file, \fBPCSTOP\fR directs all lwps to stop 1583 and waits for them to stop, \fBPCDSTOP\fR directs all lwps to stop without 1584 waiting for them to stop, and \fBPCWSTOP\fR simply waits for all lwps to stop. 1585 When applied to an lwp control file, \fBPCSTOP\fR directs the specific lwp to 1586 stop and waits until it has stopped, \fBPCDSTOP\fR directs the specific lwp to 1587 stop without waiting for it to stop, and \fBPCWSTOP\fR simply waits for the 1588 specific lwp to stop. When applied to an lwp control file, \fBPCSTOP\fR and 1589 \fBPCWSTOP\fR complete when the lwp stops on an event of interest, immediately 1590 if already so stopped; when applied to the process control file, they complete 1591 when every lwp has stopped either on an event of interest or on a 1592 \fBPR_SUSPENDED\fR stop. 1593 .sp 1594 .LP 1595 \fBPCTWSTOP\fR is identical to \fBPCWSTOP\fR except that it enables the 1596 operation to time out, to avoid waiting forever for a process or lwp that may 1597 never stop on an event of interest. \fBPCTWSTOP\fR takes a \fBlong\fR operand 1598 specifying a number of milliseconds; the wait will terminate successfully after 1599 the specified number of milliseconds even if the process or lwp has not 1600 stopped; a timeout value of zero makes the operation identical to 1601 \fBPCWSTOP\fR. 1602 .sp 1603 .LP 1604 An ``event of interest'' is either a \fBPR_REQUESTED\fR stop or a stop that has 1605 been specified in the process's tracing flags (set by \fBPCSTRACE\fR, 1606 \fBPCSFAULT\fR, \fBPCSENTRY\fR, and \fBPCSEXIT\fR). \fBPR_JOBCONTROL\fR and 1607 \fBPR_SUSPENDED\fR stops are specifically not events of interest. (An lwp may 1608 stop twice due to a stop signal, first showing \fBPR_SIGNALLED\fR if the signal 1609 is traced and again showing \fBPR_JOBCONTROL\fR if the lwp is set running 1610 without clearing the signal.) If \fBPCSTOP\fR or \fBPCDSTOP\fR is applied to an 1611 lwp that is stopped, but not on an event of interest, the stop directive takes 1612 effect when the lwp is restarted by the competing mechanism. At that time, the 1613 lwp enters a \fBPR_REQUESTED\fR stop before executing any user-level code. 1614 .sp 1615 .LP 1616 A write of a control message that blocks is interruptible by a signal so that, 1617 for example, an \fBalarm\fR(2) can be set to avoid waiting forever for a 1618 process or lwp that may never stop on an event of interest. If \fBPCSTOP\fR is 1619 interrupted, the lwp stop directives remain in effect even though the 1620 \fBwrite\fR(2) returns an error. (Use of \fBPCTWSTOP\fR with a non-zero timeout 1621 is recommended over \fBPCWSTOP\fR with an \fBalarm\fR(2).) 1622 .sp 1623 .LP 1624 A system process (indicated by the \fBPR_ISSYS\fR flag) never executes at user 1625 level, has no user-level address space visible through \fB/proc\fR, and cannot 1626 be stopped. Applying one of these operations to a system process or any of its 1627 lwps elicits the error \fBEBUSY\fR. 1628 .SS "PCRUN" 1629 .sp 1630 .LP 1631 Make an lwp runnable again after a stop. This operation takes a \fBlong\fR 1632 operand containing zero or more of the following flags: 1633 .sp 1634 .ne 2 1635 .na 1636 \fB\fBPRCSIG\fR\fR 1637 .ad 1638 .RS 12n 1639 clears the current signal, if any (see \fBPCCSIG\fR). 1640 .RE 1641 1642 .sp 1643 .ne 2 1644 .na 1645 \fB\fBPRCFAULT\fR\fR 1646 .ad 1647 .RS 12n 1648 clears the current fault, if any (see \fBPCCFAULT\fR). 1649 .RE 1650 1651 .sp 1652 .ne 2 1653 .na 1654 \fB\fBPRSTEP\fR\fR 1655 .ad 1656 .RS 12n 1657 directs the lwp to execute a single machine instruction. On completion of the 1658 instruction, a trace trap occurs. If \fBFLTTRACE\fR is being traced, the lwp 1659 stops; otherwise, it is sent \fBSIGTRAP\fR. If \fBSIGTRAP\fR is being traced 1660 and is not blocked, the lwp stops. When the lwp stops on an event of interest, 1661 the single-step directive is cancelled, even if the stop occurs before the 1662 instruction is executed. This operation requires hardware and operating system 1663 support and may not be implemented on all processors. It is implemented on 1664 SPARC and x86-based machines. 1665 .RE 1666 1667 .sp 1668 .ne 2 1669 .na 1670 \fB\fBPRSABORT\fR\fR 1671 .ad 1672 .RS 12n 1673 is meaningful only if the lwp is in a \fBPR_SYSENTRY\fR stop or is marked 1674 \fBPR_ASLEEP\fR; it instructs the lwp to abort execution of the system call 1675 (see \fBPCSENTRY\fR and \fBPCSEXIT\fR). 1676 .RE 1677 1678 .sp 1679 .ne 2 1680 .na 1681 \fB\fBPRSTOP\fR\fR 1682 .ad 1683 .RS 12n 1684 directs the lwp to stop again as soon as possible after resuming execution (see 1685 \fBPCDSTOP\fR). In particular, if the lwp is stopped on \fBPR_SIGNALLED\fR or 1686 \fBPR_FAULTED\fR, the next stop will show \fBPR_REQUESTED\fR, no other stop 1687 will have intervened, and the lwp will not have executed any user-level code. 1688 .RE 1689 1690 .sp 1691 .LP 1692 When applied to an lwp control file, \fBPCRUN\fR clears any outstanding 1693 directed-stop request and makes the specific lwp runnable. The operation fails 1694 with \fBEBUSY\fR if the specific lwp is not stopped on an event of interest or 1695 has not been directed to stop or if the agent lwp exists and this is not the 1696 agent lwp (see \fBPCAGENT\fR). 1697 .sp 1698 .LP 1699 When applied to the process control file, a representative lwp is chosen for 1700 the operation as described for \fB/proc/\fR\fIpid\fR\fB/status\fR. The 1701 operation fails with \fBEBUSY\fR if the representative lwp is not stopped on an 1702 event of interest or has not been directed to stop or if the agent lwp exists. 1703 If \fBPRSTEP\fR or \fBPRSTOP\fR was requested, the representative lwp is made 1704 runnable and its outstanding directed-stop request is cleared; otherwise all 1705 outstanding directed-stop requests are cleared and, if it was stopped on an 1706 event of interest, the representative lwp is marked \fBPR_REQUESTED\fR. If, as 1707 a consequence, all lwps are in the \fBPR_REQUESTED\fR or \fBPR_SUSPENDED\fR 1708 stop state, all lwps showing \fBPR_REQUESTED\fR are made runnable. 1709 .SS "PCSTRACE" 1710 .sp 1711 .LP 1712 Define a set of signals to be traced in the process. The receipt of one of 1713 these signals by an lwp causes the lwp to stop. The set of signals is defined 1714 using an operand \fBsigset_t\fR contained in the control message. Receipt of 1715 \fBSIGKILL\fR cannot be traced; if specified, it is silently ignored. 1716 .sp 1717 .LP 1718 If a signal that is included in an lwp's held signal set (the signal mask) is 1719 sent to the lwp, the signal is not received and does not cause a stop until it 1720 is removed from the held signal set, either by the lwp itself or by setting the 1721 held signal set with \fBPCSHOLD\fR. 1722 .SS "PCCSIG" 1723 .sp 1724 .LP 1725 The current signal, if any, is cleared from the specific or representative lwp. 1726 .SS "PCSSIG" 1727 .sp 1728 .LP 1729 The current signal and its associated signal information for the specific or 1730 representative lwp are set according to the contents of the operand 1731 \fBsiginfo\fR structure (see \fB<sys/siginfo.h>\fR). If the specified signal 1732 number is zero, the current signal is cleared. The semantics of this operation 1733 are different from those of \fBkill\fR(2) in that the signal is delivered to 1734 the lwp immediately after execution is resumed (even if it is being blocked) 1735 and an additional \fBPR_SIGNALLED\fR stop does not intervene even if the signal 1736 is traced. Setting the current signal to \fBSIGKILL\fR terminates the process 1737 immediately. 1738 .SS "PCKILL" 1739 .sp 1740 .LP 1741 If applied to the process control file, a signal is sent to the process with 1742 semantics identical to those of \fBkill\fR(2). If applied to an lwp control 1743 file, a directed signal is sent to the specific lwp. The signal is named in a 1744 \fBlong\fR operand contained in the message. Sending \fBSIGKILL\fR terminates 1745 the process immediately. 1746 .SS "PCUNKILL" 1747 .sp 1748 .LP 1749 A signal is deleted, that is, it is removed from the set of pending signals. If 1750 applied to the process control file, the signal is deleted from the process's 1751 pending signals. If applied to an lwp control file, the signal is deleted from 1752 the lwp's pending signals. The current signal (if any) is unaffected. The 1753 signal is named in a \fBlong\fR operand in the control message. It is an error 1754 (\fBEINVAL\fR) to attempt to delete \fBSIGKILL\fR. 1755 .SS "PCSHOLD" 1756 .sp 1757 .LP 1758 Set the set of held signals for the specific or representative lwp (signals 1759 whose delivery will be blocked if sent to the lwp). The set of signals is 1760 specified with a \fBsigset_t\fR operand. \fBSIGKILL\fR and \fBSIGSTOP\fR cannot 1761 be held; if specified, they are silently ignored. 1762 .SS "PCSFAULT" 1763 .sp 1764 .LP 1765 Define a set of hardware faults to be traced in the process. On incurring one 1766 of these faults, an lwp stops. The set is defined via the operand 1767 \fBfltset_t\fR structure. Fault names are defined in \fB<sys/fault.h>\fR and 1768 include the following. Some of these may not occur on all processors; there may 1769 be processor-specific faults in addition to these. 1770 .sp 1771 .ne 2 1772 .na 1773 \fB\fBFLTILL\fR\fR 1774 .ad 1775 .RS 13n 1776 illegal instruction 1777 .RE 1778 1779 .sp 1780 .ne 2 1781 .na 1782 \fB\fBFLTPRIV\fR\fR 1783 .ad 1784 .RS 13n 1785 privileged instruction 1786 .RE 1787 1788 .sp 1789 .ne 2 1790 .na 1791 \fB\fBFLTBPT\fR\fR 1792 .ad 1793 .RS 13n 1794 breakpoint trap 1795 .RE 1796 1797 .sp 1798 .ne 2 1799 .na 1800 \fB\fBFLTTRACE\fR\fR 1801 .ad 1802 .RS 13n 1803 trace trap (single-step) 1804 .RE 1805 1806 .sp 1807 .ne 2 1808 .na 1809 \fB\fBFLTWATCH\fR\fR 1810 .ad 1811 .RS 13n 1812 watchpoint trap 1813 .RE 1814 1815 .sp 1816 .ne 2 1817 .na 1818 \fB\fBFLTACCESS\fR\fR 1819 .ad 1820 .RS 13n 1821 memory access fault (bus error) 1822 .RE 1823 1824 .sp 1825 .ne 2 1826 .na 1827 \fB\fBFLTBOUNDS\fR\fR 1828 .ad 1829 .RS 13n 1830 memory bounds violation 1831 .RE 1832 1833 .sp 1834 .ne 2 1835 .na 1836 \fB\fBFLTIOVF\fR\fR 1837 .ad 1838 .RS 13n 1839 integer overflow 1840 .RE 1841 1842 .sp 1843 .ne 2 1844 .na 1845 \fB\fBFLTIZDIV\fR\fR 1846 .ad 1847 .RS 13n 1848 integer zero divide 1849 .RE 1850 1851 .sp 1852 .ne 2 1853 .na 1854 \fB\fBFLTFPE\fR\fR 1855 .ad 1856 .RS 13n 1857 floating-point exception 1858 .RE 1859 1860 .sp 1861 .ne 2 1862 .na 1863 \fB\fBFLTSTACK\fR\fR 1864 .ad 1865 .RS 13n 1866 unrecoverable stack fault 1867 .RE 1868 1869 .sp 1870 .ne 2 1871 .na 1872 \fB\fBFLTPAGE\fR\fR 1873 .ad 1874 .RS 13n 1875 recoverable page fault 1876 .RE 1877 1878 .sp 1879 .LP 1880 When not traced, a fault normally results in the posting of a signal to the lwp 1881 that incurred the fault. If an lwp stops on a fault, the signal is posted to 1882 the lwp when execution is resumed unless the fault is cleared by \fBPCCFAULT\fR 1883 or by the \fBPRCFAULT\fR option of \fBPCRUN\fR. \fBFLTPAGE\fR is an exception; 1884 no signal is posted. The \fBpr_info\fR field in the \fBlwpstatus\fR structure 1885 identifies the signal to be sent and contains machine-specific information 1886 about the fault. 1887 .SS "PCCFAULT" 1888 .sp 1889 .LP 1890 The current fault, if any, is cleared; the associated signal will not be sent 1891 to the specific or representative lwp. 1892 .SS "PCSENTRY PCSEXIT" 1893 .sp 1894 .LP 1895 These control operations instruct the process's lwps to stop on entry to or 1896 exit from specified system calls. The set of system calls to be traced is 1897 defined via an operand \fBsysset_t\fR structure. 1898 .sp 1899 .LP 1900 When entry to a system call is being traced, an lwp stops after having begun 1901 the call to the system but before the system call arguments have been fetched 1902 from the lwp. When exit from a system call is being traced, an lwp stops on 1903 completion of the system call just prior to checking for signals and returning 1904 to user level. At this point, all return values have been stored into the lwp's 1905 registers. 1906 .sp 1907 .LP 1908 If an lwp is stopped on entry to a system call (\fBPR_SYSENTRY\fR) or when 1909 sleeping in an interruptible system call (\fBPR_ASLEEP\fR is set), it may be 1910 instructed to go directly to system call exit by specifying the \fBPRSABORT\fR 1911 flag in a \fBPCRUN\fR control message. Unless exit from the system call is 1912 being traced, the lwp returns to user level showing \fBEINTR\fR. 1913 .SS "PCWATCH" 1914 .sp 1915 .LP 1916 Set or clear a watched area in the controlled process from a \fBprwatch\fR 1917 structure operand: 1918 .sp 1919 .in +2 1920 .nf 1921 typedef struct prwatch { 1922 uintptr_t pr_vaddr; /* virtual address of watched area */ 1923 size_t pr_size; /* size of watched area in bytes */ 1924 int pr_wflags; /* watch type flags */ 1925 } prwatch_t; 1926 .fi 1927 .in -2 1928 1929 .sp 1930 .LP 1931 \fBpr_vaddr\fR specifies the virtual address of an area of memory to be watched 1932 in the controlled process. \fBpr_size\fR specifies the size of the area, in 1933 bytes. \fBpr_wflags\fR specifies the type of memory access to be monitored as a 1934 bit-mask of the following flags: 1935 .sp 1936 .ne 2 1937 .na 1938 \fB\fBWA_READ\fR\fR 1939 .ad 1940 .RS 16n 1941 read access 1942 .RE 1943 1944 .sp 1945 .ne 2 1946 .na 1947 \fB\fBWA_WRITE\fR\fR 1948 .ad 1949 .RS 16n 1950 write access 1951 .RE 1952 1953 .sp 1954 .ne 2 1955 .na 1956 \fB\fBWA_EXEC\fR\fR 1957 .ad 1958 .RS 16n 1959 execution access 1960 .RE 1961 1962 .sp 1963 .ne 2 1964 .na 1965 \fB\fBWA_TRAPAFTER\fR\fR 1966 .ad 1967 .RS 16n 1968 trap after the instruction completes 1969 .RE 1970 1971 .sp 1972 .LP 1973 If \fBpr_wflags\fR is non-empty, a watched area is established for the virtual 1974 address range specified by \fBpr_vaddr\fR and \fBpr_size\fR. If \fBpr_wflags\fR 1975 is empty, any previously-established watched area starting at the specified 1976 virtual address is cleared; \fBpr_size\fR is ignored. 1977 .sp 1978 .LP 1979 A watchpoint is triggered when an lwp in the traced process makes a memory 1980 reference that covers at least one byte of a watched area and the memory 1981 reference is as specified in \fBpr_wflags\fR. When an lwp triggers a 1982 watchpoint, it incurs a watchpoint trap. If \fBFLTWATCH\fR is being traced, the 1983 lwp stops; otherwise, it is sent a \fBSIGTRAP\fR signal; if \fBSIGTRAP\fR is 1984 being traced and is not blocked, the lwp stops. 1985 .sp 1986 .LP 1987 The watchpoint trap occurs before the instruction completes unless 1988 \fBWA_TRAPAFTER\fR was specified, in which case it occurs after the instruction 1989 completes. If it occurs before completion, the memory is not modified. If it 1990 occurs after completion, the memory is modified (if the access is a write 1991 access). 1992 .sp 1993 .LP 1994 Physical i/o is an exception for watchpoint traps. In this instance, there is 1995 no guarantee that memory before the watched area has already been modified (or 1996 in the case of \fBWA_TRAPAFTER\fR, that the memory following the watched area 1997 has not been modified) when the watchpoint trap occurs and the lwp stops. 1998 .sp 1999 .LP 2000 \fBpr_info\fR in the \fBlwpstatus\fR structure contains information pertinent 2001 to the watchpoint trap. In particular, the \fBsi_addr\fR field contains the 2002 virtual address of the memory reference that triggered the watchpoint, and the 2003 \fBsi_code\fR field contains one of \fBTRAP_RWATCH\fR, \fBTRAP_WWATCH\fR, or 2004 \fBTRAP_XWATCH\fR, indicating read, write, or execute access, respectively. The 2005 \fBsi_trapafter\fR field is zero unless \fBWA_TRAPAFTER\fR is in effect for 2006 this watched area; non-zero indicates that the current instruction is not the 2007 instruction that incurred the watchpoint trap. The \fBsi_pc\fR field contains 2008 the virtual address of the instruction that incurred the trap. 2009 .sp 2010 .LP 2011 A watchpoint trap may be triggered while executing a system call that makes 2012 reference to the traced process's memory. The lwp that is executing the system 2013 call incurs the watchpoint trap while still in the system call. If it stops as 2014 a result, the \fBlwpstatus\fR structure contains the system call number and its 2015 arguments. If the lwp does not stop, or if it is set running again without 2016 clearing the signal or fault, the system call fails with \fBEFAULT\fR. If 2017 \fBWA_TRAPAFTER\fR was specified, the memory reference will have completed and 2018 the memory will have been modified (if the access was a write access) when the 2019 watchpoint trap occurs. 2020 .sp 2021 .LP 2022 If more than one of \fBWA_READ\fR, \fBWA_WRITE\fR, and \fBWA_EXEC\fR is 2023 specified for a watched area, and a single instruction incurs more than one of 2024 the specified types, only one is reported when the watchpoint trap occurs. The 2025 precedence is \fBWA_EXEC\fR, \fBWA_READ\fR, \fBWA_WRITE\fR (\fBWA_EXEC\fR and 2026 \fBWA_READ\fR take precedence over \fBWA_WRITE\fR), unless \fBWA_TRAPAFTER\fR 2027 was specified, in which case it is \fBWA_WRITE\fR, \fBWA_READ\fR, \fBWA_EXEC\fR 2028 (\fBWA_WRITE\fR takes precedence). 2029 .sp 2030 .LP 2031 \fBPCWATCH\fR fails with \fBEINVAL\fR if an attempt is made to specify 2032 overlapping watched areas or if \fBpr_wflags\fR contains flags other than those 2033 specified above. It fails with \fBENOMEM\fR if an attempt is made to establish 2034 more watched areas than the system can support (the system can support 2035 thousands). 2036 .sp 2037 .LP 2038 The child of a \fBvfork\fR(2) borrows the parent's address space. When a 2039 \fBvfork\fR(2) is executed by a traced process, all watched areas established 2040 for the parent are suspended until the child terminates or performs an 2041 \fBexec\fR(2). Any watched areas established independently in the child are 2042 cancelled when the parent resumes after the child's termination or 2043 \fBexec\fR(2). \fBPCWATCH\fR fails with \fBEBUSY\fR if applied to the parent of 2044 a \fBvfork\fR(2) before the child has terminated or performed an \fBexec\fR(2). 2045 The \fBPR_VFORKP\fR flag is set in the \fBpstatus\fR structure for such a 2046 parent process. 2047 .sp 2048 .LP 2049 Certain accesses of the traced process's address space by the operating system 2050 are immune to watchpoints. The initial construction of a signal stack frame 2051 when a signal is delivered to an lwp will not trigger a watchpoint trap even if 2052 the new frame covers watched areas of the stack. Once the signal handler is 2053 entered, watchpoint traps occur normally. On SPARC based machines, register 2054 window overflow and underflow will not trigger watchpoint traps, even if the 2055 register window save areas cover watched areas of the stack. 2056 .sp 2057 .LP 2058 Watched areas are not inherited by child processes, even if the traced 2059 process's inherit-on-fork mode, \fBPR_FORK\fR, is set (see \fBPCSET\fR, below). 2060 All watched areas are cancelled when the traced process performs a successful 2061 \fBexec\fR(2). 2062 .SS "PCSET PCUNSET" 2063 .sp 2064 .LP 2065 \fBPCSET\fR sets one or more modes of operation for the traced process. 2066 \fBPCUNSET\fR unsets these modes. The modes to be set or unset are specified by 2067 flags in an operand \fBlong\fR in the control message: 2068 .sp 2069 .ne 2 2070 .na 2071 \fB\fBPR_FORK\fR\fR 2072 .ad 2073 .RS 13n 2074 (inherit-on-fork): When set, the process's tracing flags and its 2075 inherit-on-fork mode are inherited by the child of a \fBfork\fR(2), 2076 \fBfork1\fR(2), or \fBvfork\fR(2). When unset, child processes start with all 2077 tracing flags cleared. 2078 .RE 2079 2080 .sp 2081 .ne 2 2082 .na 2083 \fB\fBPR_RLC\fR\fR 2084 .ad 2085 .RS 13n 2086 (run-on-last-close): When set and the last writable \fB/proc\fR file descriptor 2087 referring to the traced process or any of its lwps is closed, all of the 2088 process's tracing flags and watched areas are cleared, any outstanding stop 2089 directives are canceled, and if any lwps are stopped on events of interest, 2090 they are set running as though \fBPCRUN\fR had been applied to them. When 2091 unset, the process's tracing flags and watched areas are retained and lwps are 2092 not set running on last close. 2093 .RE 2094 2095 .sp 2096 .ne 2 2097 .na 2098 \fB\fBPR_KLC\fR\fR 2099 .ad 2100 .RS 13n 2101 (kill-on-last-close): When set and the last writable \fB/proc\fR file 2102 descriptor referring to the traced process or any of its lwps is closed, the 2103 process is terminated with \fBSIGKILL\fR. 2104 .RE 2105 2106 .sp 2107 .ne 2 2108 .na 2109 \fB\fBPR_ASYNC\fR\fR 2110 .ad 2111 .RS 13n 2112 (asynchronous-stop): When set, a stop on an event of interest by one lwp does 2113 not directly affect any other lwp in the process. When unset and an lwp stops 2114 on an event of interest other than \fBPR_REQUESTED\fR, all other lwps in the 2115 process are directed to stop. 2116 .RE 2117 2118 .sp 2119 .ne 2 2120 .na 2121 \fB\fBPR_MSACCT\fR\fR 2122 .ad 2123 .RS 13n 2124 (microstate accounting): Microstate accounting is now continuously enabled. 2125 This flag is deprecated and no longer has any effect upon microstate 2126 accounting. Applications may toggle this flag; however, microstate accounting 2127 will remain enabled regardless. 2128 .RE 2129 2130 .sp 2131 .ne 2 2132 .na 2133 \fB\fBPR_MSFORK\fR\fR 2134 .ad 2135 .RS 13n 2136 (inherit microstate accounting): All processes now inherit microstate 2137 accounting, as it is continuously enabled. This flag has been deprecated and 2138 its use no longer has any effect upon the behavior of microstate accounting. 2139 .RE 2140 2141 .sp 2142 .ne 2 2143 .na 2144 \fB\fBPR_BPTADJ\fR\fR 2145 .ad 2146 .RS 13n 2147 (breakpoint trap pc adjustment): On x86-based machines, a breakpoint trap 2148 leaves the program counter (the \fBEIP\fR) referring to the breakpointed 2149 instruction plus one byte. When \fBPR_BPTADJ\fR is set, the system will adjust 2150 the program counter back to the location of the breakpointed instruction when 2151 the lwp stops on a breakpoint. This flag has no effect on SPARC based machines, 2152 where breakpoint traps leave the program counter referring to the breakpointed 2153 instruction. 2154 .RE 2155 2156 .sp 2157 .ne 2 2158 .na 2159 \fB\fBPR_PTRACE\fR\fR 2160 .ad 2161 .RS 13n 2162 (ptrace-compatibility): When set, a stop on an event of interest by the traced 2163 process is reported to the parent of the traced process by \fBwait\fR(3C), 2164 \fBSIGTRAP\fR is sent to the traced process when it executes a successful 2165 \fBexec\fR(2), setuid/setgid flags are not honored for execs performed by the 2166 traced process, any exec of an object file that the traced process cannot read 2167 fails, and the process dies when its parent dies. This mode is deprecated; it 2168 is provided only to allow \fBptrace\fR(3C) to be implemented as a library 2169 function using \fB/proc\fR. 2170 .RE 2171 2172 .sp 2173 .LP 2174 It is an error (\fBEINVAL\fR) to specify flags other than those described above 2175 or to apply these operations to a system process. The current modes are 2176 reported in the \fBpr_flags\fR field of \fB/proc/\fR\fIpid\fR\fB/status\fR and 2177 \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwp\fR\fB/lwpstatus\fR. 2178 .SS "PCSREG" 2179 .sp 2180 .LP 2181 Set the general registers for the specific or representative lwp according to 2182 the operand \fBprgregset_t\fR structure. 2183 .sp 2184 .LP 2185 On SPARC based systems, only the condition-code bits of the processor-status 2186 register (R_PSR) of SPARC V8 (32-bit) processes can be modified by 2187 \fBPCSREG\fR. Other privileged registers cannot be modified at all. 2188 .sp 2189 .LP 2190 On x86-based systems, only certain bits of the flags register (EFL) can be 2191 modified by \fBPCSREG\fR: these include the condition codes, direction-bit, and 2192 overflow-bit. 2193 .sp 2194 .LP 2195 \fBPCSREG\fR fails with \fBEBUSY\fR if the lwp is not stopped on an event of 2196 interest. 2197 .SS "PCSVADDR" 2198 .sp 2199 .LP 2200 Set the address at which execution will resume for the specific or 2201 representative lwp from the operand \fBlong\fR. On SPARC based systems, both 2202 %pc and %npc are set, with %npc set to the instruction following the virtual 2203 address. On x86-based systems, only %eip is set. \fBPCSVADDR\fR fails with 2204 \fBEBUSY\fR if the lwp is not stopped on an event of interest. 2205 .SS "PCSFPREG" 2206 .sp 2207 .LP 2208 Set the floating-point registers for the specific or representative lwp 2209 according to the operand \fBprfpregset_t\fR structure. An error (\fBEINVAL\fR) 2210 is returned if the system does not support floating-point operations (no 2211 floating-point hardware and the system does not emulate floating-point machine 2212 instructions). \fBPCSFPREG\fR fails with \fBEBUSY\fR if the lwp is not stopped 2213 on an event of interest. 2214 .SS "PCSXREG" 2215 .sp 2216 .LP 2217 Set the extra state registers for the specific or representative lwp according 2218 to the architecture-dependent operand \fBprxregset_t\fR structure. An error 2219 (\fBEINVAL\fR) is returned if the system does not support extra state 2220 registers. \fBPCSXREG\fR fails with \fBEBUSY\fR if the lwp is not stopped on an 2221 event of interest. 2222 .SS "PCSASRS" 2223 .sp 2224 .LP 2225 Set the ancillary state registers for the specific or representative lwp 2226 according to the SPARC V9 platform-dependent operand \fBasrset_t\fR structure. 2227 An error (\fBEINVAL\fR) is returned if either the target process or the 2228 controlling process is not a 64-bit SPARC V9 process. Most of the ancillary 2229 state registers are privileged registers that cannot be modified. Only those 2230 that can be modified are set; all others are silently ignored. \fBPCSASRS\fR 2231 fails with \fBEBUSY\fR if the lwp is not stopped on an event of interest. 2232 .SS "PCAGENT" 2233 .sp 2234 .LP 2235 Create an agent lwp in the controlled process with register values from the 2236 operand \fBprgregset_t\fR structure (see \fBPCSREG\fR, above). The agent lwp is 2237 created in the stopped state showing \fBPR_REQUESTED\fR and with its held 2238 signal set (the signal mask) having all signals except \fBSIGKILL\fR and 2239 \fBSIGSTOP\fR blocked. 2240 .sp 2241 .LP 2242 The \fBPCAGENT\fR operation fails with \fBEBUSY\fR unless the process is fully 2243 stopped via \fB/proc\fR, that is, unless all of the lwps in the process are 2244 stopped either on events of interest or on \fBPR_SUSPENDED\fR, or are stopped 2245 on \fBPR_JOBCONTROL\fR and have been directed to stop via \fBPCDSTOP\fR. It 2246 fails with \fBEBUSY\fR if an agent lwp already exists. It fails with 2247 \fBENOMEM\fR if system resources for creating new lwps have been exhausted. 2248 .sp 2249 .LP 2250 Any \fBPCRUN\fR operation applied to the process control file or to the control 2251 file of an lwp other than the agent lwp fails with \fBEBUSY\fR as long as the 2252 agent lwp exists. The agent lwp must be caused to terminate by executing the 2253 \fBSYS_lwp_exit\fR system call trap before the process can be restarted. 2254 .sp 2255 .LP 2256 Once the agent lwp is created, its lwp-ID can be found by reading the process 2257 status file. To facilitate opening the agent lwp's control and status files, 2258 the directory name \fB/propc/\fR\fIpid\fR\fB/lwp/agent\fR is accepted for 2259 lookup operations as an invisible alias for 2260 \fB/proc/\fR\fIpid\fR\fB/lwp/\fR\fIlwpid,\fR \fIlwpid\fR being the lwp-ID of 2261 the agent lwp (invisible in the sense that the name ``agent'' does not appear 2262 in a directory listing of \fB/proc/\fR\fIpid\fR\fB/lwp\fR obtained from 2263 \fBls\fR(1), \fBgetdents\fR(2), or \fBreaddir\fR(3C)). 2264 .sp 2265 .LP 2266 The purpose of the agent lwp is to perform operations in the controlled process 2267 on behalf of the controlling process: to gather information not directly 2268 available via \fB/proc\fR files, or in general to make the process change state 2269 in ways not directly available via \fB/proc\fR control operations. To make use 2270 of an agent lwp, the controlling process must be capable of making it execute 2271 system calls (specifically, the \fBSYS_lwp_exit\fR system call trap). The 2272 register values given to the agent lwp on creation are typically the registers 2273 of the representative lwp, so that the agent lwp can use its stack. 2274 .sp 2275 .LP 2276 If the controlling process neglects to force the agent lwp to execute the 2277 \fBSYS_lwp_exit\fR system call (due to either logic error or fatal failure on 2278 the part of the controlling process), the agent lwp will remain in the target 2279 process. For purposes of being able to debug these otherwise rogue agents, 2280 information as to the creator of the agent lwp is reflected in that lwp's 2281 \fBspymaster\fR file in \fB/proc\fR. Should the target process generate a core 2282 dump with the agent lwp in place, this information will be available via the 2283 \fBNT_SPYMASTER\fR note in the core file (see \fBcore\fR(4)). 2284 .sp 2285 .LP 2286 The agent lwp is not allowed to execute any variation of the \fBSYS_fork\fR or 2287 \fBSYS_exec\fR system call traps. Attempts to do so yield \fBENOTSUP\fR to the 2288 agent lwp. 2289 .sp 2290 .LP 2291 Symbolic constants for system call trap numbers like \fBSYS_lwp_exit\fR and 2292 \fBSYS_lwp_create\fR can be found in the header file <\fBsys/syscall.h\fR>. 2293 .SS "PCREAD PCWRITE" 2294 .sp 2295 .LP 2296 Read or write the target process's address space via a \fBpriovec\fR structure 2297 operand: 2298 .sp 2299 .in +2 2300 .nf 2301 typedef struct priovec { 2302 void *pio_base; /* buffer in controlling process */ 2303 size_t pio_len; /* size of read/write request in bytes */ 2304 off_t pio_offset; /* virtual address in target process */ 2305 } priovec_t; 2306 .fi 2307 .in -2 2308 2309 .sp 2310 .LP 2311 These operations have the same effect as \fBpread\fR(2) and \fBpwrite\fR(2), 2312 respectively, of the target process's address space file. The difference is 2313 that more than one \fBPCREAD\fR or \fBPCWRITE\fR control operation can be 2314 written to the control file at once, and they can be interspersed with other 2315 control operations in a single write to the control file. This is useful, for 2316 example, when planting many breakpoint instructions in the process's address 2317 space, or when stepping over a breakpointed instruction. Unlike \fBpread\fR(2) 2318 and \fBpwrite\fR(2), no provision is made for partial reads or writes; if the 2319 operation cannot be performed completely, it fails with \fBEIO\fR. 2320 .SS "PCNICE" 2321 .sp 2322 .LP 2323 The traced process's \fBnice\fR(2) value is incremented by the amount in the 2324 operand \fBlong\fR. Only a process with the {\fBPRIV_PROC_PRIOCNTL\fR} 2325 privilege asserted in its effective set can better a process's priority in this 2326 way, but any user may lower the priority. This operation is not meaningful for 2327 all scheduling classes. 2328 .SS "PCSCRED" 2329 .sp 2330 .LP 2331 Set the target process credentials to the values contained in the 2332 \fBprcred_t\fR structure operand (see \fB/proc/\fR\fIpid\fR\fB/cred\fR). The 2333 effective, real, and saved user-IDs and group-IDs of the target process are 2334 set. The target process's supplementary groups are not changed; the 2335 \fBpr_ngroups\fR and \fBpr_groups\fR members of the structure operand are 2336 ignored. Only the privileged processes can perform this operation; for all 2337 others it fails with \fBEPERM\fR. 2338 .SS "PCSCREDX" 2339 .sp 2340 .LP 2341 Operates like \fBPCSCRED\fR but also sets the supplementary groups; the length 2342 of the data written with this control operation should be "sizeof 2343 (\fBprcred_t\fR) + sizeof (\fBgid_t)\fR * (#groups - 1)". 2344 .SS "PCSPRIV" 2345 .sp 2346 .LP 2347 Set the target process privilege to the values contained in the \fBprpriv_t\fR 2348 operand (see \fB/proc/pid/priv\fR). The effective, permitted, inheritable, and 2349 limit sets are all changed. Privilege flags can also be set. The process is 2350 made privilege aware unless it can relinquish privilege awareness. See 2351 \fBprivileges\fR(5). 2352 .sp 2353 .LP 2354 The limit set of the target process cannot be grown. The other privilege sets 2355 must be subsets of the intersection of the effective set of the calling process 2356 with the new limit set of the target process or subsets of the original values 2357 of the sets in the target process. 2358 .sp 2359 .LP 2360 If any of the above restrictions are not met, \fBEPERM\fR is returned. If the 2361 structure written is improperly formatted, \fBEINVAL\fR is returned. 2362 .SH PROGRAMMING NOTES 2363 .sp 2364 .LP 2365 For security reasons, except for the \fBpsinfo\fR, \fBusage\fR, \fBlpsinfo\fR, 2366 \fBlusage\fR, \fBlwpsinfo\fR, and \fBlwpusage\fR files, which are 2367 world-readable, and except for privileged processes, an open of a \fB/proc\fR 2368 file fails unless both the user-ID and group-ID of the caller match those of 2369 the traced process and the process's object file is readable by the caller. The 2370 effective set of the caller is a superset of both the inheritable and the 2371 permitted set of the target process. The limit set of the caller is a superset 2372 of the limit set of the target process. Except for the world-readable files 2373 just mentioned, files corresponding to setuid and setgid processes can be 2374 opened only by the appropriately privileged process. 2375 .sp 2376 .LP 2377 A process that is missing the basic privilege {\fBPRIV_PROC_INFO\fR} cannot see 2378 any processes under \fB/proc\fR that it cannot send a signal to. 2379 .sp 2380 .LP 2381 A process that has {\fBPRIV_PROC_OWNER\fR} asserted in its effective set can 2382 open any file for reading. To manipulate or control a process, the controlling 2383 process must have at least as many privileges in its effective set as the 2384 target process has in its effective, inheritable, and permitted sets. The limit 2385 set of the controlling process must be a superset of the limit set of the 2386 target process. Additional restrictions apply if any of the uids of the target 2387 process are 0. See \fBprivileges\fR(5). 2388 .sp 2389 .LP 2390 Even if held by a privileged process, an open process or lwp file descriptor 2391 (other than file descriptors for the world-readable files) becomes invalid if 2392 the traced process performs an \fBexec\fR(2) of a setuid/setgid object file or 2393 an object file that the traced process cannot read. Any operation performed on 2394 an invalid file descriptor, except \fBclose\fR(2), fails with \fBEAGAIN\fR. In 2395 this situation, if any tracing flags are set and the process or any lwp file 2396 descriptor is open for writing, the process will have been directed to stop and 2397 its run-on-last-close flag will have been set (see \fBPCSET\fR). This enables a 2398 controlling process (if it has permission) to reopen the \fB/proc\fR files to 2399 get new valid file descriptors, close the invalid file descriptors, unset the 2400 run-on-last-close flag (if desired), and proceed. Just closing the invalid file 2401 descriptors causes the traced process to resume execution with all tracing 2402 flags cleared. Any process not currently open for writing via \fB/proc\fR, but 2403 that has left-over tracing flags from a previous open, and that executes a 2404 setuid/setgid or unreadable object file, will not be stopped but will have all 2405 its tracing flags cleared. 2406 .sp 2407 .LP 2408 To wait for one or more of a set of processes or lwps to stop or terminate, 2409 \fB/proc\fR file descriptors (other than those obtained by opening the 2410 \fBcwd\fR or \fBroot\fR directories or by opening files in the \fBfd\fR or 2411 \fBobject\fR directories) can be used in a \fBpoll\fR(2) system call. When 2412 requested and returned, either of the polling events \fBPOLLPRI\fR or 2413 \fBPOLLWRNORM\fR indicates that the process or lwp stopped on an event of 2414 interest. Although they cannot be requested, the polling events \fBPOLLHUP\fR, 2415 \fBPOLLERR\fR, and \fBPOLLNVAL\fR may be returned. \fBPOLLHUP\fR indicates that 2416 the process or lwp has terminated. \fBPOLLERR\fR indicates that the file 2417 descriptor has become invalid. \fBPOLLNVAL\fR is returned immediately if 2418 \fBPOLLPRI\fR or \fBPOLLWRNORM\fR is requested on a file descriptor referring 2419 to a system process (see \fBPCSTOP\fR). The requested events may be empty to 2420 wait simply for termination. 2421 .SH FILES 2422 .sp 2423 .ne 2 2424 .na 2425 \fB\fB/proc\fR\fR 2426 .ad 2427 .sp .6 2428 .RS 4n 2429 directory (list of processes) 2430 .RE 2431 2432 .sp 2433 .ne 2 2434 .na 2435 \fB\fB/proc/\fIpid\fR\fR\fR 2436 .ad 2437 .sp .6 2438 .RS 4n 2439 specific process directory 2440 .RE 2441 2442 .sp 2443 .ne 2 2444 .na 2445 \fB\fB/proc/self\fR\fR 2446 .ad 2447 .sp .6 2448 .RS 4n 2449 alias for a process's own directory 2450 .RE 2451 2452 .sp 2453 .ne 2 2454 .na 2455 \fB\fB/proc/\fIpid\fR/as\fR\fR 2456 .ad 2457 .sp .6 2458 .RS 4n 2459 address space file 2460 .RE 2461 2462 .sp 2463 .ne 2 2464 .na 2465 \fB\fB/proc/\fIpid\fR/ctl\fR\fR 2466 .ad 2467 .sp .6 2468 .RS 4n 2469 process control file 2470 .RE 2471 2472 .sp 2473 .ne 2 2474 .na 2475 \fB\fB/proc/\fIpid\fR/status\fR\fR 2476 .ad 2477 .sp .6 2478 .RS 4n 2479 process status 2480 .RE 2481 2482 .sp 2483 .ne 2 2484 .na 2485 \fB\fB/proc/\fIpid\fR/lstatus\fR\fR 2486 .ad 2487 .sp .6 2488 .RS 4n 2489 array of lwp status structs 2490 .RE 2491 2492 .sp 2493 .ne 2 2494 .na 2495 \fB\fB/proc/\fIpid\fR/psinfo\fR\fR 2496 .ad 2497 .sp .6 2498 .RS 4n 2499 process \fBps\fR(1) info 2500 .RE 2501 2502 .sp 2503 .ne 2 2504 .na 2505 \fB\fB/proc/\fIpid\fR/lpsinfo\fR\fR 2506 .ad 2507 .sp .6 2508 .RS 4n 2509 array of lwp \fBps\fR(1) info structs 2510 .RE 2511 2512 .sp 2513 .ne 2 2514 .na 2515 \fB\fB/proc/\fIpid\fR/map\fR\fR 2516 .ad 2517 .sp .6 2518 .RS 4n 2519 address space map 2520 .RE 2521 2522 .sp 2523 .ne 2 2524 .na 2525 \fB\fB/proc/\fIpid\fR/xmap\fR\fR 2526 .ad 2527 .sp .6 2528 .RS 4n 2529 extended address space map 2530 .RE 2531 2532 .sp 2533 .ne 2 2534 .na 2535 \fB\fB/proc/\fIpid\fR/rmap\fR\fR 2536 .ad 2537 .sp .6 2538 .RS 4n 2539 reserved address map 2540 .RE 2541 2542 .sp 2543 .ne 2 2544 .na 2545 \fB\fB/proc/\fIpid\fR/cred\fR\fR 2546 .ad 2547 .sp .6 2548 .RS 4n 2549 process credentials 2550 .RE 2551 2552 .sp 2553 .ne 2 2554 .na 2555 \fB\fB/proc/\fIpid\fR/priv\fR\fR 2556 .ad 2557 .sp .6 2558 .RS 4n 2559 process privileges 2560 .RE 2561 2562 .sp 2563 .ne 2 2564 .na 2565 \fB\fB/proc/\fIpid\fR/sigact\fR\fR 2566 .ad 2567 .sp .6 2568 .RS 4n 2569 process signal actions 2570 .RE 2571 2572 .sp 2573 .ne 2 2574 .na 2575 \fB\fB/proc/\fIpid\fR/auxv\fR\fR 2576 .ad 2577 .sp .6 2578 .RS 4n 2579 process aux vector 2580 .RE 2581 2582 .sp 2583 .ne 2 2584 .na 2585 \fB\fB/proc/\fIpid\fR/ldt\fR\fR 2586 .ad 2587 .sp .6 2588 .RS 4n 2589 process \fBLDT\fR (x86 only) 2590 .RE 2591 2592 .sp 2593 .ne 2 2594 .na 2595 \fB\fB/proc/\fIpid\fR/usage\fR\fR 2596 .ad 2597 .sp .6 2598 .RS 4n 2599 process usage 2600 .RE 2601 2602 .sp 2603 .ne 2 2604 .na 2605 \fB\fB/proc/\fIpid\fR/lusage\fR\fR 2606 .ad 2607 .sp .6 2608 .RS 4n 2609 array of lwp usage structs 2610 .RE 2611 2612 .sp 2613 .ne 2 2614 .na 2615 \fB\fB/proc/\fIpid\fR/path\fR\fR 2616 .ad 2617 .sp .6 2618 .RS 4n 2619 symbolic links to process open files 2620 .RE 2621 2622 .sp 2623 .ne 2 2624 .na 2625 \fB\fB/proc/\fIpid\fR/pagedata\fR\fR 2626 .ad 2627 .sp .6 2628 .RS 4n 2629 process page data 2630 .RE 2631 2632 .sp 2633 .ne 2 2634 .na 2635 \fB\fB/proc/\fIpid\fR/watch\fR\fR 2636 .ad 2637 .sp .6 2638 .RS 4n 2639 active watchpoints 2640 .RE 2641 2642 .sp 2643 .ne 2 2644 .na 2645 \fB\fB/proc/\fIpid\fR/cwd\fR\fR 2646 .ad 2647 .sp .6 2648 .RS 4n 2649 alias for the current working directory 2650 .RE 2651 2652 .sp 2653 .ne 2 2654 .na 2655 \fB\fB/proc/\fIpid\fR/root\fR\fR 2656 .ad 2657 .sp .6 2658 .RS 4n 2659 alias for the root directory 2660 .RE 2661 2662 .sp 2663 .ne 2 2664 .na 2665 \fB\fB/proc/\fIpid\fR/fd\fR\fR 2666 .ad 2667 .sp .6 2668 .RS 4n 2669 directory (list of open files) 2670 .RE 2671 2672 .sp 2673 .ne 2 2674 .na 2675 \fB\fB/proc/\fIpid\fR/fd/*\fR\fR 2676 .ad 2677 .sp .6 2678 .RS 4n 2679 aliases for process's open files 2680 .RE 2681 2682 .sp 2683 .ne 2 2684 .na 2685 \fB\fB/proc/\fIpid\fR/object\fR\fR 2686 .ad 2687 .sp .6 2688 .RS 4n 2689 directory (list of mapped files) 2690 .RE 2691 2692 .sp 2693 .ne 2 2694 .na 2695 \fB\fB/proc/\fIpid\fR/object/a.out\fR\fR 2696 .ad 2697 .sp .6 2698 .RS 4n 2699 alias for process's executable file 2700 .RE 2701 2702 .sp 2703 .ne 2 2704 .na 2705 \fB\fB/proc/\fIpid\fR/object/*\fR\fR 2706 .ad 2707 .sp .6 2708 .RS 4n 2709 aliases for other mapped files 2710 .RE 2711 2712 .sp 2713 .ne 2 2714 .na 2715 \fB\fB/proc/\fIpid\fR/lwp\fR\fR 2716 .ad 2717 .sp .6 2718 .RS 4n 2719 directory (list of lwps) 2720 .RE 2721 2722 .sp 2723 .ne 2 2724 .na 2725 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR\fR\fR 2726 .ad 2727 .sp .6 2728 .RS 4n 2729 specific lwp directory 2730 .RE 2731 2732 .sp 2733 .ne 2 2734 .na 2735 \fB\fB/proc/\fIpid\fR/lwp/agent\fR\fR 2736 .ad 2737 .sp .6 2738 .RS 4n 2739 alias for the agent lwp directory 2740 .RE 2741 2742 .sp 2743 .ne 2 2744 .na 2745 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpctl\fR\fR 2746 .ad 2747 .sp .6 2748 .RS 4n 2749 lwp control file 2750 .RE 2751 2752 .sp 2753 .ne 2 2754 .na 2755 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpstatus\fR\fR 2756 .ad 2757 .sp .6 2758 .RS 4n 2759 lwp status 2760 .RE 2761 2762 .sp 2763 .ne 2 2764 .na 2765 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpsinfo\fR\fR 2766 .ad 2767 .sp .6 2768 .RS 4n 2769 lwp \fBps\fR(1) info 2770 .RE 2771 2772 .sp 2773 .ne 2 2774 .na 2775 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/lwpusage\fR\fR 2776 .ad 2777 .sp .6 2778 .RS 4n 2779 lwp usage 2780 .RE 2781 2782 .sp 2783 .ne 2 2784 .na 2785 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/gwindows\fR\fR 2786 .ad 2787 .sp .6 2788 .RS 4n 2789 register windows (SPARC only) 2790 .RE 2791 2792 .sp 2793 .ne 2 2794 .na 2795 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/xregs\fR\fR 2796 .ad 2797 .sp .6 2798 .RS 4n 2799 extra state registers 2800 .RE 2801 2802 .sp 2803 .ne 2 2804 .na 2805 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/asrs\fR\fR 2806 .ad 2807 .sp .6 2808 .RS 4n 2809 ancillary state registers (SPARC V9 only) 2810 .RE 2811 2812 .sp 2813 .ne 2 2814 .na 2815 \fB\fB/proc/\fIpid\fR/lwp/\fIlwpid\fR/spymaster\fR\fR 2816 .ad 2817 .sp .6 2818 .RS 4n 2819 For an agent LWP, the controlling process 2820 .RE 2821 2822 .SH SEE ALSO 2823 .sp 2824 .LP 2825 \fBls\fR(1), \fBps\fR(1), \fBchroot\fR(1M), \fBalarm\fR(2), \fBbrk\fR(2), 2826 \fBchdir\fR(2), \fBchroot\fR(2), \fBclose\fR(2), \fBcreat\fR(2), \fBdup\fR(2), 2827 \fBexec\fR(2), \fBfcntl\fR(2), \fBfork\fR(2), \fBfork1\fR(2), \fBfstat\fR(2), 2828 \fBgetdents\fR(2), \fBgetustack\fR(2), \fBkill\fR(2), \fBlseek\fR(2), 2829 \fBmmap\fR(2), \fBnice\fR(2), \fBopen\fR(2), \fBpoll\fR(2), \fBpread\fR(2), 2830 \fBptrace\fR(3C), \fBpwrite\fR(2), \fBread\fR(2), \fBreadlink\fR(2), 2831 \fBreadv\fR(2), \fBshmget\fR(2), \fBsigaction\fR(2), \fBsigaltstack\fR(2), 2832 \fBvfork\fR(2), \fBwrite\fR(2), \fBwritev\fR(2), \fB_stack_grow\fR(3C), 2833 \fBreaddir\fR(3C), \fBpthread_create\fR(3C), \fBpthread_join\fR(3C), 2834 \fBsiginfo.h\fR(3HEAD), \fBsignal.h\fR(3HEAD), \fBthr_create\fR(3C), 2835 \fBthr_join\fR(3C), \fBtypes32.h\fR(3HEAD), \fBucontext.h\fR(3HEAD), 2836 \fBwait\fR(3C), \fBcontract\fR(4), \fBcore\fR(4), \fBprocess\fR(4), 2837 \fBlfcompile\fR(5), \fBprivileges\fR(5) 2838 .SH DIAGNOSTICS 2839 .sp 2840 .LP 2841 Errors that can occur in addition to the errors normally associated with file 2842 system access: 2843 .sp 2844 .ne 2 2845 .na 2846 \fB\fBE2BIG\fR\fR 2847 .ad 2848 .RS 13n 2849 Data to be returned in a \fBread\fR(2) of the page data file exceeds the size 2850 of the read buffer provided by the caller. 2851 .RE 2852 2853 .sp 2854 .ne 2 2855 .na 2856 \fB\fBEACCES\fR\fR 2857 .ad 2858 .RS 13n 2859 An attempt was made to examine a process that ran under a different uid than 2860 the controlling process and {\fBPRIV_PROC_OWNER\fR} was not asserted in the 2861 effective set. 2862 .RE 2863 2864 .sp 2865 .ne 2 2866 .na 2867 \fB\fBEAGAIN\fR\fR 2868 .ad 2869 .RS 13n 2870 The traced process has performed an \fBexec\fR(2) of a setuid/setgid object 2871 file or of an object file that it cannot read; all further operations on the 2872 process or lwp file descriptor (except \fBclose\fR(2)) elicit this error. 2873 .RE 2874 2875 .sp 2876 .ne 2 2877 .na 2878 \fB\fBEBUSY\fR\fR 2879 .ad 2880 .RS 13n 2881 \fBPCSTOP\fR, \fBPCDSTOP\fR, \fBPCWSTOP\fR, or \fBPCTWSTOP\fR was applied to a 2882 system process; an exclusive \fBopen\fR(2) was attempted on a \fB/proc\fR file 2883 for a process already open for writing; \fBPCRUN\fR, \fBPCSREG\fR, 2884 \fBPCSVADDR\fR, \fBPCSFPREG\fR, or \fBPCSXREG\fR was applied to a process or 2885 lwp not stopped on an event of interest; an attempt was made to mount 2886 \fB/proc\fR when it was already mounted; \fBPCAGENT\fR was applied to a process 2887 that was not fully stopped or that already had an agent lwp. 2888 .RE 2889 2890 .sp 2891 .ne 2 2892 .na 2893 \fB\fBEINVAL\fR\fR 2894 .ad 2895 .RS 13n 2896 In general, this means that some invalid argument was supplied to a system 2897 call. A non-exhaustive list of conditions eliciting this error includes: a 2898 control message operation code is undefined; an out-of-range signal number was 2899 specified with \fBPCSSIG\fR, \fBPCKILL\fR, or \fBPCUNKILL\fR; \fBSIGKILL\fR was 2900 specified with \fBPCUNKILL\fR; \fBPCSFPREG\fR was applied on a system that does 2901 not support floating-point operations; \fBPCSXREG\fR was applied on a system 2902 that does not support extra state registers. 2903 .RE 2904 2905 .sp 2906 .ne 2 2907 .na 2908 \fB\fBEINTR\fR\fR 2909 .ad 2910 .RS 13n 2911 A signal was received by the controlling process while waiting for the traced 2912 process or lwp to stop via \fBPCSTOP\fR, \fBPCWSTOP\fR, or \fBPCTWSTOP\fR. 2913 .RE 2914 2915 .sp 2916 .ne 2 2917 .na 2918 \fB\fBEIO\fR\fR 2919 .ad 2920 .RS 13n 2921 A \fBwrite\fR(2) was attempted at an illegal address in the traced process. 2922 .RE 2923 2924 .sp 2925 .ne 2 2926 .na 2927 \fB\fBENOENT\fR\fR 2928 .ad 2929 .RS 13n 2930 The traced process or lwp has terminated after being opened. The basic 2931 privilege {\fBPRIV_PROC_INFO\fR} is not asserted in the effective set of the 2932 calling process and the calling process cannot send a signal to the target 2933 process. 2934 .RE 2935 2936 .sp 2937 .ne 2 2938 .na 2939 \fB\fBENOMEM\fR\fR 2940 .ad 2941 .RS 13n 2942 The system-imposed limit on the number of page data file descriptors was 2943 reached on an open of \fB/proc/\fR\fIpid\fR\fB/pagedata\fR; an attempt was made 2944 with \fBPCWATCH\fR to establish more watched areas than the system can support; 2945 the \fBPCAGENT\fR operation was issued when the system was out of resources for 2946 creating lwps. 2947 .RE 2948 2949 .sp 2950 .ne 2 2951 .na 2952 \fB\fBENOSYS\fR\fR 2953 .ad 2954 .RS 13n 2955 An attempt was made to perform an unsupported operation (such as 2956 \fBcreat\fR(2), \fBlink\fR(2), or \fBunlink\fR(2)) on an entry in \fB/proc\fR. 2957 .RE 2958 2959 .sp 2960 .ne 2 2961 .na 2962 \fB\fBEOVERFLOW\fR\fR 2963 .ad 2964 .RS 13n 2965 A 32-bit controlling process attempted to read or write the \fBas\fR file or 2966 attempted to read the \fBmap\fR, \fBrmap\fR, or \fBpagedata\fR file of a 64-bit 2967 target process. A 32-bit controlling process attempted to apply one of the 2968 control operations \fBPCSREG\fR, \fBPCSXREG\fR, \fBPCSVADDR\fR, \fBPCWATCH\fR, 2969 \fBPCAGENT\fR, \fBPCREAD\fR, \fBPCWRITE\fR to a 64-bit target process. 2970 .RE 2971 2972 .sp 2973 .ne 2 2974 .na 2975 \fB\fBEPERM\fR\fR 2976 .ad 2977 .RS 13n 2978 The process that issued the \fBPCSCRED\fR or \fBPCSCREDX\fR operation did not 2979 have the {\fBPRIV_PROC_SETID\fR} privilege asserted in its effective set, or 2980 the process that issued the \fBPCNICE\fR operation did not have the 2981 {\fBPRIV_PROC_PRIOCNTL\fR} in its effective set. 2982 .sp 2983 An attempt was made to control a process of which the E, P, and I privilege 2984 sets were not a subset of the effective set of the controlling process or the 2985 limit set of the controlling process is not a superset of limit set of the 2986 controlled process. 2987 .sp 2988 Any of the uids of the target process are 0 or an attempt was made to change 2989 any of the uids to 0 using PCSCRED and the security policy imposed additional 2990 restrictions. See \fBprivileges\fR(5). 2991 .RE 2992 2993 .SH NOTES 2994 .sp 2995 .LP 2996 Descriptions of structures in this document include only interesting structure 2997 elements, not filler and padding fields, and may show elements out of order for 2998 descriptive clarity. The actual structure definitions are contained in 2999 \fB<procfs.h>\fR\&. 3000 .SH BUGS 3001 .sp 3002 .LP 3003 Because the old \fBioctl\fR(2)-based version of \fB/proc\fR is currently 3004 supported for binary compatibility with old applications, the top-level 3005 directory for a process, \fB/proc/\fR\fIpid\fR, is not world-readable, but it 3006 is world-searchable. Thus, anyone can open \fB/proc/\fR\fIpid\fR\fB/psinfo\fR 3007 even though \fBls\fR(1) applied to \fB/proc/\fR\fIpid\fR will fail for anyone 3008 but the owner or an appropriately privileged process. Support for the old 3009 \fBioctl\fR(2)-based version of \fB/proc\fR will be dropped in a future 3010 release, at which time the top-level directory for a process will be made 3011 world-readable. 3012 .sp 3013 .LP 3014 On SPARC based machines, the types \fBgregset_t\fR and \fBfpregset_t\fR defined 3015 in <\fBsys/regset.h\fR> are similar to but not the same as the types 3016 \fBprgregset_t\fR and \fBprfpregset_t\fR defined in <\fBprocfs.h\fR>.