Annotation of 42BSD/games/trek/shell.c, revision 1.1.1.1

1.1       root        1: #ifndef lint
                      2: static char sccsid[] = "@(#)shell.c    4.2     (Berkeley)      5/9/83";
                      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);
                     19:                execl("/bin/csh", "-", 0);
                     20:                syserr("cannot execute /bin/csh");
                     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: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.