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