diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/fmio/fmlfbwt.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/fmio/fmlfbwt.x')
-rw-r--r-- | sys/fmio/fmlfbwt.x | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/fmio/fmlfbwt.x b/sys/fmio/fmlfbwt.x new file mode 100644 index 00000000..2310c281 --- /dev/null +++ b/sys/fmio/fmlfbwt.x @@ -0,0 +1,32 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <knet.h> +include "fmio.h" + +# FM_LFBINWAIT -- Wait for i/o on a binary lfile. + +procedure fm_lfbinwait (lf, status) + +pointer lf #I lfile descriptor +int status #O i/o status (nbytes transferred or ERR) + +pointer fm +int chan + +begin + fm = LF_FM(lf) + chan = FM_CHAN(fm) + + # Wait for i/o and increment byte count. + if (and (LF_FLAGS(lf), LFF_IOINPROGRESS) != 0) { + call zawtbf (chan, status) + if (status >= 0) + LF_STATUS(lf) = LF_STATUS(lf) + min(LF_LTSIZE(lf),status) + else + LF_STATUS(lf) = ERR + LF_FLAGS(lf) = and (LF_FLAGS(lf), not(LFF_IOINPROGRESS)) + } + + call fmio_tick (fm) + status = LF_STATUS(lf) +end |