mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 00:38:31 +00:00
Add APE fexecve() support (#733)
This commit is contained in:
parent
b275e664ec
commit
ff9c15f48a
9 changed files with 191 additions and 29 deletions
|
@ -86,3 +86,14 @@ TEST(fexecve, memfd_create) {
|
|||
fexecve(fd, (char *const[]){0}, (char *const[]){0});
|
||||
EXITS(42);
|
||||
}
|
||||
|
||||
TEST(fexecve, APE) {
|
||||
if (!IsLinux() && !IsFreebsd()) return;
|
||||
testlib_extract("/zip/life-nomod.com", "life-nomod.com", 0555);
|
||||
SPAWN(fork);
|
||||
int fd = open("life-nomod.com", O_RDONLY);
|
||||
ASSERT_NE(-1, fd);
|
||||
if (fd == -1 && errno == ENOSYS) _Exit(42);
|
||||
fexecve(fd, (char *const[]){0}, (char *const[]){0});
|
||||
EXITS(42);
|
||||
}
|
||||
|
|
|
@ -93,6 +93,7 @@ o/$(MODE)/test/libc/calls/fexecve_test.com.dbg: \
|
|||
o/$(MODE)/test/libc/calls/fexecve_test.o \
|
||||
o/$(MODE)/test/libc/calls/calls.pkg \
|
||||
o/$(MODE)/tool/build/echo.zip.o \
|
||||
o/$(MODE)/test/libc/calls/life-nomod.com.zip.o \
|
||||
$(LIBC_TESTMAIN) \
|
||||
$(CRT) \
|
||||
$(APE_NO_MODIFY_SELF)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue