diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/etc/prredir.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/etc/prredir.x')
-rw-r--r-- | sys/etc/prredir.x | 32 |
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 |