summaryrefslogtreecommitdiff
path: root/gnu/lib/libg++/libio/stdio/popen.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-03-15 22:20:43 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-03-15 22:20:43 +0000
commit46b17fd21b2b16c60c2d0c242ed15fad6ab17fc6 (patch)
treec15d088d219cbc2963bcc42c35634a9e4bb296c9 /gnu/lib/libg++/libio/stdio/popen.c
parentf534d44ccdb17011802f89b9ad24fa0712693698 (diff)
Import of GNU libg++ 2.7.1 port (prepared by Erik Theisen)
Diffstat (limited to 'gnu/lib/libg++/libio/stdio/popen.c')
-rw-r--r--gnu/lib/libg++/libio/stdio/popen.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/lib/libg++/libio/stdio/popen.c b/gnu/lib/libg++/libio/stdio/popen.c
new file mode 100644
index 00000000000..9f9f3f72f58
--- /dev/null
+++ b/gnu/lib/libg++/libio/stdio/popen.c
@@ -0,0 +1,23 @@
+#include "libioP.h"
+#include "stdio.h"
+#include <errno.h>
+
+FILE *
+popen(command, mode)
+ const char *command; const char *mode;
+{
+ return _IO_popen(command, mode);
+}
+
+int
+pclose(fp)
+ FILE *fp;
+{
+#if 0
+ /* Does not actually test that stream was created by popen(). Instead,
+ it depends on the filebuf::sys_close() virtual to Do The Right Thing. */
+ if (fp is not a proc_file)
+ return -1;
+#endif
+ return _IO_fclose(fp);
+}