From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/mtio/zawtmt.x | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sys/mtio/zawtmt.x (limited to 'sys/mtio/zawtmt.x') diff --git a/sys/mtio/zawtmt.x b/sys/mtio/zawtmt.x new file mode 100644 index 00000000..5599a81e --- /dev/null +++ b/sys/mtio/zawtmt.x @@ -0,0 +1,30 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include "mtio.h" + +# ZAWTMT -- Wait for the last i/o transfer to complete, update tape position +# counters, return nbytes|status to caller. + +procedure zawtmt (mtchan, status) + +int mtchan #I i/o channel +int status #O status (nbytes transferred or ERR) + +include "mtio.com" + +begin + # The "sticky" EOF should not be necessary but is needed due to the + # way FIO behaves when it hits EOF on a blocked file. In some + # circumstances (depends upon the file length) two reads are made and + # if the second read does not return zero EOF will not be detected. + + if (MT_ATEOF(mtchan) == YES) + status = 0 + else { + call zzwtmt (MT_OSCHAN(mtchan), MT_DEVPOS(mtchan), status) + if (status == 0) + MT_ATEOF(mtchan) = YES + } +end -- cgit