xref: /illumos-gate/usr/src/man/man3proc/Pobjname.3proc (revision 447b1e1fca22e4de5e04623965fbb1460857930c)
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 2015 Joyent, Inc.
13.\"
14.Dd May 11, 2016
15.Dt POBJNAME 3PROC
16.Os
17.Sh NAME
18.Nm Pobjname ,
19.Nm Pobjname_resolved ,
20.Nd turn a virtual address into its mapped object
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft "char *"
25.Fo Pobjname
26.Fa "struct ps_prochandle *P"
27.Fa "uintptr_t addr"
28.Fa "char *buffer"
29.Fa "size_t bufsize"
30.Fc
31.Ft char *
32.Fo Pobjname_resolved
33.Fa "struct ps_prochandle *P"
34.Fa "uintptr_t addr"
35.Fa "char *buffer"
36.Fa "size_t bufsize"
37.Fc
38.Sh DESCRIPTION
39The
40.Fn Pobjname
41and
42.Fn Pobjname_resolved
43functions attempt to determine the underlying mapped object that
44contains the virtual address
45.Fa addr
46in the process handle
47.Fa P .
48.Pp
49A program consists of multiple memory mappings. Some are provided by the
50system, such as the stack and the heap. While others are created through
51explicit calls to
52.Xr mmap 2
53or brought in by the run-time link-editor due to dependencies
54specified in binaries and libraries.
55.Pp
56If
57.Fa addr
58is contained in a mapping, then up to
59.Fa bufsize
60characters, including the null terminator,
61of the name of the corresponding object will be written into
62.Fa buffer .
63The
64.Fn Pobjname_resolved
65function attempts to resolve the object to a full file system path. If
66the full file-system path cannot be determined, then it will fall back
67to the name that the run-time link-editor has for that mapping, which is
68the behavior of
69.Fn Pobjname .
70.Sh RETURN VALUES
71Upon successful completion, the
72.Fn Pobjname
73and
74.Fn Pobjname_resolved
75functions return
76.Fa buffer .
77Otherwise,
78.Dv NULL
79is returned to indicate the object name could not be found.
80.Sh INTERFACE STABILITY
81.Sy Uncommitted
82.Sh MT-LEVEL
83See
84.Sy LOCKING
85in
86.Xr libproc 3LIB .
87.Sh SEE ALSO
88.Xr mmap 2 ,
89.Xr libproc 3LIB ,
90.Xr Pobject_iter 3PROC ,
91.Xr proc 4
92