Commit | Line | Data |
---|---|---|
9d9faa64 | 1 | #ifndef lint |
773f1498 | 2 | static char sccsid[] = "@(#)shell.c 4.2 (Berkeley) %G%"; |
9d9faa64 KM |
3 | #endif not lint |
4 | ||
5 | /* | |
6 | ** CALL THE SHELL | |
7 | */ | |
8 | ||
9 | shell() | |
10 | { | |
11 | int i; | |
12 | register int pid; | |
13 | register int sav2, sav3; | |
14 | ||
15 | if (!(pid = fork())) | |
16 | { | |
17 | setuid(getuid()); | |
18 | nice(0); | |
773f1498 KL |
19 | execl("/bin/csh", "-", 0); |
20 | syserr("cannot execute /bin/csh"); | |
9d9faa64 KM |
21 | } |
22 | sav2 = signal(2, 1); | |
23 | sav3 = signal(3, 1); | |
24 | while (wait(&i) != pid) ; | |
25 | signal(2, sav2); | |
26 | signal(3, sav3); | |
27 | } |