Add APE fexecve() support (#733)

This commit is contained in:
Gavin Hayes 2023-02-22 21:58:23 -05:00 committed by GitHub
parent b275e664ec
commit ff9c15f48a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 191 additions and 29 deletions

View file

@ -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);
}