1DLERROR(3P) POSIX Programmer's Manual DLERROR(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 dlerror — get diagnostic information
14
16 #include <dlfcn.h>
17
18 char *dlerror(void);
19
21 The dlerror() function shall return a null-terminated character string
22 (with no trailing <newline>) that describes the last error that
23 occurred during dynamic linking processing. If no dynamic linking
24 errors have occurred since the last invocation of dlerror(), dlerror()
25 shall return NULL. Thus, invoking dlerror() a second time, immediately
26 following a prior invocation, shall result in NULL being returned.
27
28 It is implementation-defined whether or not the dlerror() function is
29 thread-safe. A thread-safe implementation shall return only errors that
30 occur on the current thread.
31
33 If successful, dlerror() shall return a null-terminated character
34 string; otherwise, NULL shall be returned.
35
36 The application shall not modify the string returned. The returned
37 pointer might be invalidated or the string content might be overwritten
38 by a subsequent call to dlerror() in the same thread (if dlerror() is
39 thread-safe) or in any thread (if dlerror() is not thread-safe).
40
42 No errors are defined.
43
44 The following sections are informative.
45
47 The following example prints out the last dynamic linking error:
48
49 ...
50 #include <dlfcn.h>
51
52 char *errstr;
53
54 errstr = dlerror();
55 if (errstr != NULL)
56 printf ("A dynamic linking error occurred: (%s)\n", errstr);
57 ...
58
60 Depending on the application environment with respect to asynchronous
61 execution events, such as signals or other asynchronous computation
62 sharing the address space, conforming applications should use a criti‐
63 cal section to retrieve the error pointer and buffer.
64
66 None.
67
69 None.
70
72 dlclose(), dlopen(), dlsym()
73
74 The Base Definitions volume of POSIX.1‐2008, <dlfcn.h>
75
77 Portions of this text are reprinted and reproduced in electronic form
78 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
79 -- Portable Operating System Interface (POSIX), The Open Group Base
80 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
81 cal and Electronics Engineers, Inc and The Open Group. (This is
82 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
83 event of any discrepancy between this version and the original IEEE and
84 The Open Group Standard, the original IEEE and The Open Group Standard
85 is the referee document. The original Standard can be obtained online
86 at http://www.unix.org/online.html .
87
88 Any typographical or formatting errors that appear in this page are
89 most likely to have been introduced during the conversion of the source
90 files to man page format. To report such errors, see https://www.ker‐
91 nel.org/doc/man-pages/reporting_bugs.html .
92
93
94
95IEEE/The Open Group 2013 DLERROR(3P)