summaryrefslogtreecommitdiffstats
path: root/test/proc_child.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:23:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:23:09 +0000
commit30d479c28c831a0d4f1fdb54a9e346b0fc176be1 (patch)
treeaa35d7414ce9f1326abf6f723f6dfa5b0aa08b1d /test/proc_child.c
parentInitial commit. (diff)
downloadapr-0796b9c8dc2d3ccba70e2228520d621065e3fb90.tar.xz
apr-0796b9c8dc2d3ccba70e2228520d621065e3fb90.zip
Adding upstream version 1.7.2.upstream/1.7.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/proc_child.c')
-rw-r--r--test/proc_child.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/proc_child.c b/test/proc_child.c
new file mode 100644
index 0000000..9f458b9
--- /dev/null
+++ b/test/proc_child.c
@@ -0,0 +1,21 @@
+#include "apr.h"
+#include <stdio.h>
+#if APR_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if APR_HAVE_IO_H
+#include <io.h>
+#endif
+#include <stdlib.h>
+
+int main(void)
+{
+ char buf[256];
+ int bytes, rv = 0;
+
+ bytes = (int)read(STDIN_FILENO, buf, 256);
+ if (bytes > 0)
+ rv = write(STDOUT_FILENO, buf, (unsigned int)bytes) == bytes ? 0 : 1;
+
+ return rv;
+}