| 1 |
'\" t |
| 2 |
.\" Copyright 1995, Yggdrasil Computing, Inc. |
| 3 |
.\" Copyright 2015, Michael Kerrisk <[email protected]> |
| 4 |
.\" Copyright, the authors of the Linux man-pages project |
| 5 |
.\" |
| 6 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 7 |
.\" |
| 8 |
.TH dlerror 3 2026-02-08 "Linux man-pages 6.18" |
| 9 |
.SH NAME |
| 10 |
dlerror \- obtain error diagnostic for functions in the dlopen API |
| 11 |
.SH LIBRARY |
| 12 |
Dynamic linking library |
| 13 |
.RI ( libdl ,\~ \-ldl ) |
| 14 |
.SH SYNOPSIS |
| 15 |
.nf |
| 16 |
.B #include <dlfcn.h> |
| 17 |
.P |
| 18 |
.B "char *dlerror(void);" |
| 19 |
.fi |
| 20 |
.SH DESCRIPTION |
| 21 |
The |
| 22 |
.BR dlerror () |
| 23 |
function returns a human-readable, |
| 24 |
null-terminated string describing the most recent error |
| 25 |
that occurred from a call to one of the functions in the dlopen API |
| 26 |
since the last call to |
| 27 |
.BR dlerror (). |
| 28 |
The returned string does |
| 29 |
.I not |
| 30 |
include a trailing newline. |
| 31 |
.P |
| 32 |
.BR dlerror () |
| 33 |
returns NULL if no errors have occurred since initialization or since |
| 34 |
it was last called. |
| 35 |
.SH ATTRIBUTES |
| 36 |
For an explanation of the terms used in this section, see |
| 37 |
.BR attributes (7). |
| 38 |
.TS |
| 39 |
allbox; |
| 40 |
lbx lb lb |
| 41 |
l l l. |
| 42 |
Interface Attribute Value |
| 43 |
T{ |
| 44 |
.na |
| 45 |
.nh |
| 46 |
.BR dlerror () |
| 47 |
T} Thread safety MT-Safe |
| 48 |
.TE |
| 49 |
.SH STANDARDS |
| 50 |
POSIX.1-2008. |
| 51 |
.SH HISTORY |
| 52 |
glibc 2.0. |
| 53 |
POSIX.1-2001. |
| 54 |
.P |
| 55 |
SunOS. |
| 56 |
.SH NOTES |
| 57 |
The message returned by |
| 58 |
.BR dlerror () |
| 59 |
may reside in a statically allocated buffer that is |
| 60 |
overwritten by subsequent |
| 61 |
.BR dlerror () |
| 62 |
calls. |
| 63 |
.\" .P |
| 64 |
.\" The string returned by |
| 65 |
.\" .BR dlerror () |
| 66 |
.\" should not be modified. |
| 67 |
.\" Some systems give the prototype as |
| 68 |
.\" .sp |
| 69 |
.\" .in +5 |
| 70 |
.\" .B "const char *dlerror(void);" |
| 71 |
.\" .in |
| 72 |
.SH EXAMPLES |
| 73 |
See |
| 74 |
.BR dlopen (3). |
| 75 |
.SH SEE ALSO |
| 76 |
.BR dladdr (3), |
| 77 |
.BR dlinfo (3), |
| 78 |
.BR dlopen (3), |
| 79 |
.BR dlsym (3) |