Remove malloc() dependency on pledge() / unveil()

This change also fixes a bug with gettid() being incorrect after fork().
We now implement the ENOENT behavior for getauxval(). The getuid() etc.
system calls are now faster too. Plus issetugid() will work on BSDs.
This commit is contained in:
Justine Tunney 2022-07-24 19:40:32 -07:00
parent c921dc78f0
commit 3d2cf95af1
33 changed files with 270 additions and 100 deletions

View file

@ -23,7 +23,8 @@
noasan int main(int argc, char *argv[]) {
int i = 0;
Elf64_Ehdr *ehdr = (Elf64_Ehdr *)getauxval(AT_SYSINFO_EHDR);
Elf64_Ehdr *ehdr;
ehdr = (Elf64_Ehdr *)getauxval(AT_SYSINFO_EHDR);
if (isatty(1)) exit(1);
for (;;) {
write(1, ((char *)ehdr) + i++, 1);