projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Bell 32V development
[unix-history]
/
usr
/
src
/
libc
/
stdio
/
system.c
#include <signal.h>
system
(
s
)
char
*
s
;
{
int
status
,
pid
,
w
;
register
int
(*
istat
)(), (*
qstat
)();
if
((
pid
=
fork
()) ==
0
) {
execl
(
"/bin/sh"
,
"sh"
,
"-c"
,
s
,
0
);
_exit
(
127
);
}
istat
=
signal
(
SIGINT
,
SIG_IGN
);
qstat
=
signal
(
SIGQUIT
,
SIG_IGN
);
while
((
w
=
wait
(&
status
)) !=
pid
&&
w
!= -
1
)
;
if
(
w
== -
1
)
status
= -
1
;
signal
(
SIGINT
,
istat
);
signal
(
SIGQUIT
,
qstat
);
return
(
status
);
}