futex.2: Rework the description of FUTEX_LOCK_PI2
[man-pages.git] / man3 / dlerror.3
blob8f6736a2cc0595999895d8f9146f46e21157460a
1 .\" Copyright 1995 Yggdrasil Computing, Incorporated.
2 .\" and Copyright 2015 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .TH DLERROR 3 2021-03-22 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 dlerror \- obtain error diagnostic for functions in the dlopen API
28 .SH SYNOPSIS
29 .nf
30 .B #include <dlfcn.h>
31 .PP
32 .B "char *dlerror(void);"
33 .PP
34 Link with \fI\-ldl\fP.
35 .fi
36 .SH DESCRIPTION
37 The
38 .BR dlerror ()
39 function returns a human-readable,
40 null-terminated string describing the most recent error
41 that occurred from a call to one of the functions in the dlopen API
42 since the last call to
43 .BR dlerror ().
44 The returned string does
45 .I not
46 include a trailing newline.
47 .PP
48 .BR dlerror ()
49 returns NULL if no errors have occurred since initialization or since
50 it was last called.
51 .SH VERSIONS
52 .BR dlerror ()
53 is present in glibc 2.0 and later.
54 .SH ATTRIBUTES
55 For an explanation of the terms used in this section, see
56 .BR attributes (7).
57 .ad l
58 .nh
59 .TS
60 allbox;
61 lbx lb lb
62 l l l.
63 Interface       Attribute       Value
65 .BR dlerror ()
66 T}      Thread safety   MT-Safe
67 .TE
68 .hy
69 .ad
70 .sp 1
71 .SH CONFORMING TO
72 POSIX.1-2001.
73 .SH NOTES
74 The message returned by
75 .BR dlerror ()
76 may reside in a statically allocated buffer that is
77 overwritten by subsequent
78 .BR dlerror ()
79 calls.
80 .\" .LP
81 .\" The string returned by
82 .\" .BR dlerror ()
83 .\" should not be modified.
84 .\" Some systems give the prototype as
85 .\" .sp
86 .\" .in +5
87 .\" .B "const char *dlerror(void);"
88 .\" .in
89 .SS History
90 This function is part of the dlopen API, derived from SunOS.
91 .SH EXAMPLES
92 See
93 .BR dlopen (3).
94 .SH SEE ALSO
95 .BR dladdr (3),
96 .BR dlinfo (3),
97 .BR dlopen (3),
98 .BR dlsym (3)