mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Add execve / fexecve support to ZIpOS (#727)
This commit is contained in:
parent
0312898979
commit
5923d483a4
5 changed files with 143 additions and 22 deletions
|
@ -17,6 +17,8 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
@ -58,3 +60,27 @@ TEST(execve, testArgPassing) {
|
|||
EXITS(0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(execve, ziposELF) {
|
||||
if (!IsLinux() && !IsFreebsd()) {
|
||||
EXPECT_SYS(ENOSYS, -1,
|
||||
execve("/zip/life.elf", (char *const[]){0}, (char *const[]){0}));
|
||||
return;
|
||||
}
|
||||
SPAWN(fork);
|
||||
execve("/zip/life.elf", (char *const[]){0}, (char *const[]){0});
|
||||
notpossible;
|
||||
EXITS(42);
|
||||
}
|
||||
|
||||
TEST(execve, ziposAPE) {
|
||||
if (!IsLinux()) {
|
||||
EXPECT_EQ(-1, execve("/zip/life-nomod.com", (char *const[]){0},
|
||||
(char *const[]){0}));
|
||||
return;
|
||||
}
|
||||
SPAWN(fork);
|
||||
execve("/zip/life-nomod.com", (char *const[]){0}, (char *const[]){0});
|
||||
notpossible;
|
||||
EXITS(42);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue