*allocate_data().
*/
}
}
Multithread Usage
The dlgetfileinfo routine is
Return Value
If successful, dlgetfileinfo returns 0, otherwise a
Errors
If dlgetfileinfo fails, a subsequent call to dlerrno returns an error. For a complete listing of those values, see the dlgetfileinfo (3C) manpage.
The dlerror Routine
The dlerror routine gets diagnostic information.
Syntax
char *dlerror(void);
Description
The dlerror routine returns a
NOTE: The messages returned by dlerror may reside in a static buffer that is overwritten on each call to dlerror. Application code must not write to this buffer. Programs taht seek to preserve an error message must make their own copies of that message
Using dlerror to get diagnostic information
The following code sequence shows how to use dlerror to get diagnostic information:
void* handle;
/* Try to load a
handle = dlopen("invalid.so", RTLD_GLOBAL RTLD_LAZY); if (handle == NULL) {
printf("%s\n", dlerror());
}
The dlsym Routine
The dlsym gets the address of a symbol in shared library.
Syntax
void *dlsym(void *handle, const char *name);
The dlopen Shared Library Management Routines 157