aboutsummaryrefslogtreecommitdiff
path: root/unix/gdev/iism75/zwtm75.x
blob: 491b0f5054fc62f621184a807fc997e6586b94db (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
27
28
29
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<mach.h>
include	"m75.h"

# ZWTM75 -- Wait for i/o completion and return the number of bytes read or
# written or ERR.  Repetitive calls return the same value.

procedure zwtm75 (ifcb, status)

int	ifcb			# pointer to channel descriptor passed as int
int	status			# nbytes transferred or ERR

pointer	fcb

begin
	fcb = ifcb

	switch (FCB_STATUS(fcb)) {
	case ERR:
	    status = ERR
	case IIS_INACTIVE:
	    status = FCB_NBYTES(fcb)

	default:
	    call zawtbf (FCB_CHAN(fcb), status)
	    FCB_STATUS(fcb) = IIS_INACTIVE
	}
end