- Dynamic dynamic;
- cyset(baton, dynamic.dlerror, "_dlerror", "/usr/lib/system/libdyld.dylib");
- cyset(baton, dynamic.dlsym, "_dlsym", "/usr/lib/system/libdyld.dylib");
-
- int (*pthread_detach)(pthread_t);
- dlset(&dynamic, pthread_detach, "pthread_detach");
-
- pthread_t (*pthread_self)();
- dlset(&dynamic, pthread_self, "pthread_self");
-
- pthread_detach(pthread_self());
-
- void *(*dlopen)(const char *, int);
- dlset(&dynamic, dlopen, "dlopen");
+ const mach_header_xx *dyld(NULL);
+ if (dyld == NULL)
+ dyld = Library(baton, "/usr/lib/system/libdyld.dylib");
+ if (dyld == NULL)
+ dyld = Library(baton, "/usr/lib/libSystem.B.dylib");