diff --git a/newlib/examples/tests.c b/newlib/examples/tests.c index 78603b14..20723195 100644 --- a/newlib/examples/tests.c +++ b/newlib/examples/tests.c @@ -36,8 +36,10 @@ int main(int argc, char** argv) pid = fork(); if (pid == 0) { // child + char* args[] = {"/bin/hello", (char*) 0}; + printf("Hello from child process!\n"); - exit(42); + execve("/bin/hello", args, environ); } else { printf("Hello from parent process! pid = %u\n", pid); wait(&status); diff --git a/newlib/src/libgloss/metalsvm/environ.c b/newlib/src/libgloss/metalsvm/environ.c index 26ff78c6..1dd0e212 100644 --- a/newlib/src/libgloss/metalsvm/environ.c +++ b/newlib/src/libgloss/metalsvm/environ.c @@ -17,5 +17,6 @@ * This file is part of MetalSVM. */ -char *__env[1] = { 0 }; +/* default environment */ +char *__env[] = { "USER=root", "PATH=/bin:/sbin:/usr/bin", "PWD=/", (char *) 0 }; char **environ = __env;