]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-in-init.dtest/foo.c
dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-in-init.dtest / foo.c
1 #include <dlfcn.h>
2 #include <pthread.h>
3
4 #include "test_support.h"
5
6 static void* work1(void* arg)
7 {
8 void* h = dlopen("System/Library/Frameworks/Foundation.framework/Foundation", 0);
9
10 return NULL;
11 }
12
13
14 __attribute__((constructor))
15 void myinit(int argc, const char* argv[], const char* envp[], const char* apple[]) {
16 pthread_t workerThread;
17
18 if ( pthread_create(&workerThread, NULL, work1, NULL) != 0 ) {
19 FAIL("pthread_create");
20 }
21
22 void* dummy;
23 pthread_join(workerThread, &dummy);
24 }
25