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 message dlerror() gives you may live in a statically allocated buffer that gets overwritten by subsequent dlerror() 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms