aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/prdone.x
blob: 2df2dccc8ec3185ce8013cbf0f07e44f4e005892 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<config.h>
include	<syserr.h>

# PRDONE -- Determine if a detached process (background job) has completed.
# This is a difficult process to perform portably at the system call level,
# hence the deletion of the bkgfile is used to signal the completion of a
# detached process.  If the detached process fails to delete its bkgfile
# for some reason, PRCLDPR will do so if the process has indeed terminated.

int procedure prdone (job)

int	job			# job number (slot number in job table)
int	access()
include	"prd.com"

begin
	if (pr_jobcode[job] == NULL)
	    call syserr (SYS_PRBKGNF)

	if (access (Memc[pr_bkgfile[job]], 0, 0) == YES)
	    return (NO)
	else
	    return (YES)
end