dlerror(3)
β¨ dlerror β bestie edition β¨
okay so you know the dlopen API?? the whole dynamic-linking girlboss situation with libdl / -ldl?? yeah. dlerror is the one who tells you what went wrong. she's the friend who actually reads the group chat and explains the drama. π
π¦ SYNOPSIS
#include <dlfcn.h>
char *dlerror(void);
πΈ DESCRIPTION
dlerror() hands you back a human-readable, null-terminated string that describes the most recent error that happened in a call to one of the functions in the dlopen API β counting only stuff that went down since the last time dlerror() was called. so like, she's got amnesia on purpose bestie, it's a feature.
the returned string does not include a trailing newline. no extra \n, she's not doing that to you. π
if no errors have occurred since initialization, or since the last time she was called, dlerror() returns NULL. that NULL is the slay. that NULL is the β
. if you get a string, something fumbled.
π ATTRIBUTES
for the whole explanation of what these words even mean, go peek at attributes(7). β¨
- Interface:
dlerror() - Attribute: Thread safety
- Value:
MT-Safe
so yes bestie, she's MT-Safe β you can call her from multiple threads and she will not start drama. iconic behaviour only.
π STANDARDS
POSIX.1-2008.
π°οΈ HISTORY
glibc 2.0.POSIX.1-2001.
also: SunOS. yes she's been around, she's a legacy legend, giving vintage main character energy. π
π NOTES
the messagedlerror()gives you may live in a statically allocated buffer that gets overwritten by subsequentdlerror()calls. so if you need to keep that string around, copy it immediately, because the next call can and will step on it. no cap. this is the one that bites people fr fr. π
π EXAMPLES
see dlopen(3). she's showing off over there. π«Ά
π₯ SEE ALSO
and that's the whole page bestie!! π this came to you from Linux man-pages 6.20, dated 2026-02-08, so if anybody asks where you got your info, that's the receipt. now go check your error string and copy it before something overwrites it, i'm begging you. ππ¦πΈβπ§π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- Copyright 1995, Yggdrasil Computing, Inc
- Copyright 2015, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms