1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)shell.c	5.1 (Berkeley) 5/30/85";
   9: #endif not lint
  10: 
  11: /*
  12: **  CALL THE SHELL
  13: */
  14: 
  15: shell()
  16: {
  17:     int     i;
  18:     register int    pid;
  19:     register int    sav2, sav3;
  20: 
  21:     if (!(pid = fork()))
  22:     {
  23:         setuid(getuid());
  24:         nice(0);
  25:         execl("/bin/csh", "-", 0);
  26:         syserr("cannot execute /bin/csh");
  27:     }
  28:     sav2 = signal(2, 1);
  29:     sav3 = signal(3, 1);
  30:     while (wait(&i) != pid) ;
  31:     signal(2, sav2);
  32:     signal(3, sav3);
  33: }

Defined functions

shell defined in line 15; used 2 times

Defined variables

sccsid defined in line 8; never used
Last modified: 1985-05-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 854
Valid CSS Valid XHTML 1.0 Strict