]>
git.saurik.com Git - apple/xnu.git/blob - tests/no32exec_35914211.c
3 #include <darwintest.h>
4 #include <mach-o/dyld.h>
7 T_DECL(no32exec_bootarg
, "make sure the no32exec boot-arg is honored", T_META_BOOTARGS_SET("-no32exec"))
11 uint32_t size
= sizeof(path
);
13 T_ASSERT_EQ(_NSGetExecutablePath(path
, &size
), 0, NULL
);
14 T_ASSERT_LT(strlcat(path
, "_helper", size
), size
, NULL
);
16 spawn_ret
= posix_spawn(&pid
, path
, NULL
, NULL
, NULL
, NULL
);
19 waitpid(pid
, &wait_ret
, 0);
20 T_ASSERT_FALSE(WIFEXITED(wait_ret
), "i386 helper should not run");
22 T_ASSERT_EQ(spawn_ret
, EBADARCH
, NULL
);