void *dlsym(void *handle, const char *symbol);
void *dlvsym(void *handle, char *symbol, char *version);
Since the value of the symbol could actually be NULL (so that a NULL return from dlsym() need not indicate an error), the correct way to test for an error is to call dlerror(3) to clear any old error conditions, then call dlsym(), and then call dlerror(3) again, saving its return value into a variable, and check whether this saved value is not NULL.
There are two special pseudo-handles that may be specified in handle:
The function dlvsym() does the same as dlsym() but takes a version string as an additional argument.
|dlsym(), dlvsym()||Thread safety||MT-Safe|