From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/etc/prredir.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/etc/prredir.x (limited to 'sys/etc/prredir.x') 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 +include + +# 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 -- cgit