Files
Arquivotheca.SunOS-4.1.4/games/trek/shell.c
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

28 lines
429 B
C

#ifndef lint
static char sccsid[] = "@(#)shell.c 1.1 94/10/31 SMI"; /* from UCB 4.2 05/09/83 */
#endif
/*
** CALL THE SHELL
*/
shell()
{
int i;
register int pid;
register int sav2, sav3;
if (!(pid = fork()))
{
setuid(getuid());
nice(0);
execl("/bin/csh", "-", 0);
syserr("cannot execute /bin/csh");
}
sav2 = signal(2, 1);
sav3 = signal(3, 1);
while (wait(&i) != pid) ;
signal(2, sav2);
signal(3, sav3);
}