projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fc1edd3
)
BSD 3 development
author
Bill Joy
<wnj@ucbvax.Berkeley.EDU>
Thu, 27 Sep 1979 12:24:35 +0000
(
04:24
-0800)
committer
Bill Joy
<wnj@ucbvax.Berkeley.EDU>
Thu, 27 Sep 1979 12:24:35 +0000
(
04:24
-0800)
Work on file usr/src/libc/stdio/system.c
Synthesized-from: 3bsd
usr/src/libc/stdio/system.c
[new file with mode: 0644]
patch
|
blob
diff --git a/usr/src/libc/stdio/system.c
b/usr/src/libc/stdio/system.c
new file mode 100644
(file)
index 0000000..
c8ed4ca
--- /dev/null
+++ b/
usr/src/libc/stdio/system.c
@@ -0,0
+1,22
@@
+#include <signal.h>
+
+system(s)
+char *s;
+{
+ int status, pid, w;
+ register int (*istat)(), (*qstat)();
+
+ if ((pid = vfork()) == 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);
+}