1io_canread(3) Library Functions Manual io_canread(3)
2
3
4
6 io_canread - return a file descriptor that can be read from
7
9 #include <io.h>
10
11 int64 io_canread();
12
14 io_canread returns the next file descriptor that can be read from. You
15 have to have used io_wantread() on the file descriptor earlier, and you
16 have to have called io_wait() or io_waituntil().
17
18 These functions then keep an internal data structure on which descrip‐
19 tors were reported readable by the operating system.
20
21 Please note that there is no guarantee that there still is data that
22 can be read from the descriptor, just that there was data when
23 io_wait() or io_waituntil() were called. Another process could have
24 read the data before you. Look at the result from io_tryread().
25
26 If there are no more descriptors that you can write to without block‐
27 ing, io_canwrite will return -1. In this case you should call
28 io_wait() or io_waituntil() again.
29
30 You should use io_tryread(3) to read from the descriptor, not plain
31 read(2). If you use read(2) and you get EAGAIN, call io_eagain(3).
32
34 io_wait(3), io_canwrite(3), io_eagain(3)
35
36
37
38 io_canread(3)