diff options
Diffstat (limited to 'smash/prompt.c')
| -rw-r--r-- | smash/prompt.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/smash/prompt.c b/smash/prompt.c new file mode 100644 index 0000000..3b6b3c2 --- /dev/null +++ b/smash/prompt.c @@ -0,0 +1,22 @@ +#include "prompt.h" + +#include "../lib/sys/execve.h" +#include "../lib/sys/wait4.h" +#include "../lib/sys/fork.h" +#include "../lib/sys/exit.h" +#include "../lib/env/env.h" +#include "../lib/io/io.h" + +void prompt() +{ + int pid = fork(); + + if (pid == 0) { + const char *argv[] = {"/system/config/smash.d/prompt", 0}; + execve(argv[0], argv, getenvp()); + wstd("> "); + exit(0); + } + + wait4(pid, 0, 0, 0); +} |