* Copyright (c) 1980 The Regents of the University of California.
* This module is believed to contain source code proprietary to AT&T.
* Use and redistribution is subject to the Berkeley Software License
* Agreement and your Software Agreement with AT&T (Western Electric).
static char sccsid
[] = "@(#)system_.c 5.4 (Berkeley) 4/12/91";
* iexit = system(command)
* iexit will return the exit status of the command
* command is a character string containing the command to be executed
#include "../libI77/fiodefs.h"
#include "../libI77/f_errno.h"
return(-(long)(errno
=F_ERARG
));
for (i
= 0; i
< MXUNIT
; i
++)
return((long)system(buf
));
* this is a sane version of the libc routine.
register sig_t istat
, qstat
;
if ((shell
= getenv("SHELL")) == NULL
)
if (shname
= rindex(shell
, '/'))
if ((pid
= vfork()) == 0) {
execl(shell
, shname
, "-c", s
, (char *)0);
istat
= signal(SIGINT
, SIG_IGN
);
qstat
= signal(SIGQUIT
, SIG_IGN
);
while ((w
= wait(&status
)) != pid
&& w
!= -1)
(void)signal(SIGINT
, istat
);
(void)signal(SIGQUIT
, qstat
);