diff options
Diffstat (limited to 'man3/dlinfo.3')
-rw-r--r-- | man3/dlinfo.3 | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/man3/dlinfo.3 b/man3/dlinfo.3 index be6516aaf..586663d98 100644 --- a/man3/dlinfo.3 +++ b/man3/dlinfo.3 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" -.TH dlinfo 3 2023-02-05 "Linux man-pages 6.03" +.TH dlinfo 3 2023-07-20 "Linux man-pages 6.05.01" .SH NAME dlinfo \- obtain information about a dynamically loaded object .SH LIBRARY @@ -73,7 +73,7 @@ struct link_map { shared object */ struct link_map *l_next, *l_prev; /* Chain of loaded objects */ - +\& /* Plus additional fields private to the implementation */ }; @@ -200,33 +200,29 @@ On success, returns 0. On failure, it returns \-1; the cause of the error can be diagnosed using .BR dlerror (3). -.SH VERSIONS -.BR dlinfo () -first appeared in glibc 2.3.3. .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). -.ad l -.nh .TS allbox; lbx lb lb l l l. Interface Attribute Value T{ +.na +.nh .BR dlinfo () T} Thread safety MT-Safe .TE -.hy -.ad .sp 1 -.SH STANDARDS -This function is a nonstandard GNU extension. -.SH NOTES -This function derives from the Solaris function of the same name -and also appears on some other systems. +.SH VERSIONS The sets of requests supported by the various implementations overlaps only partially. +.SH STANDARDS +GNU. +.SH HISTORY +glibc 2.3.3. +Solaris. .SH EXAMPLES The program below opens a shared objects using .BR dlopen (3) @@ -253,62 +249,62 @@ dls_serpath[1].dls_name = /usr/lib64 #include <link.h> #include <stdio.h> #include <stdlib.h> - +\& int main(int argc, char *argv[]) { void *handle; Dl_serinfo serinfo; Dl_serinfo *sip; - +\& if (argc != 2) { fprintf(stderr, "Usage: %s <libpath>\en", argv[0]); exit(EXIT_FAILURE); } - +\& /* Obtain a handle for shared object specified on command line. */ - +\& handle = dlopen(argv[1], RTLD_NOW); if (handle == NULL) { fprintf(stderr, "dlopen() failed: %s\en", dlerror()); exit(EXIT_FAILURE); } - +\& /* Discover the size of the buffer that we must pass to RTLD_DI_SERINFO. */ - +\& if (dlinfo(handle, RTLD_DI_SERINFOSIZE, &serinfo) == \-1) { fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\en", dlerror()); exit(EXIT_FAILURE); } - +\& /* Allocate the buffer for use with RTLD_DI_SERINFO. */ - +\& sip = malloc(serinfo.dls_size); if (sip == NULL) { perror("malloc"); exit(EXIT_FAILURE); } - +\& /* Initialize the \[aq]dls_size\[aq] and \[aq]dls_cnt\[aq] fields in the newly allocated buffer. */ - +\& if (dlinfo(handle, RTLD_DI_SERINFOSIZE, sip) == \-1) { fprintf(stderr, "RTLD_DI_SERINFOSIZE failed: %s\en", dlerror()); exit(EXIT_FAILURE); } - +\& /* Fetch and print library search list. */ - +\& if (dlinfo(handle, RTLD_DI_SERINFO, sip) == \-1) { fprintf(stderr, "RTLD_DI_SERINFO failed: %s\en", dlerror()); exit(EXIT_FAILURE); } - +\& for (size_t j = 0; j < serinfo.dls_cnt; j++) printf("dls_serpath[%zu].dls_name = %s\en", j, sip\->dls_serpath[j].dls_name); - +\& exit(EXIT_SUCCESS); } .EE |