]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_fork-locks.dest/main.c
2 // BUILD: $CC main.c -o $BUILD_DIR/dyld_fork_test.exe
4 // RUN: ./dyld_fork_test.exe
8 #include <mach-o/dyld_priv.h>
10 #include "test_support.h"
14 static void notifyBeforeFork(const struct mach_header
* mh
, intptr_t vmaddr_slide
)
16 static bool sRanNotifier
= false;
21 // fork and exec child
22 pid_t sChildPid
= fork();
23 if ( sChildPid
< 0 ) {
26 if ( sChildPid
== 0 ) {
32 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
33 _dyld_register_func_for_add_image(¬ifyBeforeFork
);