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/proscmd.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/etc/proscmd.x (limited to 'sys/etc/proscmd.x') diff --git a/sys/etc/proscmd.x b/sys/etc/proscmd.x new file mode 100644 index 00000000..cf1e5bb3 --- /dev/null +++ b/sys/etc/proscmd.x @@ -0,0 +1,32 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include + +# PROSCMD -- Process an OS escape command from a subprocess. Execute the +# command and return the exit status to the subprocess via IPC. + +procedure proscmd (pr, cmd) + +int pr # subprocess process slot number +char cmd[ARB] # host command to be executed + +char statbuf[5] +int fd, status, op +int itoc(), oscmd() +include "prc.com" + +begin + fd = pr_outfd[pr] + + # Execute the command (waits for completion). + status = oscmd (cmd, "", "", "") + + # Encode the return status. + op = itoc (status, statbuf, 5) + 1 + statbuf[op] = '\n' + statbuf[op+1] = EOS + + # Return the status to the subprocess. + call write (fd, statbuf, op) + call flush (fd) +end -- cgit