summaryrefslogtreecommitdiff
path: root/410user/progs/new_shell.c
blob: e3a01354a03cd48e12d0f10ba8ad961751216ecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
}