zipos fexecve now works

This commit is contained in:
Gavin Hayes 2023-02-02 01:12:33 -05:00
parent c395d16230
commit 4fd1fae5ca
2 changed files with 12 additions and 0 deletions

View file

@ -27,6 +27,8 @@
#include "libc/testlib/testlib.h"
// clang-format off
STATIC_YOINK("zip_uri_support");
int fds[2];
char buf[8];
char testlib_enable_tmp_setup_teardown;
@ -97,3 +99,12 @@ TEST(fexecve, APE) {
fexecve(fd, (char *const[]){0}, (char *const[]){0});
EXITS(42);
}
TEST(fexecve, zipos) {
if (!IsLinux()) return;
int fd = open("/zip/life.elf", O_RDONLY);
SPAWN(vfork);
if (fd == -1 && errno == ENOSYS) _Exit(42);
fexecve(fd, (char *const[]){0}, (char *const[]){0});
EXITS(42);
}

View file

@ -92,6 +92,7 @@ o/$(MODE)/test/libc/calls/fexecve_test.com.dbg: \
$(TEST_LIBC_CALLS_DEPS) \
o/$(MODE)/test/libc/calls/fexecve_test.o \
o/$(MODE)/test/libc/calls/calls.pkg \
o/$(MODE)/test/libc/mem/prog/life.elf.zip.o \
o/$(MODE)/tool/build/echo.zip.o \
o/$(MODE)/test/libc/calls/life-nomod.com.zip.o \
$(LIBC_TESTMAIN) \