add execvp

This commit is contained in:
Mackenzie Clark
2019-03-01 10:59:52 -08:00
parent 2ea9d0b09b
commit 00e3ec1446
9 changed files with 98 additions and 0 deletions

17
lib/emscripten/emtests/test_execvp.c vendored Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
#include <unistd.h>
int main() {
char command[] = "touch";
char arg1[] = "foo.txt";
char* argv[3];
argv[0] = command;
argv[1] = arg1;
argv[2] = 0;
printf("_execvp\n");
int result = execvp(command, argv);
// should not return, and not print this message
printf("error");
return 0;
}

View File

@ -0,0 +1 @@
_execvp

BIN
lib/emscripten/emtests/test_execvp.wasm vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,18 @@
#include <stdio.h>
#include <unistd.h>
int main() {
char command[] = "C:\\Windows\\System32\\cmd.exe";
char arg1[] = "echo";
char arg2[] = "foo";
char* argv[4];
argv[0] = command;
argv[1] = arg1;
argv[2] = arg2;
argv[3] = 0;
printf("_execvp\n");
int result = execvp(command, argv);
// should not return, and not print this message
printf("error");
return 0;
}

Binary file not shown.