Skip to content

Commit 4c6f928

Browse files
authored
Disable argv[0] tests on non-XnuSilicon (#1015)
Adds a TODO explaining the correct condition.
1 parent 25266b0 commit 4c6f928

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/libc/calls/getprogramexecutablename_test.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ void SetUpOnce(void) {
3636

3737
__attribute__((__constructor__)) static void Child(int argc, char *argv[]) {
3838
static bool skiparg0tests;
39-
if (!__program_executable_name && !IsFreebsd() && !IsNetbsd()) {
39+
if (!IsXnuSilicon()) {
40+
/* TODO(mrdomino): these tests only pass on XnuSilicon right now because
41+
__sys_execve fails there, so the ape loader is used.
42+
the correct check here is "we have been invoked either
43+
as an assimilated binary or via the ape loader, and not
44+
via a raw __sys_execve." */
4045
skiparg0tests = true;
4146
if (argc < 2) {
42-
fprintf(stderr, "warning: old/no loader; skipping argv[0] tests\n");
47+
fprintf(stderr, "warning: skipping argv[0] tests\n");
4348
}
4449
}
4550
if (argc >= 2 && !strcmp(argv[1], "Child")) {

0 commit comments

Comments
 (0)