dlerror

Returns a string describing the last error.

Library:LibC
Classification:POSIX
Service:Library

Syntax

  #include <dlfcn.h> 
   
  char *dlerror( void );
  

Return Values

Returns a null-terminated character string describing the last error that occurred during a dlopen, dlclose, or dlsym call. Returns NULL if no error has occurred.

The following errors return the string listed in the table.

Error

String

0

"(dlfcn) No error"

ENOSYS

"(dlfcn) This feature not supported"

EAGAIN

"(dlfcn) Resource temporarily unavailable"

ENOENT

"(dlfcn) No such symbol was found."

EIO

"(dlfcn) Error reading executable"

ENOEXEC

"(dlfcn) Bad binary format; unable to create address space"

EWRNGKND

"(dlfcn) Wrong kind of object"

EINUSE

"(dlfcn) Cannot load multiple or duplicate symbol"

EALREADY

"(dlfcn) In load progress elsewhere"

ENOMEM

"(dlfcn) Not enough memory or init failure"

ERESOURCE

"(dlfcn) Load failure including unresolved symbol"

EACCES

"(dlfcn) Module cannot load in kernel"

EINVAL

"(dlfcn) Invalid argument or initialization failure"

(any other error not listed in this table)

"(dlfcn) Unknown error"

Remarks

The dlerror function returns a null-terminated character string (with no trailing <newline>) that describes the last error that occurred during dynamic linking processing. If no dynamic linking errors have occurred since the last invocation of dlerror, dlerror returns NULL. Thus, invoking dlerror a second time, immediately following a prior invocation, results in NULL being returned.

This string is never localized.

For sample code, see DLFcn.c.

See Also