From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/etc/prclcpr.x | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sys/etc/prclcpr.x (limited to 'sys/etc/prclcpr.x') 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 +include + +# 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 -- cgit