1io_waitread(3) Library Functions Manual io_waitread(3)
2
3
4
6 io_waitread - read from a descriptor
7
9 #include <io.h>
10
11 int io_waitread(int64 fd,char* buf,int64 len);
12
14 io_waitread tries to read len bytes of data from descriptor fd into
15 buf[0], buf[1], ..., buf[len-1]. (The effects are undefined if len is 0
16 or smaller.) There are several possible results:
17
18
19 · o_waitread returns an integer between 1 and len: This number of
20 bytes was available for immediate reading; the bytes were read into
21 the beginning of buf. Note that this number can be, and often is,
22 smaller than len; you must not assume that io_waitread always suc‐
23 ceeds in reading exactly len bytes.
24
25 · io_waitread returns 0: No bytes were read, because the descriptor is
26 at end of file. For example, this descriptor has reached the end of
27 a disk file, or is reading an empty pipe that has been closed by all
28 writers.
29
30 · io_waitread returns -3, setting errno to something other than
31 EAGAIN: No bytes were read, because the read attempt encountered a
32 persistent error, such as a serious disk failure (EIO), an unreach‐
33 able network (ENETUNREACH), or an invalid descriptor number (EBADF).
34
35
37 io_nonblock(3), io_waitread(3), io_waitreadtimeout(3)
38
39
40
41 io_waitread(3)