summaryrefslogtreecommitdiffstats
path: root/libtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtest.c')
-rw-r--r--libtest.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libtest.c b/libtest.c
new file mode 100644
index 0000000..1d00b80
--- /dev/null
+++ b/libtest.c
@@ -0,0 +1,18 @@
+// compile with gcc -ldl -o libtest libtest.c
+
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char const* argv[])
+{
+ void *handle;
+
+ handle = dlopen(argv[1], RTLD_NOW);
+ if(!handle) {
+ fprintf(stderr, "%s\n", dlerror());
+ return 1;
+ }
+ dlclose(handle);
+ return 0;
+}