aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/prclcpr.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/etc/prclcpr.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/etc/prclcpr.x')
-rw-r--r--sys/etc/prclcpr.x33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/etc/prclcpr.x b/sys/etc/prclcpr.x
new file mode 100644
index 00000000..e5dd397c
--- /dev/null
+++ b/sys/etc/prclcpr.x
@@ -0,0 +1,33 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <config.h>
+include <syserr.h>
+
+# PRCLCPR -- Close a connected subprocess. Given the PID of the child process
+# we get the input and output file descriptors from the process table and
+# close both files. When the second file is closed the process is disconnected
+# by the PR_ZCLSPR procedure, which leaves the exit status in the process table
+# common.
+
+int procedure prclcpr (pid)
+
+int pid # process id of child process
+
+int child
+int pr_findproc()
+include "prc.com"
+errchk syserr
+
+begin
+ # Search process table for the PID of the child process and close it
+ # if found. Return process termination code to parent.
+
+ child = pr_findproc (pid)
+ if (child == ERR)
+ call syserr (SYS_PRNOTFOUND)
+
+ call close (pr_infd[child])
+ call close (pr_outfd[child])
+
+ return (pr_last_exit_code)
+end