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/proscmd.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/etc/proscmd.x')
-rw-r--r-- | sys/etc/proscmd.x | 32 |
1 files changed, 32 insertions, 0 deletions
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 <config.h> + +# 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 |