aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/prredir.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/etc/prredir.x')
-rw-r--r--sys/etc/prredir.x32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/etc/prredir.x b/sys/etc/prredir.x
new file mode 100644
index 00000000..baf68b48
--- /dev/null
+++ b/sys/etc/prredir.x
@@ -0,0 +1,32 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <config.h>
+include <syserr.h>
+
+# PRREDIR -- Redirect the pseudofile stream of a connected subprocess. A newly
+# connected subprocess inherits the pseudofile streams of the parent, i.e.,
+# a write to STDOUT by the child will be directed to the STDOUT of the parent.
+# Note that unlike FREDIR, the destination stream must already be open and
+# is unaffected by the redirection of the pseudofile (the pseudofile stream is
+# redirected into the existing stream). The destination file need not be of
+# the same type (binary) as the pseudofile, unless the pseudofile stream
+# contains binary data.
+
+procedure prredir (pid, stream, new_fd)
+
+int pid # process-id of child
+int stream # stream to be redirected (STDIN, STDOUT, etc)
+int new_fd # destination FD (already opened)
+
+int pr
+int pr_findproc()
+include "prc.com"
+errchk syserr
+
+begin
+ pr = pr_findproc (pid)
+ if (pr == ERR)
+ call syserr (SYS_PRNOTFOUND)
+
+ pr_pstofd[pr,stream] = new_fd
+end