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/ki/kbzcls.x | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sys/ki/kbzcls.x (limited to 'sys/ki/kbzcls.x') diff --git a/sys/ki/kbzcls.x b/sys/ki/kbzcls.x new file mode 100644 index 00000000..afb1f348 --- /dev/null +++ b/sys/ki/kbzcls.x @@ -0,0 +1,37 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include "ki.h" + +# KB_ZCLS -- Close a binary device. We are called only if the device does not +# reside on the local node. + +procedure kb_zcls (device, chan, status) + +int device # device driver code +int chan # channel assigned device +int status # receives ok|err + +int server +int ki_sendrcv() +include "kichan.com" +include "kii.com" + +begin + server = k_node[chan] + p_arg[1] = k_oschan[chan] + + # If we receive error on the KS channel when trying to close a file, + # it is most likely due to a previous i/o error on the channel. Do + # not return error here because we are probably being called during + # error recovery to free the logical channel, and if we return error + # the real error will be hidden. + + if (ki_sendrcv (server, device, BF_CLS) == ERR) + status = OK + else + status = p_arg[1] + + call ki_freechan (chan) +end -- cgit