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 March 10, 2023
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
26 The
27 .Nm
28 library provides consumers a general series of interfaces to inspect
29 and control both live processes and core files.
30 It is intended for introspection tools such as debuggers by providing a
31 high-level interface to the /proc file system
32 .Pf ( Xr proc 5 ) .
33 .Pp
34 The
35 .Nm
36 library provides interfaces that focus on:
37 .Bl -bullet -offset indent
38 .It
39 Creating and attaching to live process, core files, and arbitrary ELF
40 objects.
41 .It
42 Interrogating the state of a process or core file.
43 .It
44 Manipulating the current state of a process or thread.
45 .It
46 Interrogating the state of threads of a process or core file.
47 .It
48 Running system calls in the context of another process.
49 .It
50 Various utilities for iterating process and core file file descriptors,
51 mappings, symbols, and more.
52 .It
53 Various utilities to support debugging tools.
54 .El
55 .Ss Live Processes
56 The
57 .Nm
58 library can be used to manipulate running processes and to create new
59 ones.
60 To manipulate an existing process first
61 .Em grab
62 it with the
63 .Fn Pgrab
64 function.
65 A process is generally stopped as a side effect of grabbing it.
66 Callers must exercise caution, as if they do not use the library correctly, or
67 they terminate unexpectedly, a process may remain stopped.
68 .Pp
69 Unprivileged users may only grab their own processes.
70 Users with the privilege
71 .Brq Sy PRIV_PROC_OWNER
72 may manipulate processes that they do not own; however, additional
73 restrictions as described in
74 .Xr privileges 7
75 apply.
76 .Pp
77 In addition, the
78 .Fn Pcreate
79 and
80 .Fn Pxcreate
81 functions may be used to create processes which are always controlled by
82 the library.
83 .Ss Core Files
84 The
85 .Nm
86 library has the ability to open and interpret core files produced by
87 processes on the system.
88 Process core dump generation is controlled by the
89 .Xr coreadm 8
90 command.
91 In addition, the library has the ability to understand and interpret core dumps
92 generated by Linux kernel and can provide a subset of its functionality on such
93 core files, provided the original binary is also present.
94 .Pp
95 Not all functions in the
96 .Nm
97 library are valid for core files.
98 In general, none of the commands which manipulate the current state of a process
99 or thread or that try to force system calls on a victim process will work.
100 Furthermore several of the information and iteration interfaces are limited
101 based on the data that is available in the core file.
102 For example, if the core file is of a process that omits the frame pointer, the
103 ability to iterate the stack will be limited.
104 .Pp
105 Use the
106 .Fn Pgrab_core
107 or
108 .Fn Pfgrab_core
109 function to open a core file.
110 Use the
111 .Fn Pgrab_file
112 function to open an ELF object file.
113 This is useful for obtaining information stored in ELF headers and
114 sections.
115 .Ss Debug Information
116 Many of the operations in the library rely on debug information being
117 present in a process and its associated libraries.
118 The library leverages symbol table information, CTF data
119 .Pq Xr ctf 5
120 sections, and frame unwinding information based on the use of an ABI
121 defined frame pointer, e\&.g\&.
122 .Sy %ebp
123 and
124 .Sy %rbp
125 on x86 systems.
126 .Pp
127 Some software providers strip programs of this information or build
128 their executables such that the information will not be present in a
129 core dump.
130 To deal with this fact, the library is able to consume information that is not
131 present in the core file or the running process.
132 It can both consume it from the underlying executable and it also supports
133 finding it from related ELF objects that are linked to it via the
134 .Sy .gnu_debuglink
135 and the
136 .Sy .note.gnu.build-id
137 ELF sections.
138 .Ss Iteration Interfaces
139 The
140 .Nm
141 library provides the ability to iterate over the following aspects of a
142 process or core file:
143 .Bl -bullet -offset indent
144 .It
145 Active threads
146 .It
147 Active and zombie threads
148 .It
149 All non-system processes
150 .It
151 All process mappings
152 .It
153 All objects in a process
154 .It
155 The environment
156 .It
157 The symbol table
158 .It
159 Stack frames
160 .It
161 File Descriptors
162 .El
163 .Ss System Call Injection
164 The
165 .Nm
166 library allows the caller to force system calls to be executed in the
167 context of the running process.
168 This can be used both as a tool for introspection, allowing one to get
169 information outside its current context as well as performing modifications to a
170 process.
171 .Pp
172 These functions run in the context of the calling process.
173 This is often an easier way of getting non-exported information about a
174 process from the system.
175 For example, the
176 .Xr pfiles 1
177 command uses this interface to get more detailed information about a
178 process's open file descriptors, which it would not have access to
179 otherwise.
180 .Sh INTERFACES
181 The shared object
182 .Sy libproc.so.1
183 provides the public interfaces defined below.
184 See
185 .Xr Intro 3
186 for additional information on shared object interfaces.
187 Functions are organized into categories that describe their purpose.
188 Individual functions are documented in their own manual pages.
189 .Ss Creation, Grabbing, and Releasing
190 The following routines are related to creating library handles,
191 grabbing 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
204 The following routines obtain information about a process and allow
205 manipulation 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
253 The following routines obtain information about a thread and allow
254 manipulation 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
268 The following routines are used to inject specific system calls and have
269 them 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
295 These 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
306 The following routines are utilities that are useful to consumers of the
307 library.
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
328 The following routines are specific to the x86, 32-bit and 64-bit,
329 versions of the
330 .Nm
331 library.
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
336 The following functions are specific to the SPARC, 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 Plwp_getgwindows Ta Sy Plwp_getxregs
342 .It Sy Plwp_setxregs Ta Sy ""
343 .El
344 .Pp
345 The following functions are specific to the 64-bit SPARC version of the
346 .Nm
347 library.
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
352 Every process handle that exists in
353 .Nm
354 has a state.
355 In some cases, such as for core files, these states are static.
356 In other cases, such as handles that correspond to a running process or a
357 created process, these states are dynamic and change based on actions taken in
358 the library.
359 The state can be obtained with the
360 .Xr Pstate 3PROC
361 function.
362 .Pp
363 The various states are:
364 .Bl -tag -width Dv -offset indent
365 .It Dv PS_RUN
366 An actively running process.
367 This may be a process that was obtained by creating it with functions such as
368 .Xr Pcreate 3PROC
369 or by grabbing an existing process such as
370 .Xr Pgrab 3PROC .
371 .It Dv PS_STOP
372 An active process that is no longer executing.
373 A process may stop for many reasons such as an explicit stop request (through
374 .Xr pstop 1
375 for example) or if a tracing event is hit.
376 .Pp
377 The reason a process is stopped may be obtained through the thread's
378 .Vt lwpstatus_t
379 structure read directly from /proc or obtained through the
380 .Xr Lstatus 3PROC
381 function.
382 .It Dv PS_LOST
383 Control over the process has been lost.
384 This may happen when the process executes a new image requiring a different set
385 of privileges.
386 To resume control call
387 .Xr Preopen 3PROC .
388 For more information on losing control of a process, see
389 .Xr proc 5 .
390 .It Dv PS_UNDEAD
391 A zombie process.
392 It has terminated, but it has not been cleaned up yet by its parent.
393 For more on the conditions of becoming a zombie, see
394 .Xr exec 2 .
395 .It Dv PS_DEAD
396 Processes in this state are always core files.
397 See the earlier section
398 .Sx Core Files
399 for more information on working with core files.
400 .It Dv PS_IDLE
401 A process that has never been run.
402 This is always the case for handles that refer to files as the files cannot be
403 executed.
404 Those process handles are obtained through calling
405 .Xr Pgrab_file 3PROC .
406 .El
407 .Pp
408 Many functions relating to tracing processes, for example
409 .Xr Psignal 3PROC ,
410 .Xr Psetsignal 3PROC ,
411 .Xr Psetfault 3PROC ,
412 .Xr Psysentry 3PROC ,
413 and others, mention that they only act upon
414 .Em Active Processes .
415 This specifically refers to processes whose state are in
416 .Dv PS_RUN
417 and
418 .Dv PS_STOP .
419 Process handles in the other states have no notion of settable tracing
420 flags, though core files
421 .Pq type Dv PS_DEAD
422 may have a read-only snapshot of their tracing settings available.
423 .Sh TYPES
424 The
425 .Nm
426 library uses many types that come from the /proc file system
427 .Pq Xr proc 5
428 and the ELF format
429 .Pq Xr elf 3ELF .
430 However, it also defines the following types:
431 .Pp
432 .Vt struct ps_prochandle
433 .Pp
434 The
435 .Vt struct ps_prochandle
436 is an opaque handle to the library and the core element of control for a
437 process.
438 Consumers obtain pointers to a handle through the use of the
439 .Fn Pcreate ,
440 .Fn Pgrab ,
441 and related functions.
442 When a caller is done with a handle, then it should call one of the
443 .Fn Pfree
444 and
445 .Fn Prelease
446 functions to relinquish the handle, release associated resources, and
447 potentially set the process to run again.
448 .Pp
449 .Vt struct ps_lwphandle
450 .Pp
451 The
452 .Vt struct ps_lwphandle
453 is analogous to the
454 .Vt struct ps_prochandle ,
455 but it represents the control of an individual thread, rather than a
456 process.
457 Consumers obtain pointers to a handle through the
458 .Fn Lgrab
459 function and relinquish it with the
460 .Fn Lfree
461 function.
462 .Pp
463 .Vt core_content_t
464 .Pp
465 The
466 .Vt core_content_t
467 is a value which describes the various content types of core files.
468 These are used in functions such as
469 .Xr Pcontent 3PROC
470 and
471 .Xr Pgcore 3PROC
472 to describe and control the types of content that get included.
473 Various content types may be included together through a bitwise-inclusive-OR.
474 The default system core contents are controlled with the
475 .Xr coreadm 8
476 tool.
477 The following table lists the current set of core contents in the system, though
478 the set may increase over time.
479 The string after the macro is the human readable string that corresponds with
480 the constant and is used by
481 .Xr coreadm 8 ,
482 .Xr proc_content2str 3PROC ,
483 and
484 .Xr proc_str2content 3PROC .
485 .Bl -tag -offset indent -width indent
486 .It Dv CC_CONTENT_STACK ("stack")
487 The contents include the process stack.
488 Note, this only covers the main thread's stack.
489 The stack of other threads is covered by
490 .Dv CC_CONTENT_ANON .
491 .It Dv CC_CONTENT_HEAP ("heap")
492 The contents include the process heap.
493 .It Dv CC_CONTENT_SHFILE ("shfile")
494 The contents include shared mappings that are backed by files (e.g.
495 mapped through
496 .Xr mmap 2
497 with the
498 .Dv MAP_SHARED
499 flag).
500 .It Dv CC_CONTENT_SHANNON ("shannon")
501 The contents include shared mappings that are backed by anonymous memory
502 (e.g. mapped through
503 .Xr mmap 2
504 with the
505 .Dv MAP_SHARED
506 and
507 .Dv MAP_ANON
508 flags).
509 .It Dv CC_CONTENT_RODATA ("rodata")
510 The contents include private read-only file mappings, such as shared
511 library text.
512 .It Dv CC_CONTENT_ANON ("anon")
513 The contents include private anonymous mappings.
514 This includes the stacks of threads which are not the main thread.
515 .It Dv CC_CONTENT_SHM ("shm")
516 The contents include system V shared memory.
517 .It Dv CC_CONTENT_ISM ("ism")
518 The contents include ISM (intimate shared memory) mappings.
519 .It Dv CC_CONTENT_DISM ("dism")
520 The contents include DISM (dynamic shared memory) mappings.
521 .It Dv CC_CONTENT_CTF ("ctf")
522 The contents include
523 .Xr ctf 5
524 (Compact C Type Format) information.
525 Note, not all objects in the process may have CTF information available.
526 .It Dv CC_CONTENT_SYMTAB ("symtab")
527 The contents include the symbol table.
528 Note, not all objects in the process may have a symbol table available.
529 .It Dv CC_CONTENT_ALL ("all")
530 This value indicates that all of the above content values are present.
531 Note that additional values may be added in the future, in which case
532 the value of the symbol will be updated to include them.
533 Comparisons with
534 .Dv CC_CONTENT_ALL
535 should 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")
538 This value indicates that there is no content present.
539 .It Dv CC_CONTENT_DEFAULT ("default")
540 The 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 ,
552 and
553 .Dv CC_CONTENT_SYMTAB .
554 Note that the default may change.
555 Comparisons with CC_CONTENT_DEFAULT should validate that all of the expected
556 bits are set with an expression such as
557 .Li (c\ &\ CC_CONTENT_DEFAULT)\ ==\ CC_CONTENT_DEFAULT .
558 .It Dv CC_CONTENT_INVALID
559 This indicates that the contents are invalid.
560 .El
561 .Pp
562 .Vt prfdinfo_t
563 .Pp
564 The
565 .Vt prfdinfo_t
566 structure is used with the
567 .Fn Pfdinfo_iter ,
568 .Fn proc_fdwalk ,
569 .Fn proc_fdinfowalk
570 and
571 .Fn proc_get_fdinfo
572 functions and describes information about a file descriptor.
573 The structure is defined as follows:
574 .Bd -literal
575 typedef 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 */
597 else
598 uint8_t pr_misc[1]; /* self describing structures */
599 #endif
600 } prfdinfo_t;
601 .Ed
602 .Pp
603 The structure has similar information to that found in the
604 .Sy stat
605 structure that's used as part of the stat family of system calls,
606 defined in
607 .Xr stat 2 .
608 The member
609 .Sy pr_fd
610 contains the number of the file descriptor of the file.
611 The members
612 .Fa pr_mode ,
613 .Fa pr_uid ,
614 .Fa pr_gid ,
615 .Fa pr_ino ,
616 and
617 .Fa pr_size
618 are the same as the members
619 .Fa st_mode ,
620 .Fa st_uid ,
621 .Fa st_gid ,
622 .Fa st_ino ,
623 and
624 .Fa st_size
625 in the
626 .Fa stat
627 structure.
628 .Pp
629 The
630 .Fa pr_major
631 and
632 .Fa pr_minor
633 members contain the major and minor numbers of the device containing the
634 directory for this file.
635 This is similar to the
636 .Fa st_dev
637 member of the
638 .Vt stat
639 structure, except that it is broken out into its major and minor components.
640 The
641 .Fa pr_rmajor
642 and
643 .Fa pr_rminor
644 members are similar in spirit to
645 .Fa pr_major
646 and
647 .Fa pr_minor ;
648 however, they are equivalent to the
649 .Fa st_rdev
650 member of the
651 .Vt stat
652 structure and thus have meaning for special character and block files.
653 .Pp
654 The
655 .Fa pr_offset
656 member contains the current seek offset of the file descriptor.
657 The
658 .Fa pr_fileflags
659 and
660 .Fa pr_fdflags
661 members contain the flags that would have been returned by a call to
662 .Xr fcntl 2
663 with the arguments
664 .Dv F_GETXFL
665 and
666 .Dv F_GETFD
667 respectively.
668 .Pp
669 The
670 .Fa pr_locktype ,
671 .Fa pr_lockpid ,
672 and
673 .Fa pr_locksysid
674 contain the information that would have been returned by a call to
675 .Xr fcntl 2
676 with an argument of
677 .Dv F_GETLK .
678 .Pp
679 The
680 .Fa pr_peerpid
681 and
682 .Fa pr_peername
683 members contain the process ID and name of any peer endpoint of a
684 connection-oriented socket or stream fd.
685 This information is the same as that which would be returned by a call to
686 .Xr getpeerucred 3C
687 .Pp
688 The
689 .Fa pr_misc
690 member contains miscellaneous additional data relating to the file descriptor.
691 The format of these data is described in
692 .Xr proc 5 .
693 .Pp
694 .Vt prsyminfo_t
695 .Pp
696 The
697 .Vt prsyminfo_t
698 structure is used with the various symbol look up functions
699 .Fn Pxlookup_by_name ,
700 .Fn Pxlookup_by_addr ,
701 and
702 .Fn Pxlookup_by_addr_resolved
703 which describes additional information about a symbol.
704 The structure is defined as follows:
705 .Bd -literal
706 typedef 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
715 The member
716 .Fa prs_object
717 points to a string that contains the name of the object file, if known,
718 that the symbol comes from.
719 The member
720 .Fa prs_name
721 points to the name of the symbol, if known.
722 This may be unknown due to a stripped binary that contains no symbol table.
723 The member
724 .Fa prs_lmid
725 indicates the link map identifier that the symbol was found on.
726 For more information on link map identifiers refer to the
727 .%B Linker and Libraries Guide
728 and
729 .Xr dlopen 3C .
730 .Pp
731 The members
732 .Fa prs_id
733 and
734 .Fa prs_table
735 can be used to determine both the symbol table that the entry came from
736 and which entry in the table it corresponds to.
737 If the value of
738 .Fa prs_table
739 is
740 .Dv PR_SYMTAB
741 then it came from the ELF standard symbol table.
742 However, if it is instead
743 .Dv PR_DYNSYM ,
744 then that indicates that it comes from the process's dynamic section.
745 .Pp
746 .Vt proc_lwp_f
747 .Pp
748 The
749 .Vt proc_lwp_f
750 is a function pointer type that is used with the
751 .Fn Plwp_iter
752 function.
753 It is defined as
754 .Sy typedef
755 .Ft int
756 .Fo proc_lwp_f
757 .Fa "void *"
758 .Fa "const lwpstatus_t *"
759 .Fc .
760 The first argument is a pointer to an argument that the user specifies,
761 while the second has the thread's status information and is defined in
762 .Xr proc 5 .
763 For additional information on using this type, see
764 .Xr Plwp_iter 3PROC .
765 .Pp
766 .Vt proc_lwp_all_f
767 .Pp
768 The
769 .Vt proc_lwp_all_f
770 is a function pointer type that is used with the
771 .Fn Plwp_iter_all
772 function.
773 It 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 .
781 The first argument is a pointer to an argument that the user specifies.
782 The second and third arguments contain the thread's status and
783 thread-specific
784 .Xr ps 1
785 information respectively.
786 Both structures are defined in
787 .Xr proc 5 .
788 For additional information on using this type, see
789 .Xr Plwp_iter_all 3PROC .
790 .Pp
791 .Vt proc_fdinfowalk_f
792 .Pp
793 The
794 .Vt proc_fdinfowalk_f
795 is a function pointer type that is used with the
796 .Fn proc_fdinfowalk
797 function to walk the miscellaneous data items contained within a
798 .Vt prfdinfo_t
799 structure.
800 It 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 .
809 The first argument contains the type of the miscellaneous information being
810 presented, the second and third provide a pointer to the associated data and
811 the length of that data.
812 The final argument is a pointer to an argument that the user specifies.
813 For more information on using this, see
814 .Xr proc_fdinfowalk 3PROC .
815 .Pp
816 .Vt proc_fdwalk_f
817 .Pp
818 The
819 .Vt proc_fdwalk_f
820 is a function pointer type that is used with the
821 .Fn proc_fdwalk
822 function.
823 It is defined as
824 .Sy typedef
825 .Ft int
826 .Fo proc_fdwalk_f
827 .Fa "const prfdinfo_t *"
828 .Fa "void *"
829 .Fc .
830 The first argument contains the file descriptor information.
831 The
832 .Sy prfdinfo_t
833 structure is defined in
834 .Xr proc 5 .
835 The final argument is a pointer to an argument that the user specifies.
836 For more information on using this, see
837 .Xr proc_fdwalk 3PROC .
838 .Pp
839 .Vt proc_walk_f
840 .Pp
841 The
842 .Vt proc_walk_f
843 is a function pointer type that is used with the
844 .Fn proc_walk
845 function.
846 It 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 .
854 The first argument contains the process
855 .Xr ps 1
856 information and the second argument contains the representative thread's
857 .Xr ps 1
858 information.
859 Both structures are defined in
860 .Xr proc 5 .
861 The final argument is a pointer to an argument that the user specifies.
862 For more information on using this, see
863 .Xr proc_walk 3PROC .
864 .Pp
865 .Vt proc_map_f
866 .Pp
867 The
868 .Vt proc_map_f
869 is a function pointer type that is used with the
870 .Fn Pmapping_iter ,
871 .Fn Pmapping_iter_resolved ,
872 .Fn Pobject_iter ,
873 and
874 .Fn Pobject_iter_resolved
875 functions.
876 It 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 .
884 The first argument is a pointer to an argument that the user specifies.
885 The second argument is describes the mapping information and is defined
886 in
887 .Xr proc 5 .
888 The final argument contains the name of the mapping or object file in
889 question.
890 For additional information on using this type, see
891 .Xr Pmapping_iter 3PROC .
892 .Pp
893 .Vt proc_env_f
894 .Pp
895 The
896 .Vt proc_env_f
897 is a function pointer type that is used with the
898 .Fn Penv_iter
899 function.
900 It 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 .
909 The first argument is a pointer to an argument that the user specifies.
910 The second argument is a pointer to the
911 .Vt struct ps_prochandle
912 that the callback was passed to.
913 The third argument is the address of the environment variable in the process.
914 The fourth argument is the environment variable.
915 Values in the environment follow the convention of the form
916 .Em variable=value .
917 For more information on environment variables see
918 .Xr exec 2
919 and
920 .Xr environ 7 .
921 For additional information on using this type, see
922 .Xr Penv_iter 3PROC .
923 .Pp
924 .Vt proc_sym_f
925 .Pp
926 The
927 .Vt proc_sym_f
928 is 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 ,
932 and
933 .Fn Psymbol_iter_by_lmid
934 functions.
935 It 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 .
943 The first argument is a pointer to an argument that the user supplies.
944 The second argument is a pointer to the ELF symbol information in a
945 32-bit and 64-bit neutral form.
946 See
947 .Xr elf 3ELF
948 and
949 .Xr gelf 3ELF
950 for more information on it.
951 The final argument points to a character string that has the name of the symbol.
952 For 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 ,
956 and
957 .Xr Psymbol_iter_by_lmid 3PROC .
958 .Pp
959 .Vt proc_xsym_f
960 .Pp
961 The
962 .Vt proc_xsym_f
963 is a function pointer type that is used with the
964 .Fn Pxsymbol_iter
965 function.
966 It 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 .
975 The first three arguments are identical to those of
976 .Vt proc_sym_f .
977 The final argument contains additional information about the symbol
978 itself.
979 The members of the
980 .Vt prsyminfo_t
981 are defined earlier in this section.
982 For additional information on using this type, see
983 .Xr Pxsymbol_iter 3PROC .
984 .Pp
985 .Vt proc_stack_f
986 .Pp
987 The
988 .Vt proc_stack_f
989 is a function pointer type that is used with the
990 .Fn Pstack_iter
991 function.
992 It 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 .
1001 The first argument is a pointer to an argument that the user specifies.
1002 The second argument's contents are platform specific.
1003 The registers that contain stack information, usually the stack pointer and
1004 frame pointer, will be filled in to point to an entry.
1005 The
1006 .Vt prgregset_t
1007 is defined in
1008 .Xr proc 5 .
1009 .Pp
1010 The third argument contains the number of arguments to the current stack
1011 frame and the fourth argument contains an array of addresses that
1012 correspond to the arguments to that stack function.
1013 The value of the third argument dictates the number of entries in the fourth
1014 argument.
1015 For additional information on using this type, see
1016 .Xr Pstack_iter 3PROC .
1017 .Pp
1018 .Vt proc_fdinfo_f
1019 .Pp
1020 The
1021 .Vt proc_fdinfo_f
1022 is a function pointer type that is used with the
1023 .Fn Pfdinfo_iter
1024 function.
1025 It is defined as
1026 .Sy typedef
1027 .Ft int
1028 .Fo proc_fdinfo_f
1029 .Fa "void *"
1030 .Fa "prfdinfo_t *"
1031 .Fc .
1032 The first argument is a pointer to an argument that the user specifies.
1033 The second argument contains information about an open file descriptor.
1034 The members of the
1035 .Vt prfdinfo_t
1036 are defined earlier in this section.
1037 For additional information on using this type, see
1038 .Xr Pfdinfo_iter 3PROC .
1039 .Sh PROGRAMMING NOTES
1040 When working with live processes, whether from the
1041 .Xr Pgrab 3PROC
1042 or
1043 .Xr Pcreate 3PROC
1044 family of functions, there are some additional considerations.
1045 Importantly, if a process calls any of the
1046 .Xr exec 2
1047 suite of functions, much of the state information that is obtained,
1048 particularly that about mappings in the process will be invalid.
1049 Callers must ensure that they call
1050 .Xr Preset_maps 3PROC
1051 when they hold a process handle across an exec.
1052 In addition, users of the library should familiarize themselves with the
1053 .Sy PROGRAMMING NOTES
1054 section of the
1055 .Xr proc 5
1056 manual page, which discusses issues of privileges and security.
1057 .Sh DEBUGGING
1058 The library provides a means for obtaining additional debugging
1059 information.
1060 The output itself is not part of the
1061 .Nm
1062 library's stable interface.
1063 Setting the environment variable
1064 .Ev LIBPROC_DEBUG
1065 to some value will print information to standard error.
1066 For example,
1067 .Ev LIBPROC_DEBUG Ns = Ns Em please .
1068 .Sh LOCKING
1069 Most functions operate on a handle to a process in the form of a
1070 .Vt "struct ps_prochandle *" .
1071 Unless otherwise indicated, the library does not provide any
1072 synchronization for different routines that are operating on the
1073 .Sy same
1074 .Nm
1075 library handle.
1076 It is up to the caller to ensure that only a single thread is using a handle at
1077 any given time.
1078 Multiple threads may call
1079 .Nm
1080 library routines at the same time as long as each thread is using a
1081 different handle.
1082 .Pp
1083 Each individual function notes its
1084 .Sy MT-Level
1085 section.
1086 The MT-Level of a routine that matches the above description will refer to this
1087 manual page.
1088 If it does not, then it refers to the standard attributes in
1089 .Xr attributes 7 .
1090 .Sh INTERFACE STABILITY
1091 .Sy Uncommitted
1092 .Pp
1093 While the library is considered an uncommitted interface, and is still
1094 evolving, changes that break compatibility have been uncommon and this
1095 trend is expected to continue.
1096 It is documented to allow consumers, whether part of illumos or outside of it,
1097 to understand the library and make use of it with the understanding that
1098 changes 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 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 5 ,
1111 .Xr proc 5 ,
1112 .Xr attributes 7 ,
1113 .Xr environ 7 ,
1114 .Xr privileges 7 ,
1115 .Xr coreadm 8
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