]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_process_info_unload.dtest/target.c
dyld-551.3.tar.gz
[apple/dyld.git] / testing / test-cases / dyld_process_info_unload.dtest / target.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <dlfcn.h>
5 #include <unistd.h>
6 #include <mach/mach.h>
7
8
9
10 int main(int argc, const char* argv[])
11 {
12 //fprintf(stderr, "target starting\n");
13 usleep(1000);
14 // load and unload in a loop
15 for (int i=1; i < 10000; ++i) {
16 void* h = dlopen("./libfoo.dylib", 0);
17 usleep(100000/(i*100));
18 dlclose(h);
19 }
20 //fprintf(stderr, "target done\n");
21
22 return 0;
23 }
24