aboutsummaryrefslogtreecommitdiff
path: root/sys/mtio/zawtmt.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/mtio/zawtmt.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/mtio/zawtmt.x')
-rw-r--r--sys/mtio/zawtmt.x30
1 files changed, 30 insertions, 0 deletions
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 <knet.h>
+include <config.h>
+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