qio: Provide helpers for O_NONBLOCK operations
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 30 Mar 2016 20:49:29 +0000 (16:49 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 5 Apr 2016 19:42:18 +0000 (15:42 -0400)
commit5ce5d83b63bdda5e76d315edba5b63dd253da9d3
treeeceb250f5a71bd5a4137ceb00b1d38719050da55
parent5dd85903dd8f226e35abb2568b839b1f3e60dc90
qio: Provide helpers for O_NONBLOCK operations

We can now q{b,}{read,write}() in a non-blocking manner, such that each
operation is non-blocking, independently of the rest of the queue.

The old qnonblock style was setting the entire queue to be non-blocking.
This would be a big surprise to the distant end of the queue.  We didn't
notice it with #ip, since the other end of the queue was usually doing a
non-blocking op anyways (or was just buggy!).  We definitely noticed with
pipe, especially when busybox suddenly had its read of stdin throw EAGAIN.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/ns.h
kern/src/ns/qio.c