1 .\"
   2 .\" This file and its contents are supplied under the terms of the
   3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
   4 .\" You may only use this file in accordance with the terms of version
   5 .\" 1.0 of the CDDL.
   6 .\"
   7 .\" A full copy of the text of the CDDL should have accompanied this
   8 .\" source.  A copy of the CDDL is also available via the Internet at
   9 .\" http://www.illumos.org/license/CDDL.
  10 .\"
  11 .\"
  12 .\" Copyright 2018 Joyent, Inc.
  13 .\" Copyright (c) 2019 Carlos Neira <cneirabustos@gmail.com>
  14 .\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  15 .\" Copyright 2023 Oxide Computer Company
  16 .\"
  17 .Dd March 20, 2023
  18 .Dt LIBPROC 3LIB
  19 .Os
  20 .Sh NAME
  21 .Nm libproc
  22 .Nd process control library
  23 .Sh SYNOPSIS
  24 .Lb libproc
  25 .In libproc.h
  26 .Sh DESCRIPTION
  27 The
  28 .Nm
  29 library provides consumers a general series of interfaces to inspect
  30 and control both live processes and core files.
  31 It is intended for introspection tools such as debuggers by providing a
  32 high-level interface to the /proc file system
  33 .Pf ( Xr proc 5 ) .
  34 .Pp
  35 The
  36 .Nm
  37 library provides interfaces that focus on:
  38 .Bl -bullet -offset indent
  39 .It
  40 Creating and attaching to live process, core files, and arbitrary ELF
  41 objects.
  42 .It
  43 Interrogating the state of a process or core file.
  44 .It
  45 Manipulating the current state of a process or thread.
  46 .It
  47 Interrogating the state of threads of a process or core file.
  48 .It
  49 Running system calls in the context of another process.
  50 .It
  51 Various utilities for iterating process and core file file descriptors,
  52 mappings, symbols, and more.
  53 .It
  54 Various utilities to support debugging tools.
  55 .El
  56 .Ss Live Processes
  57 The
  58 .Nm
  59 library can be used to manipulate running processes and to create new
  60 ones.
  61 To manipulate an existing process first
  62 .Em grab
  63 it with the
  64 .Fn Pgrab
  65 function.
  66 A process is generally stopped as a side effect of grabbing it.
  67 Callers must exercise caution, as if they do not use the library correctly, or
  68 they terminate unexpectedly, a process may remain stopped.
  69 .Pp
  70 Unprivileged users may only grab their own processes.
  71 Users with the privilege
  72 .Brq Sy PRIV_PROC_OWNER
  73 may manipulate processes that they do not own; however, additional
  74 restrictions as described in
  75 .Xr privileges 7
  76 apply.
  77 .Pp
  78 In addition, the
  79 .Fn Pcreate
  80 and
  81 .Fn Pxcreate
  82 functions may be used to create processes which are always controlled by
  83 the library.
  84 .Ss Core Files
  85 The
  86 .Nm
  87 library has the ability to open and interpret core files produced by
  88 processes on the system.
  89 Process core dump generation is controlled by the
  90 .Xr coreadm 8
  91 command.
  92 In addition, the library has the ability to understand and interpret core dumps
  93 generated by Linux kernel and can provide a subset of its functionality on such
  94 core files, provided the original binary is also present.
  95 .Pp
  96 Not all functions in the
  97 .Nm
  98 library are valid for core files.
  99 In general, none of the commands which manipulate the current state of a process
 100 or thread or that try to force system calls on a victim process will work.
 101 Furthermore several of the information and iteration interfaces are limited
 102 based on the data that is available in the core file.
 103 For example, if the core file is of a process that omits the frame pointer, the
 104 ability to iterate the stack will be limited.
 105 .Pp
 106 Use the
 107 .Fn Pgrab_core
 108 or
 109 .Fn Pfgrab_core
 110 function to open a core file.
 111 Use the
 112 .Fn Pgrab_file
 113 function to open an ELF object file.
 114 This is useful for obtaining information stored in ELF headers and
 115 sections.
 116 .Ss Debug Information
 117 Many of the operations in the library rely on debug information being
 118 present in a process and its associated libraries.
 119 The library leverages symbol table information, CTF data
 120 .Pq Xr ctf 5
 121 sections, and frame unwinding information based on the use of an ABI
 122 defined frame pointer, e\&.g\&.
 123 .Sy %ebp
 124 and
 125 .Sy %rbp
 126 on x86 systems.
 127 .Pp
 128 Some software providers strip programs of this information or build
 129 their executables such that the information will not be present in a
 130 core dump.
 131 To deal with this fact, the library is able to consume information that is not
 132 present in the core file or the running process.
 133 It can both consume it from the underlying executable and it also supports
 134 finding it from related ELF objects that are linked to it via the
 135 .Sy .gnu_debuglink
 136 and the
 137 .Sy .note.gnu.build-id
 138 ELF sections.
 139 .Ss Iteration Interfaces
 140 The
 141 .Nm
 142 library provides the ability to iterate over the following aspects of a
 143 process or core file:
 144 .Bl -bullet -offset indent
 145 .It
 146 Active threads
 147 .It
 148 Active and zombie threads
 149 .It
 150 All non-system processes
 151 .It
 152 All process mappings
 153 .It
 154 All objects in a process
 155 .It
 156 The environment
 157 .It
 158 The symbol table
 159 .It
 160 Stack frames
 161 .It
 162 File Descriptors
 163 .El
 164 .Ss System Call Injection
 165 The
 166 .Nm
 167 library allows the caller to force system calls to be executed in the
 168 context of the running process.
 169 This can be used both as a tool for introspection, allowing one to get
 170 information outside its current context as well as performing modifications to a
 171 process.
 172 .Pp
 173 These functions run in the context of the calling process.
 174 This is often an easier way of getting non-exported information about a
 175 process from the system.
 176 For example, the
 177 .Xr pfiles 1
 178 command uses this interface to get more detailed information about a
 179 process's open file descriptors, which it would not have access to
 180 otherwise.
 181 .Sh INTERFACES
 182 The shared object
 183 .Sy libproc.so.1
 184 provides the public interfaces defined below.
 185 See
 186 .Xr Intro 3
 187 for additional information on shared object interfaces.
 188 Functions are organized into categories that describe their purpose.
 189 Individual functions are documented in their own manual pages.
 190 .Ss Creation, Grabbing, and Releasing
 191 The following routines are related to creating library handles,
 192 grabbing cores, processes, and threads, and releasing those resources.
 193 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 194 .It Sy Lfree Ta Sy Lgrab
 195 .It Sy Lgrab_error Ta Sy Pcreate
 196 .It Sy Pcreate_agent Ta Sy Pcreate_callback
 197 .It Sy Pcreate_error Ta Sy Pdestroy_agent
 198 .It Sy Pfgrab_core Ta Sy Pfree
 199 .It Sy Pgrab Ta Sy Pgrab_core
 200 .It Sy Pgrab_error Ta Sy Pgrab_file
 201 .It Sy Pgrab_ops Ta Sy Prelease
 202 .It Sy Preopen Ta Sy Pxcreate
 203 .El
 204 .Ss Process interrogation and manipulation
 205 The following routines obtain information about a process and allow
 206 manipulation of the process itself.
 207 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 208 .It Sy Paddr_to_ctf Ta Sy Paddr_to_loadobj
 209 .It Sy Paddr_to_map Ta Sy Paddr_to_text_map
 210 .It Sy Pasfd Ta Sy Pclearfault
 211 .It Sy Pclearsig Ta Sy Pcontent
 212 .It Sy Pcred Ta Sy Pctlfd
 213 .It Sy Pdelbkpt Ta Sy Pdelwapt
 214 .It Sy Pdstop Ta Sy Pexecname
 215 .It Sy Pfault Ta Sy Pfgcore
 216 .It Sy Pgcore Ta Sy Pgetareg
 217 .It Sy Pgetauxval Ta Sy Pgetauxvec
 218 .It Sy Pgetenv Ta Sy Pisprocdir
 219 .It Sy Pissyscall_prev Ta Sy Plmid
 220 .It Sy Plmid_to_loadobj Ta Sy Plmid_to_map
 221 .It Sy Plookup_by_addr Ta Sy Plookup_by_name
 222 .It Sy Pname_to_ctf Ta Sy Pname_to_loadobj
 223 .It Sy Pname_to_map Ta Sy Pobjname
 224 .It Sy Pobjname_resolved Ta Sy Pplatform
 225 .It Sy Ppltdest Ta Sy Ppriv
 226 .It Sy Ppsinfo Ta Sy Pputareg
 227 .It Sy Prd_agent Ta Sy Pread
 228 .It Sy Pread_string Ta Sy Preset_maps
 229 .It Sy Psetbkpt Ta Sy Psecflags
 230 .It Sy Psetcred Ta Sy Psetfault
 231 .It Sy Psetflags Ta Sy Psetpriv
 232 .It Sy Psetrun Ta Sy Psetsignal
 233 .It Sy Psetsysentry Ta Sy Psetsysexit
 234 .It Sy Psetwapt Ta Sy Psetzoneid
 235 .It Sy Psignal Ta Sy Pstate
 236 .It Sy Pstatus Ta Sy Pstop
 237 .It Sy Pstopstatus Ta Sy Psync
 238 .It Sy Psysentry Ta Sy Psysexit
 239 .It Sy Puname Ta Sy Pupanic
 240 .It Sy Pupanic_free Ta Sy Punsetflags
 241 .It Sy Pupdate_maps Ta Sy Pupdate_syms
 242 .It Sy Pwait Ta Sy Pwrite
 243 .It Sy Pxecbkpt Ta Sy Pxecwapt
 244 .It Sy Pxlookup_by_addr Ta Sy Pxlookup_by_addr_resolved
 245 .It Sy Pxlookup_by_name Ta Sy Pzonename
 246 .It Sy Pzonepath Ta Sy Pzoneroot Ta
 247 .El
 248 .Ss Thread interrogation and manipulation
 249 The following routines obtain information about a thread and allow
 250 manipulation of the thread itself.
 251 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 252 .It Sy Lalt_stack Ta Sy Lclearfault
 253 .It Sy Lclearsig Ta Sy Lctlfd
 254 .It Sy Ldstop Ta Sy Lgetareg
 255 .It Sy Lgetfpregs Ta Sy Lgetregs
 256 .It Sy Lgetxregs Ta Sy Lmain_stack
 257 .It Sy Lprochandle Ta Sy Lpsinfo
 258 .It Sy Lputareg Ta Sy Lsetrun
 259 .It Sy Lsetfpregs Ta Sy Lsetregs
 260 .It Sy Lsetxregs Ta Sy Lstack
 261 .It Sy Lstate Ta Sy Lstatus
 262 .It Sy Lstop Ta Sy Lsync
 263 .It Sy Lwait Ta Sy Lxecbkpt
 264 .It Sy Lxecwapt Ta Sy ""
 265 .El
 266 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 267 .It Sy Plwp_alt_stack Ta Sy Plwp_freexregs
 268 .It Sy Plwp_getfpregs Ta Sy Plwp_getname
 269 .It Sy Plwp_getpsinfo Ta Sy Plwp_getregs
 270 .It Sy Plwp_getspymaster Ta Sy Plwp_main_stack
 271 .It Sy Plwp_getxregs Ta Sy Plwp_setfpregs
 272 .It Sy Plwp_setregs Ta Sy Plwp_setxregs
 273 .It Sy Plwp_stack Ta Sy ""
 274 .El
 275 .Ss System Call Injection
 276 The following routines are used to inject specific system calls and have
 277 them run in the context of a process.
 278 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 279 .It Sy pr_access Ta Sy pr_close
 280 .It Sy pr_creat Ta Sy pr_door_info
 281 .It Sy pr_exit Ta Sy pr_fcntl
 282 .It Sy pr_fstat Ta Sy pr_fstat64
 283 .It Sy pr_fstatvfs Ta Sy pr_getitimer
 284 .It Sy pr_getpeername Ta Sy pr_getpeerucred
 285 .It Sy pr_getprojid Ta Sy pr_getrctl
 286 .It Sy pr_getrlimit Ta Sy pr_getrlimit64
 287 .It Sy pr_getsockname Ta Sy pr_getsockopt
 288 .It Sy pr_gettaskid Ta Sy pr_getzoneid
 289 .It Sy pr_ioctl Ta Sy pr_link
 290 .It Sy pr_llseek Ta Sy pr_lseek
 291 .It Sy pr_lstat Ta Sy pr_lstat64
 292 .It Sy pr_memcntl Ta Sy pr_meminfo
 293 .It Sy pr_mmap Ta Sy pr_munmap
 294 .It Sy pr_open Ta Sy pr_processor_bind
 295 .It Sy pr_rename Ta Sy pr_setitimer
 296 .It Sy pr_setrctl Ta Sy pr_setrlimit
 297 .It Sy pr_setrlimit64 Ta Sy pr_settaskid
 298 .It Sy pr_sigaction Ta Sy pr_stat
 299 .It Sy pr_stat64 Ta Sy pr_statvfs
 300 .It Sy pr_unlink Ta Sy pr_waitid
 301 .El
 302 .Ss Iteration routines
 303 These routines are used to iterate over the contents of a process.
 304 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 305 .It Sy Penv_iter Ta Sy Plwp_iter
 306 .It Sy Plwp_iter_all Ta Sy Pmapping_iter
 307 .It Sy Pmapping_iter_resolved Ta Sy Pobject_iter
 308 .It Sy Pobject_iter_resolved Ta Sy Pstack_iter
 309 .It Sy Psymbol_iter Ta Sy Psymbol_iter_by_addr
 310 .It Sy Psymbol_iter_by_lmid Ta Sy Psymbol_iter_by_name
 311 .It Sy Pxsymbol_iter Ta Sy Pfdinfo_iter
 312 .El
 313 .Ss Utility routines
 314 The following routines are utilities that are useful to consumers of the
 315 library.
 316 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 317 .It Sy Perror_printf Ta Sy proc_arg_grab
 318 .It Sy proc_arg_psinfo Ta Sy proc_arg_xgrab
 319 .It Sy proc_arg_xpsinfo Ta Sy proc_content2str
 320 .It Sy proc_dmodelname Ta Sy proc_finistdio
 321 .It Sy proc_fltname Ta Sy proc_fltset2str
 322 .It Sy proc_flushstdio Ta Sy proc_get_auxv
 323 .It Sy proc_fdinfo_misc Ta Sy proc_get_cred
 324 .It Sy proc_get_fdinfo Ta Sy proc_get_lwpsinfo
 325 .It Sy proc_get_priv Ta Sy proc_get_psinfo
 326 .It Sy proc_get_status Ta Sy proc_get_initstdio
 327 .It Sy proc_lwp_in_set Ta Sy proc_lwp_range_valid
 328 .It Sy proc_signame Ta Sy proc_sigset2str
 329 .It Sy proc_str2content Ta Sy proc_str2flt
 330 .It Sy proc_str2fltset Ta Sy proc_str2sig
 331 .It Sy proc_str2sigset Ta Sy proc_str2sys
 332 .It Sy proc_str2sysset Ta Sy proc_sysname
 333 .It Sy proc_sysset2str Ta Sy proc_unctrl_psinfo
 334 .El
 335 .Ss x86 Specific Routines
 336 The following routines are specific to the x86, 32-bit and 64-bit,
 337 versions of the
 338 .Nm
 339 library.
 340 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 341 .It Sy Pldt Ta Sy proc_get_ldt
 342 .El
 343 .Ss SPARC specific Routines
 344 The following functions are specific to the SPARC, 32-bit and 64-bit,
 345 versions of the
 346 .Nm
 347 library.
 348 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 349 .It Sy Plwp_getgwindows Ta Sy ""
 350 .El
 351 .Pp
 352 The following functions are specific to the 64-bit SPARC version of the
 353 .Nm
 354 library.
 355 .Bl -column -offset indent ".Sy Pmapping_iter_resolved" ".Sy Psymbol_iter_by_addr"
 356 .It Sy Plwp_getasrs Ta Sy Plwp_setasrs
 357 .El
 358 .Sh PROCESS STATES
 359 Every process handle that exists in
 360 .Nm
 361 has a state.
 362 In some cases, such as for core files, these states are static.
 363 In other cases, such as handles that correspond to a running process or a
 364 created process, these states are dynamic and change based on actions taken in
 365 the library.
 366 The state can be obtained with the
 367 .Xr Pstate 3PROC
 368 function.
 369 .Pp
 370 The various states are:
 371 .Bl -tag -width Dv -offset indent
 372 .It Dv PS_RUN
 373 An actively running process.
 374 This may be a process that was obtained by creating it with functions such as
 375 .Xr Pcreate 3PROC
 376 or by grabbing an existing process such as
 377 .Xr Pgrab 3PROC .
 378 .It Dv PS_STOP
 379 An active process that is no longer executing.
 380 A process may stop for many reasons such as an explicit stop request (through
 381 .Xr pstop 1
 382 for example) or if a tracing event is hit.
 383 .Pp
 384 The reason a process is stopped may be obtained through the thread's
 385 .Vt lwpstatus_t
 386 structure read directly from /proc or obtained through the
 387 .Xr Lstatus 3PROC
 388 function.
 389 .It Dv PS_LOST
 390 Control over the process has been lost.
 391 This may happen when the process executes a new image requiring a different set
 392 of privileges.
 393 To resume control call
 394 .Xr Preopen 3PROC .
 395 For more information on losing control of a process, see
 396 .Xr proc 5 .
 397 .It Dv PS_UNDEAD
 398 A zombie process.
 399 It has terminated, but it has not been cleaned up yet by its parent.
 400 For more on the conditions of becoming a zombie, see
 401 .Xr exec 2 .
 402 .It Dv PS_DEAD
 403 Processes in this state are always core files.
 404 See the earlier section
 405 .Sx Core Files
 406 for more information on working with core files.
 407 .It Dv PS_IDLE
 408 A process that has never been run.
 409 This is always the case for handles that refer to files as the files cannot be
 410 executed.
 411 Those process handles are obtained through calling
 412 .Xr Pgrab_file 3PROC .
 413 .El
 414 .Pp
 415 Many functions relating to tracing processes, for example
 416 .Xr Psignal 3PROC ,
 417 .Xr Psetsignal 3PROC ,
 418 .Xr Psetfault 3PROC ,
 419 .Xr Psysentry 3PROC ,
 420 and others, mention that they only act upon
 421 .Em Active Processes .
 422 This specifically refers to processes whose state are in
 423 .Dv PS_RUN
 424 and
 425 .Dv PS_STOP .
 426 Process handles in the other states have no notion of settable tracing
 427 flags, though core files
 428 .Pq type Dv PS_DEAD
 429 may have a read-only snapshot of their tracing settings available.
 430 .Sh TYPES
 431 The
 432 .Nm
 433 library uses many types that come from the /proc file system
 434 .Pq Xr proc 5
 435 and the ELF format
 436 .Pq Xr elf 3ELF .
 437 However, it also defines the following types:
 438 .Pp
 439 .Vt struct ps_prochandle
 440 .Pp
 441 The
 442 .Vt struct ps_prochandle
 443 is an opaque handle to the library and the core element of control for a
 444 process.
 445 Consumers obtain pointers to a handle through the use of the
 446 .Fn Pcreate ,
 447 .Fn Pgrab ,
 448 and related functions.
 449 When a caller is done with a handle, then it should call one of the
 450 .Fn Pfree
 451 and
 452 .Fn Prelease
 453 functions to relinquish the handle, release associated resources, and
 454 potentially set the process to run again.
 455 .Pp
 456 .Vt struct ps_lwphandle
 457 .Pp
 458 The
 459 .Vt struct ps_lwphandle
 460 is analogous to the
 461 .Vt struct ps_prochandle ,
 462 but it represents the control of an individual thread, rather than a
 463 process.
 464 Consumers obtain pointers to a handle through the
 465 .Fn Lgrab
 466 function and relinquish it with the
 467 .Fn Lfree
 468 function.
 469 .Pp
 470 .Vt core_content_t
 471 .Pp
 472 The
 473 .Vt core_content_t
 474 is a value which describes the various content types of core files.
 475 These are used in functions such as
 476 .Xr Pcontent 3PROC
 477 and
 478 .Xr Pgcore 3PROC
 479 to describe and control the types of content that get included.
 480 Various content types may be included together through a bitwise-inclusive-OR.
 481 The default system core contents are controlled with the
 482 .Xr coreadm 8
 483 tool.
 484 The following table lists the current set of core contents in the system, though
 485 the set may increase over time.
 486 The string after the macro is the human readable string that corresponds with
 487 the constant and is used by
 488 .Xr coreadm 8 ,
 489 .Xr proc_content2str 3PROC ,
 490 and
 491 .Xr proc_str2content 3PROC .
 492 .Bl -tag -offset indent -width indent
 493 .It Dv CC_CONTENT_STACK ("stack")
 494 The contents include the process stack.
 495 Note, this only covers the main thread's stack.
 496 The stack of other threads is covered by
 497 .Dv CC_CONTENT_ANON .
 498 .It Dv CC_CONTENT_HEAP ("heap")
 499 The contents include the process heap.
 500 .It Dv CC_CONTENT_SHFILE ("shfile")
 501 The contents include shared mappings that are backed by files (e.g.
 502 mapped through
 503 .Xr mmap 2
 504 with the
 505 .Dv MAP_SHARED
 506 flag).
 507 .It Dv CC_CONTENT_SHANNON ("shannon")
 508 The contents include shared mappings that are backed by anonymous memory
 509 (e.g. mapped through
 510 .Xr mmap 2
 511 with the
 512 .Dv MAP_SHARED
 513 and
 514 .Dv MAP_ANON
 515 flags).
 516 .It Dv CC_CONTENT_RODATA ("rodata")
 517 The contents include private read-only file mappings, such as shared
 518 library text.
 519 .It Dv CC_CONTENT_ANON ("anon")
 520 The contents include private anonymous mappings.
 521 This includes the stacks of threads which are not the main thread.
 522 .It Dv CC_CONTENT_SHM ("shm")
 523 The contents include system V shared memory.
 524 .It Dv CC_CONTENT_ISM ("ism")
 525 The contents include ISM (intimate shared memory) mappings.
 526 .It Dv CC_CONTENT_DISM ("dism")
 527 The contents include DISM (dynamic shared memory) mappings.
 528 .It Dv CC_CONTENT_CTF ("ctf")
 529 The contents include
 530 .Xr ctf 5
 531 (Compact C Type Format) information.
 532 Note, not all objects in the process may have CTF information available.
 533 .It Dv CC_CONTENT_SYMTAB ("symtab")
 534 The contents include the symbol table.
 535 Note, not all objects in the process may have a symbol table available.
 536 .It Dv CC_CONTENT_ALL ("all")
 537 This value indicates that all of the above content values are present.
 538 Note that additional values may be added in the future, in which case
 539 the value of the symbol will be updated to include them.
 540 Comparisons with
 541 .Dv CC_CONTENT_ALL
 542 should validate all the expected bits are set by an expression such as
 543 .Li (c & CC_CONTENT_ALL) == CC_CONTENT_ALL .
 544 .It Dv CC_CONTENT_NONE ("none")
 545 This value indicates that there is no content present.
 546 .It Dv CC_CONTENT_DEFAULT ("default")
 547 The content includes the following set of default values:
 548 .Dv CC_CONTENT_STACK ,
 549 .Dv CC_CONTENT_HEAP ,
 550 .Dv CC_CONTENT_ISM ,
 551 .Dv CC_CONTENT_DISM ,
 552 .Dv CC_CONTENT_SHM ,
 553 .Dv CC_CONTENT_SHANON ,
 554 .Dv CC_CONTENT_TEXT ,
 555 .Dv CC_CONTENT_DATA ,
 556 .Dv CC_CONTENT_RODATA ,
 557 .Dv CC_CONTENT_ANON ,
 558 .Dv CC_CONTENT_CTF ,
 559 and
 560 .Dv CC_CONTENT_SYMTAB .
 561 Note that the default may change.
 562 Comparisons with CC_CONTENT_DEFAULT should validate that all of the expected
 563 bits are set with an expression such as
 564 .Li (c\ &\ CC_CONTENT_DEFAULT)\ ==\ CC_CONTENT_DEFAULT .
 565 .It Dv CC_CONTENT_INVALID
 566 This indicates that the contents are invalid.
 567 .El
 568 .Pp
 569 .Vt prfdinfo_t
 570 .Pp
 571 The
 572 .Vt prfdinfo_t
 573 structure is used with the
 574 .Fn Pfdinfo_iter ,
 575 .Fn proc_fdwalk ,
 576 .Fn proc_fdinfowalk
 577 and
 578 .Fn proc_get_fdinfo
 579 functions and describes information about a file descriptor.
 580 The structure is defined as follows:
 581 .Bd -literal
 582 typedef struct prfdinfo {
 583     int         pr_fd;          /* file descriptor number */
 584     mode_t      pr_mode;        /* (see st_mode in stat(2)) */
 585     ino64_t     pr_ino;         /* inode number */
 586     off64_t     pr_size;        /* file size */
 587     off64_t     pr_offset;      /* current offset */
 588     uid_t       pr_uid;         /* owner's user id */
 589     gid_t       pr_gid;         /* owner's group id */
 590     major_t     pr_major;       /* major number of device */
 591     minor_t     pr_minor;       /* minor number of device */
 592     major_t     pr_rmajor;      /* major number (if special file) */
 593     minor_t     pr_rminor;      /* minor number (if special file) */
 594     int         pr_fileflags;   /* (see F_GETXFL in fcntl(2)) */
 595     int         pr_fdflags;     /* (see F_GETFD in fcntl(2)) */
 596     short       pr_locktype;    /* (see F_GETLK in fcntl(2)) */
 597     pid_t       pr_lockpid;     /* process holding file lock */
 598     int         pr_locksysid;   /* sysid of locking process */
 599     pid_t       pr_peerpid;     /* peer process (socket, door) */
 600     int         pr_filler[25];  /* reserved for future use */
 601     char        pr_peername[PRFNSZ];    /* peer process name */
 602 #if    __STDC_VERSION__ >= 199901L
 603     uint8_t     pr_misc[];      /* self describing structures */
 604 else
 605     uint8_t     pr_misc[1];     /* self describing structures */
 606 #endif
 607 } prfdinfo_t;
 608 .Ed
 609 .Pp
 610 The structure has similar information to that found in the
 611 .Sy stat
 612 structure that's used as part of the stat family of system calls,
 613 defined in
 614 .Xr stat 2 .
 615 The member
 616 .Sy pr_fd
 617 contains the number of the file descriptor of the file.
 618 The members
 619 .Fa pr_mode ,
 620 .Fa pr_uid ,
 621 .Fa pr_gid ,
 622 .Fa pr_ino ,
 623 and
 624 .Fa pr_size
 625 are the same as the members
 626 .Fa st_mode ,
 627 .Fa st_uid ,
 628 .Fa st_gid ,
 629 .Fa st_ino ,
 630 and
 631 .Fa st_size
 632 in the
 633 .Fa stat
 634 structure.
 635 .Pp
 636 The
 637 .Fa pr_major
 638 and
 639 .Fa pr_minor
 640 members contain the major and minor numbers of the device containing the
 641 directory for this file.
 642 This is similar to the
 643 .Fa st_dev
 644 member of the
 645 .Vt stat
 646 structure, except that it is broken out into its major and minor components.
 647 The
 648 .Fa pr_rmajor
 649 and
 650 .Fa pr_rminor
 651 members are similar in spirit to
 652 .Fa pr_major
 653 and
 654 .Fa pr_minor ;
 655 however, they are equivalent to the
 656 .Fa st_rdev
 657 member of the
 658 .Vt stat
 659 structure and thus have meaning for special character and block files.
 660 .Pp
 661 The
 662 .Fa pr_offset
 663 member contains the current seek offset of the file descriptor.
 664 The
 665 .Fa pr_fileflags
 666 and
 667 .Fa pr_fdflags
 668 members contain the flags that would have been returned by a call to
 669 .Xr fcntl 2
 670 with the arguments
 671 .Dv F_GETXFL
 672 and
 673 .Dv F_GETFD
 674 respectively.
 675 .Pp
 676 The
 677 .Fa pr_locktype ,
 678 .Fa pr_lockpid ,
 679 and
 680 .Fa pr_locksysid
 681 contain the information that would have been returned by a call to
 682 .Xr fcntl 2
 683 with an argument of
 684 .Dv F_GETLK .
 685 .Pp
 686 The
 687 .Fa pr_peerpid
 688 and
 689 .Fa pr_peername
 690 members contain the process ID and name of any peer endpoint of a
 691 connection-oriented socket or stream fd.
 692 This information is the same as that which would be returned by a call to
 693 .Xr getpeerucred 3C
 694 .Pp
 695 The
 696 .Fa pr_misc
 697 member contains miscellaneous additional data relating to the file descriptor.
 698 The format of these data is described in
 699 .Xr proc 5 .
 700 .Pp
 701 .Vt prsyminfo_t
 702 .Pp
 703 The
 704 .Vt prsyminfo_t
 705 structure is used with the various symbol look up functions
 706 .Fn Pxlookup_by_name ,
 707 .Fn Pxlookup_by_addr ,
 708 and
 709 .Fn Pxlookup_by_addr_resolved
 710 which describes additional information about a symbol.
 711 The structure is defined as follows:
 712 .Bd -literal
 713 typedef struct prsyminfo {
 714         const char      *prs_object;            /* object name */
 715         const char      *prs_name;              /* symbol name */
 716         Lmid_t          prs_lmid;               /* link map id */
 717         uint_t          prs_id;                 /* symbol id */
 718         uint_t          prs_table;              /* symbol table id */
 719 } prsyminfo_t;
 720 .Ed
 721 .Pp
 722 The member
 723 .Fa prs_object
 724 points to a string that contains the name of the object file, if known,
 725 that the symbol comes from.
 726 The member
 727 .Fa prs_name
 728 points to the name of the symbol, if known.
 729 This may be unknown due to a stripped binary that contains no symbol table.
 730 The member
 731 .Fa prs_lmid
 732 indicates the link map identifier that the symbol was found on.
 733 For more information on link map identifiers refer to the
 734 .%B Linker and Libraries Guide
 735 and
 736 .Xr dlopen 3C .
 737 .Pp
 738 The members
 739 .Fa prs_id
 740 and
 741 .Fa prs_table
 742 can be used to determine both the symbol table that the entry came from
 743 and which entry in the table it corresponds to.
 744 If the value of
 745 .Fa prs_table
 746 is
 747 .Dv PR_SYMTAB
 748 then it came from the ELF standard symbol table.
 749 However, if it is instead
 750 .Dv PR_DYNSYM ,
 751 then that indicates that it comes from the process's dynamic section.
 752 .Pp
 753 .Vt proc_lwp_f
 754 .Pp
 755 The
 756 .Vt proc_lwp_f
 757 is a function pointer type that is used with the
 758 .Fn Plwp_iter
 759 function.
 760 It is defined as
 761 .Sy typedef
 762 .Ft int
 763 .Fo proc_lwp_f
 764 .Fa "void *"
 765 .Fa "const lwpstatus_t *"
 766 .Fc .
 767 The first argument is a pointer to an argument that the user specifies,
 768 while the second has the thread's status information and is defined in
 769 .Xr proc 5 .
 770 For additional information on using this type, see
 771 .Xr Plwp_iter 3PROC .
 772 .Pp
 773 .Vt proc_lwp_all_f
 774 .Pp
 775 The
 776 .Vt proc_lwp_all_f
 777 is a function pointer type that is used with the
 778 .Fn Plwp_iter_all
 779 function.
 780 It is defined as
 781 .Sy typedef
 782 .Ft int
 783 .Fo proc_lwp_all_f
 784 .Fa "void *"
 785 .Fa "const lwpstatus_t *"
 786 .Fa "const lwpsinfo_t *"
 787 .Fc .
 788 The first argument is a pointer to an argument that the user specifies.
 789 The second and third arguments contain the thread's status and
 790 thread-specific
 791 .Xr ps 1
 792 information respectively.
 793 Both structures are defined in
 794 .Xr proc 5 .
 795 For additional information on using this type, see
 796 .Xr Plwp_iter_all 3PROC .
 797 .Pp
 798 .Vt proc_fdinfowalk_f
 799 .Pp
 800 The
 801 .Vt proc_fdinfowalk_f
 802 is a function pointer type that is used with the
 803 .Fn proc_fdinfowalk
 804 function to walk the miscellaneous data items contained within a
 805 .Vt prfdinfo_t
 806 structure.
 807 It is defined as
 808 .Sy typedef
 809 .Ft int
 810 .Fo proc_fdinfowalk_f
 811 .Fa "uint_t"
 812 .Fa "const void *"
 813 .Fa "size_t"
 814 .Fa "void *"
 815 .Fc .
 816 The first argument contains the type of the miscellaneous information being
 817 presented, the second and third provide a pointer to the associated data and
 818 the length of that data.
 819 The final argument is a pointer to an argument that the user specifies.
 820 For more information on using this, see
 821 .Xr proc_fdinfowalk 3PROC .
 822 .Pp
 823 .Vt proc_fdwalk_f
 824 .Pp
 825 The
 826 .Vt proc_fdwalk_f
 827 is a function pointer type that is used with the
 828 .Fn proc_fdwalk
 829 function.
 830 It is defined as
 831 .Sy typedef
 832 .Ft int
 833 .Fo proc_fdwalk_f
 834 .Fa "const prfdinfo_t *"
 835 .Fa "void *"
 836 .Fc .
 837 The first argument contains the file descriptor information.
 838 The
 839 .Sy prfdinfo_t
 840 structure is defined in
 841 .Xr proc 5 .
 842 The final argument is a pointer to an argument that the user specifies.
 843 For more information on using this, see
 844 .Xr proc_fdwalk 3PROC .
 845 .Pp
 846 .Vt proc_walk_f
 847 .Pp
 848 The
 849 .Vt proc_walk_f
 850 is a function pointer type that is used with the
 851 .Fn proc_walk
 852 function.
 853 It is defined as
 854 .Sy typedef
 855 .Ft int
 856 .Fo proc_walk_f
 857 .Fa "psinfo_t *"
 858 .Fa "lwpsinfo_t *"
 859 .Fa "void *"
 860 .Fc .
 861 The first argument contains the process
 862 .Xr ps 1
 863 information and the second argument contains the representative thread's
 864 .Xr ps 1
 865 information.
 866 Both structures are defined in
 867 .Xr proc 5 .
 868 The final argument is a pointer to an argument that the user specifies.
 869 For more information on using this, see
 870 .Xr proc_walk 3PROC .
 871 .Pp
 872 .Vt proc_map_f
 873 .Pp
 874 The
 875 .Vt proc_map_f
 876 is a function pointer type that is used with the
 877 .Fn Pmapping_iter ,
 878 .Fn Pmapping_iter_resolved ,
 879 .Fn Pobject_iter ,
 880 and
 881 .Fn Pobject_iter_resolved
 882 functions.
 883 It is defined as
 884 .Sy typedef
 885 .Ft int
 886 .Fo proc_map_f
 887 .Fa "void *"
 888 .Fa "const prmap_t *"
 889 .Fa "const char *"
 890 .Fc .
 891 The first argument is a pointer to an argument that the user specifies.
 892 The second argument is describes the mapping information and is defined
 893 in
 894 .Xr proc 5 .
 895 The final argument contains the name of the mapping or object file in
 896 question.
 897 For additional information on using this type, see
 898 .Xr Pmapping_iter 3PROC .
 899 .Pp
 900 .Vt proc_env_f
 901 .Pp
 902 The
 903 .Vt proc_env_f
 904 is a function pointer type that is used with the
 905 .Fn Penv_iter
 906 function.
 907 It is defined as
 908 .Sy typedef
 909 .Ft int
 910 .Fo proc_env_f
 911 .Fa "void *"
 912 .Fa "struct ps_prochandle *"
 913 .Fa "uintptr_t"
 914 .Fa "const char *"
 915 .Fc .
 916 The first argument is a pointer to an argument that the user specifies.
 917 The second argument is a pointer to the
 918 .Vt struct ps_prochandle
 919 that the callback was passed to.
 920 The third argument is the address of the environment variable in the process.
 921 The fourth argument is the environment variable.
 922 Values in the environment follow the convention of the form
 923 .Em variable=value .
 924 For more information on environment variables see
 925 .Xr exec 2
 926 and
 927 .Xr environ 7 .
 928 For additional information on using this type, see
 929 .Xr Penv_iter 3PROC .
 930 .Pp
 931 .Vt proc_sym_f
 932 .Pp
 933 The
 934 .Vt proc_sym_f
 935 is a function pointer type that is used with the
 936 .Fn Psmbol_iter ,
 937 .Fn Psymbol_iter_by_addr ,
 938 .Fn Psymbol_iter_by_name ,
 939 and
 940 .Fn Psymbol_iter_by_lmid
 941 functions.
 942 It is defined as
 943 .Sy typedef
 944 .Ft int
 945 .Fo proc_sym_f
 946 .Fa "void *"
 947 .Fa "const GElf_Sym *"
 948 .Fa "const char *"
 949 .Fc .
 950 The first argument is a pointer to an argument that the user supplies.
 951 The second argument is a pointer to the ELF symbol information in a
 952 32-bit and 64-bit neutral form.
 953 See
 954 .Xr elf 3ELF
 955 and
 956 .Xr gelf 3ELF
 957 for more information on it.
 958 The final argument points to a character string that has the name of the symbol.
 959 For additional information on using this type, see
 960 .Xr Psymbol_iter 3PROC ,
 961 .Xr Psymbol_iter_by_addr 3PROC ,
 962 .Xr Psymbol_iter_by_name 3PROC ,
 963 and
 964 .Xr Psymbol_iter_by_lmid 3PROC .
 965 .Pp
 966 .Vt proc_xsym_f
 967 .Pp
 968 The
 969 .Vt proc_xsym_f
 970 is a function pointer type that is used with the
 971 .Fn Pxsymbol_iter
 972 function.
 973 It is defined as
 974 .Sy typedef
 975 .Ft int
 976 .Fo proc_xsym_f
 977 .Fa "void *"
 978 .Fa "const GElf_Sym *"
 979 .Fa "const char *"
 980 .Fa "const prsyminfo_t *"
 981 .Fc .
 982 The first three arguments are identical to those of
 983 .Vt proc_sym_f .
 984 The final argument contains additional information about the symbol
 985 itself.
 986 The members of the
 987 .Vt prsyminfo_t
 988 are defined earlier in this section.
 989 For additional information on using this type, see
 990 .Xr Pxsymbol_iter 3PROC .
 991 .Pp
 992 .Vt proc_stack_f
 993 .Pp
 994 The
 995 .Vt proc_stack_f
 996 is a function pointer type that is used with the
 997 .Fn Pstack_iter
 998 function.
 999 It is defined as
1000 .Sy typedef
1001 .Ft int
1002 .Fo proc_stack_f
1003 .Fa "void *"
1004 .Fa "prgregset_t"
1005 .Fa "uint_t"
1006 .Fa "const long *"
1007 .Fc .
1008 The first argument is a pointer to an argument that the user specifies.
1009 The second argument's contents are platform specific.
1010 The registers that contain stack information, usually the stack pointer and
1011 frame pointer, will be filled in to point to an entry.
1012 The
1013 .Vt prgregset_t
1014 is defined in
1015 .Xr proc 5 .
1016 .Pp
1017 The third argument contains the number of arguments to the current stack
1018 frame and the fourth argument contains an array of addresses that
1019 correspond to the arguments to that stack function.
1020 The value of the third argument dictates the number of entries in the fourth
1021 argument.
1022 For additional information on using this type, see
1023 .Xr Pstack_iter 3PROC .
1024 .Pp
1025 .Vt proc_fdinfo_f
1026 .Pp
1027 The
1028 .Vt proc_fdinfo_f
1029 is a function pointer type that is used with the
1030 .Fn Pfdinfo_iter
1031 function.
1032 It is defined as
1033 .Sy typedef
1034 .Ft int
1035 .Fo proc_fdinfo_f
1036 .Fa "void *"
1037 .Fa "prfdinfo_t *"
1038 .Fc .
1039 The first argument is a pointer to an argument that the user specifies.
1040 The second argument contains information about an open file descriptor.
1041 The members of the
1042 .Vt prfdinfo_t
1043 are defined earlier in this section.
1044 For additional information on using this type, see
1045 .Xr Pfdinfo_iter 3PROC .
1046 .Sh PROGRAMMING NOTES
1047 When working with live processes, whether from the
1048 .Xr Pgrab 3PROC
1049 or
1050 .Xr Pcreate 3PROC
1051 family of functions, there are some additional considerations.
1052 Importantly, if a process calls any of the
1053 .Xr exec 2
1054 suite of functions, much of the state information that is obtained,
1055 particularly that about mappings in the process will be invalid.
1056 Callers must ensure that they call
1057 .Xr Preset_maps 3PROC
1058 when they hold a process handle across an exec.
1059 In addition, users of the library should familiarize themselves with the
1060 .Sy PROGRAMMING NOTES
1061 section of the
1062 .Xr proc 5
1063 manual page, which discusses issues of privileges and security.
1064 .Sh DEBUGGING
1065 The library provides a means for obtaining additional debugging
1066 information.
1067 The output itself is not part of the
1068 .Nm
1069 library's stable interface.
1070 Setting the environment variable
1071 .Ev LIBPROC_DEBUG
1072 to some value will print information to standard error.
1073 For example,
1074 .Ev LIBPROC_DEBUG Ns = Ns Em please .
1075 .Sh LOCKING
1076 Most functions operate on a handle to a process in the form of a
1077 .Vt "struct ps_prochandle *" .
1078 Unless otherwise indicated, the library does not provide any
1079 synchronization for different routines that are operating on the
1080 .Sy same
1081 .Nm
1082 library handle.
1083 It is up to the caller to ensure that only a single thread is using a handle at
1084 any given time.
1085 Multiple threads may call
1086 .Nm
1087 library routines at the same time as long as each thread is using a
1088 different handle.
1089 .Pp
1090 Each individual function notes its
1091 .Sy MT-Level
1092 section.
1093 The MT-Level of a routine that matches the above description will refer to this
1094 manual page.
1095 If it does not, then it refers to the standard attributes in
1096 .Xr attributes 7 .
1097 .Sh INTERFACE STABILITY
1098 .Sy Uncommitted
1099 .Pp
1100 While the library is considered an uncommitted interface, and is still
1101 evolving, changes that break compatibility have been uncommon and this
1102 trend is expected to continue.
1103 It is documented to allow consumers, whether part of illumos or outside of it,
1104 to understand the library and make use of it with the understanding that
1105 changes may occur which break both source and binary compatibility.
1106 .Sh SEE ALSO
1107 .Xr gcore 1 ,
1108 .Xr mdb 1 ,
1109 .Xr proc 1 ,
1110 .Xr ps 1 ,
1111 .Xr exec 2 ,
1112 .Xr fcntl 2 ,
1113 .Xr stat 2 ,
1114 .Xr Intro 3 ,
1115 .Xr dlopen 3C ,
1116 .Xr elf 3ELF ,
1117 .Xr ctf 5 ,
1118 .Xr proc 5 ,
1119 .Xr attributes 7 ,
1120 .Xr environ 7 ,
1121 .Xr privileges 7 ,
1122 .Xr coreadm 8
1123 .Pp
1124 .Rs
1125 .%T Linkers and Libraries Guide
1126 .Re
1127 .Pp
1128 .Xr Lfree 3PROC ,
1129 .Xr Lgrab 3PROC ,
1130 .Xr Lgrab_error 3PROC ,
1131 .Xr Pcreate 3PROC ,
1132 .Xr Pcreate_agent 3PROC ,
1133 .Xr Pcreate_callback 3PROC ,
1134 .Xr Pcreate_error 3PROC ,
1135 .Xr Pdestroy_agent 3PROC ,
1136 .Xr Pfgrab_core 3PROC ,
1137 .Xr Pfree 3PROC ,
1138 .Xr Pgrab 3PROC ,
1139 .Xr Pgrab_core 3PROC ,
1140 .Xr Pgrab_error 3PROC ,
1141 .Xr Pgrab_file 3PROC ,
1142 .Xr Pgrab_ops 3PROC ,
1143 .Xr Prelease 3PROC ,
1144 .Xr Preopen 3PROC ,
1145 .Xr Pxcreate 3PROC
1146 .Pp
1147 .Xr Paddr_to_ctf 3PROC ,
1148 .Xr Paddr_to_loadobj 3PROC ,
1149 .Xr Paddr_to_map 3PROC ,
1150 .Xr Paddr_to_text_map 3PROC ,
1151 .Xr Pasfd 3PROC ,
1152 .Xr Pclearfault 3PROC ,
1153 .Xr Pclearsig 3PROC ,
1154 .Xr Pcontent 3PROC ,
1155 .Xr Pcred 3PROC ,
1156 .Xr Pctlfd 3PROC ,
1157 .Xr Pdelbkpt 3PROC ,
1158 .Xr Pdelwapt 3PROC ,
1159 .Xr Pdstop 3PROC ,
1160 .Xr Pexecname 3PROC ,
1161 .Xr Pfault 3PROC ,
1162 .Xr Pfgcore 3PROC ,
1163 .Xr Pgcore 3PROC ,
1164 .Xr Pgetareg 3PROC ,
1165 .Xr Pgetauxval 3PROC ,
1166 .Xr Pgetauxvec 3PROC ,
1167 .Xr Pgetenv 3PROC ,
1168 .Xr Pisprocdir 3PROC ,
1169 .Xr Pissyscall_prev 3PROC ,
1170 .Xr Plmid 3PROC ,
1171 .Xr Plmid_to_loadobj 3PROC ,
1172 .Xr Plmid_to_map 3PROC ,
1173 .Xr Plookup_by_addr 3PROC ,
1174 .Xr Plookup_by_name 3PROC ,
1175 .Xr Plwp_alt_stack 3PROC ,
1176 .Xr Plwp_getfpregs 3PROC ,
1177 .Xr Plwp_getpsinfo 3PROC ,
1178 .Xr Plwp_getregs 3PROC ,
1179 .Xr Plwp_getspymaster 3PROC ,
1180 .Xr Plwp_main_stack 3PROC ,
1181 .Xr Plwp_setfpregs 3PROC ,
1182 .Xr Plwp_setregs 3PROC ,
1183 .Xr Plwp_stack 3PROC ,
1184 .Xr Pname_to_ctf 3PROC ,
1185 .Xr Pname_to_loadobj 3PROC ,
1186 .Xr Pname_to_map 3PROC ,
1187 .Xr Pobjname 3PROC ,
1188 .Xr Pobjname_resolved 3PROC ,
1189 .Xr Pplatform 3PROC ,
1190 .Xr Ppltdest 3PROC ,
1191 .Xr Ppriv 3PROC ,
1192 .Xr Ppsinfo 3PROC ,
1193 .Xr Pputareg 3PROC ,
1194 .Xr Prd_agent 3PROC ,
1195 .Xr Pread 3PROC ,
1196 .Xr Pread_string 3PROC ,
1197 .Xr Preset_maps 3PROC ,
1198 .Xr Psecflags 3PROC ,
1199 .Xr Psetbkpt 3PROC ,
1200 .Xr Psetcred 3PROC ,
1201 .Xr Psetfault 3PROC ,
1202 .Xr Psetflags 3PROC ,
1203 .Xr Psetpriv 3PROC ,
1204 .Xr Psetrun 3PROC ,
1205 .Xr Psetsignal 3PROC ,
1206 .Xr Psetsysentry 3PROC ,
1207 .Xr Psetsysexit 3PROC ,
1208 .Xr Psetwapt 3PROC ,
1209 .Xr Psetzoneid 3PROC ,
1210 .Xr Psignal 3PROC ,
1211 .Xr Pstate 3PROC ,
1212 .Xr Pstatus 3PROC ,
1213 .Xr Pstop 3PROC ,
1214 .Xr Pstopstatus 3PROC ,
1215 .Xr Psync 3PROC ,
1216 .Xr Psysentry 3PROC ,
1217 .Xr Psysexit 3PROC ,
1218 .Xr Puname 3PROC ,
1219 .Xr Pupanic 3PROC ,
1220 .Xr Pupanic_free 3PROC ,
1221 .Xr Punsetflags 3PROC ,
1222 .Xr Pupdate_maps 3PROC ,
1223 .Xr Pupdate_syms 3PROC ,
1224 .Xr Pwait 3PROC ,
1225 .Xr Pwrite 3PROC ,
1226 .Xr Pxecbkpt 3PROC ,
1227 .Xr Pxecwapt 3PROC ,
1228 .Xr Pxlookup_by_addr 3PROC ,
1229 .Xr Pxlookup_by_addr_resolved 3PROC ,
1230 .Xr Pxlookup_by_name 3PROC ,
1231 .Xr Pzonename 3PROC ,
1232 .Xr Pzonepath 3PROC ,
1233 .Xr Pzoneroot 3PROC
1234 .Pp
1235 .Xr Lalt_stack 3PROC ,
1236 .Xr Lclearfault 3PROC ,
1237 .Xr Lclearsig 3PROC ,
1238 .Xr Lctlfd 3PROC ,
1239 .Xr Ldstop 3PROC ,
1240 .Xr Lgetareg 3PROC ,
1241 .Xr Lmain_stack 3PROC ,
1242 .Xr Lprochandle 3PROC ,
1243 .Xr Lpsinfo 3PROC ,
1244 .Xr Lputareg 3PROC ,
1245 .Xr Lsetrun 3PROC ,
1246 .Xr Lstack 3PROC ,
1247 .Xr Lstate 3PROC ,
1248 .Xr Lstatus 3PROC ,
1249 .Xr Lstop 3PROC ,
1250 .Xr Lsync 3PROC ,
1251 .Xr Lwait 3PROC ,
1252 .Xr Lxecbkpt 3PROC ,
1253 .Xr Lxecwapt 3PROC
1254 .Pp
1255 .Xr pr_access 3PROC ,
1256 .Xr pr_close 3PROC ,
1257 .Xr pr_creat 3PROC ,
1258 .Xr pr_door_info 3PROC ,
1259 .Xr pr_exit 3PROC ,
1260 .Xr pr_fcntl 3PROC ,
1261 .Xr pr_fstat 3PROC ,
1262 .Xr pr_fstat64 3PROC ,
1263 .Xr pr_fstatvfs 3PROC ,
1264 .Xr pr_getitimer 3PROC ,
1265 .Xr pr_getpeername 3PROC ,
1266 .Xr pr_getpeerucred 3PROC ,
1267 .Xr pr_getprojid 3PROC ,
1268 .Xr pr_getrctl 3PROC ,
1269 .Xr pr_getrlimit 3PROC ,
1270 .Xr pr_getrlimit64 3PROC ,
1271 .Xr pr_getsockname 3PROC ,
1272 .Xr pr_getsockopt 3PROC ,
1273 .Xr pr_gettaskid 3PROC ,
1274 .Xr pr_getzoneid 3PROC ,
1275 .Xr pr_ioctl 3PROC ,
1276 .Xr pr_link 3PROC ,
1277 .Xr pr_llseek 3PROC ,
1278 .Xr pr_lseek 3PROC ,
1279 .Xr pr_lstat 3PROC ,
1280 .Xr pr_lstat64 3PROC ,
1281 .Xr pr_memcntl 3PROC ,
1282 .Xr pr_meminfo 3PROC ,
1283 .Xr pr_mmap 3PROC ,
1284 .Xr pr_munmap 3PROC ,
1285 .Xr pr_open 3PROC ,
1286 .Xr pr_processor_bind 3PROC ,
1287 .Xr pr_rename 3PROC ,
1288 .Xr pr_setitimer 3PROC ,
1289 .Xr pr_setrctl 3PROC ,
1290 .Xr pr_setrlimit 3PROC ,
1291 .Xr pr_setrlimit64 3PROC ,
1292 .Xr pr_settaskid 3PROC ,
1293 .Xr pr_sigaction 3PROC ,
1294 .Xr pr_stat 3PROC ,
1295 .Xr pr_stat64 3PROC ,
1296 .Xr pr_statvfs 3PROC ,
1297 .Xr pr_unlink 3PROC ,
1298 .Xr pr_waitid 3PROC ,
1299 .Pp
1300 .Xr Penv_iter 3PROC ,
1301 .Xr Plwp_iter 3PROC ,
1302 .Xr Plwp_iter_all 3PROC ,
1303 .Xr Pmapping_iter 3PROC ,
1304 .Xr Pmapping_iter_resolved 3PROC ,
1305 .Xr Pobject_iter 3PROC ,
1306 .Xr Pobject_iter_resolved 3PROC ,
1307 .Xr Pstack_iter 3PROC ,
1308 .Xr Psymbol_iter 3PROC ,
1309 .Xr Psymbol_iter_by_addr 3PROC ,
1310 .Xr Psymbol_iter_by_lmid 3PROC ,
1311 .Xr Psymbol_iter_by_name 3PROC ,
1312 .Xr Pxsymbol_iter 3PROC ,
1313 .Xr Pfdinfo_iter 3PROC
1314 .Pp
1315 .Xr Perror_printf 3PROC ,
1316 .Xr proc_arg_grab 3PROC ,
1317 .Xr proc_arg_psinfo 3PROC ,
1318 .Xr proc_arg_xgrab 3PROC ,
1319 .Xr proc_arg_xpsinfo 3PROC ,
1320 .Xr proc_content2str 3PROC ,
1321 .Xr proc_dmodelname 3PROC ,
1322 .Xr proc_finistdio 3PROC ,
1323 .Xr proc_fltname 3PROC ,
1324 .Xr proc_fltset2str 3PROC ,
1325 .Xr proc_flushstdio 3PROC ,
1326 .Xr proc_get_auxv 3PROC ,
1327 .Xr proc_get_cred 3PROC ,
1328 .Xr proc_get_fdinfo 3PROC ,
1329 .Xr proc_get_priv 3PROC ,
1330 .Xr proc_get_psinfo 3PROC ,
1331 .Xr proc_get_status 3PROC ,
1332 .Xr proc_initstdio 3PROC ,
1333 .Xr proc_lwp_in_set 3PROC ,
1334 .Xr proc_lwp_range_valid 3PROC ,
1335 .Xr proc_signame 3PROC ,
1336 .Xr proc_sigset2str 3PROC ,
1337 .Xr proc_str2content 3PROC ,
1338 .Xr proc_str2flt 3PROC ,
1339 .Xr proc_str2fltset 3PROC ,
1340 .Xr proc_str2sig 3PROC ,
1341 .Xr proc_str2sigset 3PROC ,
1342 .Xr proc_str2sys 3PROC ,
1343 .Xr proc_str2sysset 3PROC ,
1344 .Xr proc_sysname 3PROC ,
1345 .Xr proc_sysset2str 3PROC ,
1346 .Xr proc_unctrl_psinfo 3PROC ,
1347 .Xr proc_fdinfowalk 3PROC ,
1348 .Xr proc_fdwalk 3PROC ,
1349 .Xr proc_walk 3PROC
1350 .Pp
1351 .Xr Pldt 3PROC ,
1352 .Xr proc_get_ldt 3PROC ,
1353 .Pp
1354 .Xr Plwp_getgwindows 3PROC ,
1355 .Xr Plwp_getxregs 3PROC ,
1356 .Xr Plwp_setxregs 3PROC ,
1357 .Pp
1358 .Xr Plwp_getasrs 3PROC ,
1359 .Xr Plwp_setasrs 3PROC