]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_process_info.dtest/linksWithCF.c
dyld-851.27.tar.gz
[apple/dyld.git] / testing / test-cases / dyld_process_info.dtest / linksWithCF.c
1 #include <stdio.h>
2 #include <signal.h>
3 #include <stdlib.h>
4 #include <dispatch/dispatch.h>
5
6
7 __attribute__((section("__DATA,__allow_alt_plat"))) uint64_t dummy;
8
9 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
10 dispatch_source_t exitSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_PROC, getppid(),
11 DISPATCH_PROC_EXIT, dispatch_get_main_queue());
12 dispatch_source_set_event_handler(exitSource, ^{
13 exit(0);
14 });
15 dispatch_resume(exitSource);
16 dispatch_async(dispatch_get_main_queue(), ^{
17 kill(getppid(), SIGUSR1);
18 });
19 dispatch_main();
20 }
21