From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/gio/gki/gkiflush.x | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sys/gio/gki/gkiflush.x (limited to 'sys/gio/gki/gkiflush.x') diff --git a/sys/gio/gki/gkiflush.x b/sys/gio/gki/gkiflush.x new file mode 100644 index 00000000..878502d4 --- /dev/null +++ b/sys/gio/gki/gkiflush.x @@ -0,0 +1,40 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include + +# GKI_FLUSH -- Flush any buffered output. +# +# BOI GKI_FLUSH 0 +# +# L(i) set to the constant 3 (no data fields) + +procedure gki_flush (fd) + +int fd # output file + +int epa +short gki[GKI_FLUSH_LEN] +data gki[1] /BOI/, gki[2] /GKI_FLUSH/, gki[3] /LEN_GKIHDR/ +errchk write, seek +include "gki.com" + +begin + if (IS_INLINE(fd)) { + epa = gk_dd[GKI_FLUSH] + if (epa != 0) + call zcall1 (epa, 0) + } else { + call write (gk_fd[fd], gki, GKI_FLUSH_LEN * SZ_SHORT) + + # If writing to a subkernel we must call PR_PSIO to give the + # kernel a chance to read the spooled metacode. + + if (IS_SUBKERNEL(fd)) { + call seek (fd, BOFL) + call zcall3 (gk_prpsio, KERNEL_PID(fd), fd, FF_WRITE) + } else + call flush (gk_fd[fd]) + } +end -- cgit