#include #include #include #include #include int main (int argc, char** argv) { char* dlerror_msg; int errno1, errno2; void* shobj = dlopen ("./non-existent.so", RTLD_LAZY); errno1 = errno; dlerror_msg = dlerror () ?: "[no error]"; errno2 = errno; printf ("shobj: %p\n", shobj); printf ("dlerror: %s\n", dlerror_msg); printf ("errno1: [%x] %s\n", errno1, strerror (errno1)); printf ("errno2: [%x] %s\n", errno2, strerror (errno2)); return 0; }