diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-15 16:35:40 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-15 16:35:40 +0100 |
| commit | 5ecb8aafa496e9dfff51378be50eb29858b5465a (patch) | |
| tree | 312a64f45148d03464c08f309af4a9a46a3f4ec8 /smash/prompt.c | |
| parent | 0d9c643920a9431870983c896fb0b45d87d88afe (diff) | |
add quote parsing to smash
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); +} |