mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Add execve() test
This commit is contained in:
parent
38728cef79
commit
a259e43d84
7 changed files with 75 additions and 13 deletions
|
@ -14,10 +14,12 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
|
||||
STATIC_YOINK("strerror");
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
sigset_t ss;
|
||||
if (argc < 3) {
|
||||
fputs("USAGE: EXEC.COM PROG ARGV₀ [ARGV₁...]\n", stderr);
|
||||
if (argc < 2) {
|
||||
fputs("USAGE: EXEC.COM PROG [ARGV₀...]\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -26,6 +28,6 @@ int main(int argc, char *argv[]) {
|
|||
sigaddset(&ss, SIGPWR);
|
||||
sigprocmask(SIG_BLOCK, &ss, 0);
|
||||
|
||||
execv(argv[1], argv + 1);
|
||||
execv(argv[1], argv + 2);
|
||||
return 127;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue