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