Bump support up to FreeBSD 13 and NetBSD 9.2

These releases are really exciting since they contained the patches we
worked to get upstreamed. It means that their /bin/sh interpreters all
work fine with Actually Portable Executable now.
This commit is contained in:
Justine Tunney 2022-06-11 09:27:14 -07:00
parent 1ae6cfc198
commit e96aceae41
14 changed files with 512 additions and 11 deletions

View file

@ -22,6 +22,7 @@
#include "libc/calls/syscall-sysv.internal.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/intrin/kprintf.h"
#include "libc/mem/alloca.h"
#include "libc/paths.h"
#include "libc/runtime/runtime.h"
@ -81,11 +82,7 @@ int sys_execve(const char *prog, char *const argv[], char *const envp[]) {
shargs[2] = prog;
memcpy(shargs + 3, argv, (i + 1) * sizeof(char *));
} else if (CanExecute(prog)) {
if (IsFreebsd() || IsNetbsd()) {
shargs[0] = firstnonnull(commandv("bash", buf, PATH_MAX), _PATH_BSHELL);
} else {
shargs[0] = _PATH_BSHELL;
}
shargs[0] = _PATH_BSHELL;
shargs[1] = prog;
memcpy(shargs + 2, argv + 1, i * sizeof(char *));
} else {