Skip to content

Instantly share code, notes, and snippets.

@vagetablechicken
Created June 14, 2023 04:12
Show Gist options
  • Save vagetablechicken/5f9f65154b303415b20faf7baae51743 to your computer and use it in GitHub Desktop.
Save vagetablechicken/5f9f65154b303415b20faf7baae51743 to your computer and use it in GitHub Desktop.
test load udf so
#include <dlfcn.h>
#include <stdio.h>
int main(void) {
void *handle;
char *error;
handle = dlopen("libtest_udf.so", RTLD_LAZY);
if (!handle) {
fprintf(stderr, "%s\n", dlerror());
return 1;
}
dlclose(handle);
return 0;
}
@vagetablechicken
Copy link
Author

test way
g++ dlopen_test.cc -ldl
LD_LIBRARY_PATH=$(pwd) ./a.out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment