tools/llvm: Do not build with symbols
[minix3.git] / tests / lib / csu / h_initfini3.cxx
blob13f54cebdb8ea15432acab1e3558b8cec8365e49
1 #include <dlfcn.h>
2 #include <err.h>
3 #include <unistd.h>
5 int
6 main(void)
8 static const char msg1[] = "main started\n";
9 static const char msg2[] = "main after dlopen\n";
10 static const char msg3[] = "main terminated\n";
12 void *handle;
14 write(STDOUT_FILENO, msg1, sizeof(msg1) - 1);
15 handle = dlopen("h_initfini3_dso.so", RTLD_NOW | RTLD_LOCAL);
16 if (handle == NULL)
17 err(1, "dlopen");
18 write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
19 dlclose(handle);
20 write(STDOUT_FILENO, msg3, sizeof(msg3) - 1);
21 return 0;