diff options
Diffstat (limited to '410user/progs/new_shell.c')
| -rw-r--r-- | 410user/progs/new_shell.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/410user/progs/new_shell.c b/410user/progs/new_shell.c new file mode 100644 index 0000000..e3a0135 --- /dev/null +++ b/410user/progs/new_shell.c @@ -0,0 +1,27 @@ +/** @file new_shell.c + * @brief This program tests the new_console() syscall by spawning a + * new shell + * + * @author Geoffrey G. Wilson (ggw) + * @author E. Chaos Golubitsky (egolubit) + * + */ +#include <syscall.h> +#include <stdio.h> + +int main() +{ + char *argvec[] = { "shell", 0} ; + + if (!(fork())) { + printf("i am thread %d; about to switch consoles\n", gettid()); + if (new_console() < 0) { + printf("failed to create new console\n"); + return(-1); + } else { + exec(argvec[0], argvec); + } + } + + return(0); +} |
