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