1: #if defined(LIBC_SCCS) && !defined(lint)
   2: static char sccsid[] = "@(#)system.c	5.2 (Berkeley) 3/9/86";
   3: #endif LIBC_SCCS and not lint
   4: 
   5: #include    <signal.h>
   6: 
   7: system(s)
   8: char *s;
   9: {
  10:     int status, pid, w;
  11:     register int (*istat)(), (*qstat)();
  12: 
  13:     if ((pid = vfork()) == 0) {
  14:         execl("/bin/sh", "sh", "-c", s, 0);
  15:         _exit(127);
  16:     }
  17:     istat = signal(SIGINT, SIG_IGN);
  18:     qstat = signal(SIGQUIT, SIG_IGN);
  19:     while ((w = wait(&status)) != pid && w != -1)
  20:         ;
  21:     if (w == -1)
  22:         status = -1;
  23:     signal(SIGINT, istat);
  24:     signal(SIGQUIT, qstat);
  25:     return(status);
  26: }

Defined functions

system defined in line 7; used 109 times

Defined variables

sccsid defined in line 2; never used
Last modified: 1986-03-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1227
Valid CSS Valid XHTML 1.0 Strict