aboutsummaryrefslogtreecommitdiff
path: root/sys/ki/kifchan.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/ki/kifchan.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/ki/kifchan.x')
-rw-r--r--sys/ki/kifchan.x32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/ki/kifchan.x b/sys/ki/kifchan.x
new file mode 100644
index 00000000..199212b2
--- /dev/null
+++ b/sys/ki/kifchan.x
@@ -0,0 +1,32 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <config.h>
+include "ki.h"
+
+# KI_FREECHAN -- Free a channel descriptor slot. Decrement the reference
+# count on the associated node descriptor slot; when the ref count reaches
+# zero, free the node descriptor if the error bit is set. If the error
+# bit is not set the node descriptor is not freed because the kernel server
+# remains connected, ready for reuse.
+
+procedure ki_freechan (chan)
+
+int chan # kichan channel descriptor
+
+int server, and()
+include "kichan.com"
+include "kinode.com"
+
+begin
+ server = k_node[chan]
+
+ # Server=0 if local node.
+ if (server > 0) {
+ n_nrefs[server] = n_nrefs[server] - 1
+ if (and (n_status[server], F_IOERR) != 0)
+ if (n_nrefs[server] == 0)
+ n_status[server] = F_IOERR + F_REUSE
+ }
+
+ k_oschan[chan] = NULL
+end