]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/macOS-cache-rebuild.dtest/main.c
d60aee31a70a82a000d65ccc4aad096b9508918d
3 // BUILD: $CC main.c -o $BUILD_DIR/rebuild-dyld-cache.exe
5 // RUN: ./rebuild-dyld-cache.exe
16 #include <sys/types.h>
18 extern char** environ
;
22 printf("[BEGIN] macOS-cache-rebuild\n");
24 const char* argv
[] = { "/usr/bin/update_dyld_shared_cache", "-cache_dir", "/tmp/", NULL
};
26 int psResult
= posix_spawn(&child
, "/usr/bin/update_dyld_shared_cache", NULL
, NULL
, (char**)argv
, environ
);
27 if ( psResult
!= 0 ) {
28 printf("[FAIL] macOS-cache-rebuild: posix_spawn failed, err=%d\n", psResult
);
33 (void)wait4(child
, &childStatus
, 0, NULL
);
34 if (WIFEXITED(childStatus
) == 0)
35 printf("[FAIL] macOS-cache-rebuild: update_dyld_shared_cache did not exit\n");
36 else if (WEXITSTATUS(childStatus
) != 0)
37 printf("[FAIL] macOS-cache-rebuild: update_dyld_shared_cache failed\n");
39 printf("[PASS] macOS-cache-rebuild\n");