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
12 dlerror - get diagnostic information
13
15 #include <dlfcn.h>
16
17 char *dlerror(void);
18
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 The dlerror() function need not be reentrant. A function that is not
29 required to be reentrant is not required to be thread-safe.
30
32 If successful, dlerror() shall return a null-terminated character
33 string; otherwise, NULL shall be returned.
34
36 No errors are defined.
37
38 The following sections are informative.
39
41 The following example prints out the last dynamic linking error:
42
43
44 ...
45 #include <dlfcn.h>
46
47
48 char *errstr;
49
50
51 errstr = dlerror();
52 if (errstr != NULL)
53 printf ("A dynamic linking error occurred: (%s)\n", errstr);
54 ...
55
57 The messages returned by dlerror() may reside in a static buffer that
58 is overwritten on each call to dlerror(). Application code should not
59 write to this buffer. Programs wishing to preserve an error message
60 should make their own copies of that message. Depending on the applica‐
61 tion environment with respect to asynchronous execution events, such as
62 signals or other asynchronous computation sharing the address space,
63 conforming applications should use a critical section to retrieve the
64 error pointer and buffer.
65
67 None.
68
70 None.
71
73 dlclose(), dlopen(), dlsym(), the Base Definitions volume of
74 IEEE Std 1003.1-2001, <dlfcn.h>
75
77 Portions of this text are reprinted and reproduced in electronic form
78 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
79 -- Portable Operating System Interface (POSIX), The Open Group Base
80 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
81 Electrical and Electronics Engineers, Inc and The Open Group. In the
82 event of any discrepancy between this version and the original IEEE and
83 The Open Group Standard, the original IEEE and The Open Group Standard
84 is the referee document. The original Standard can be obtained online
85 at http://www.opengroup.org/unix/online.html .
86
87
88
89IEEE/The Open Group 2003 DLERROR(3P)