mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Enable argv[0] tests in more places (#1061)
Now we do them for assimilated binaries (except on OpenBSD or XNU non-Silicon), for XnuSilicon, and for binaries with the preserve- argv[0] auxv flag set. We check whether to pass the argv[0] value at the test site rather than the Child site. We move a lot of the test initialization into Child in the non-child case, in order to get at the pre-init value of `__program_executable_name`. Finally, we print out info about what we are skipping.
This commit is contained in:
parent
b09096691a
commit
636bc4007b
4 changed files with 41 additions and 25 deletions
|
@ -947,6 +947,7 @@ EXTERN_C __attribute__((__noreturn__)) void ApeLoader(long di, long *sp,
|
|||
} else if (SupportsNetbsd() && !os && ap[0] == AT_EXECFN_NETBSD) {
|
||||
os = NETBSD;
|
||||
} else if (SupportsLinux() && ap[0] == AT_FLAGS) {
|
||||
// TODO(mrdomino): maybe set/insert this when we are called as "ape -".
|
||||
arg0 = !!(ap[1] & AT_FLAGS_PRESERVE_ARGV0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue