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