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
|
@ -25,6 +25,7 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/fmt/libgen.h"
|
||||
#include "libc/intrin/getenv.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
|
@ -260,5 +261,6 @@ static void InitProgramExecutableName(void) {
|
|||
*/
|
||||
char *GetProgramExecutableName(void) {
|
||||
cosmo_once(&g_prog.once, InitProgramExecutableName);
|
||||
STRACE("GetProgramExecutableName() → %#s", __program_executable_name);
|
||||
return __program_executable_name;
|
||||
}
|
||||
|
|
|
@ -4,13 +4,15 @@
|
|||
/*
|
||||
* integral getauxval() keys
|
||||
*/
|
||||
#define AT_PHDR 3
|
||||
#define AT_PHENT 4
|
||||
#define AT_PHNUM 5
|
||||
#define AT_PAGESZ 6
|
||||
#define AT_BASE 7
|
||||
#define AT_FLAGS 8
|
||||
#define AT_ENTRY 9
|
||||
#define AT_PHDR 3
|
||||
#define AT_PHENT 4
|
||||
#define AT_PHNUM 5
|
||||
#define AT_PAGESZ 6
|
||||
#define AT_BASE 7
|
||||
#define AT_FLAGS 8
|
||||
#define AT_FLAGS_PRESERVE_ARGV0_BIT 0
|
||||
#define AT_FLAGS_PRESERVE_ARGV0 (1 << AT_FLAGS_PRESERVE_ARGV0_BIT)
|
||||
#define AT_ENTRY 9
|
||||
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue