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/prkill.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/etc/prkill.x')
-rw-r--r-- | sys/etc/prkill.x | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/etc/prkill.x b/sys/etc/prkill.x new file mode 100644 index 00000000..f6938923 --- /dev/null +++ b/sys/etc/prkill.x @@ -0,0 +1,42 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <knet.h> +include <config.h> +include <syserr.h> + +define NOKILL NO +define KILL YES + +# PRKILL -- Kill a detached process. Control does not return until the process +# has terminated, unless the kill fails for some reason. If the process exists +# and is terminated by the kill directive, the exit status is left in the +# process table for return by PRCLDPR. + +procedure prkill (job) + +int job # slot number of job in prd.com table +include "prd.com" +errchk syserr + +begin + # Kill the process if there is such a process and it is still active. + # It is an error to try to kill a nonexistent process or a process + # which has already been killed. + + if (pr_jobcode[job] == NULL) + call syserr (SYS_PRBKGNF) + else if (pr_active[job] == NO) + call syserr (SYS_PRBKGNOKILL) + else { + call zcldpr (pr_jobcode[job], KILL, pr_exit_status[job]) + if (pr_exit_status[job] == ERR) + call syserr (SYS_PRBKGNOKILL) + else + pr_active[job] = NO + } + + # Delete the bkgfile if the process has not already done so during + # shutdown. + iferr (call delete (Memc[pr_bkgfile[job]])) + ; +end |