io_tryread - Man Page

read from a descriptor without blocking


#include <io.h>

int io_tryread(int64 fd,char* buf,int64 len);


io_tryread tries to read len bytes of data from descriptor fd into buf[0], buf[1], ..., buf[len-1]. (The effects are undefined if len is 0 or smaller.) There are several possible results:

io_tryread does not pause waiting for a descriptor that is not ready. If you want to pause, use io_waitread or io_wait.

You can make io_tryread faster and more efficient by making the socket non-blocking with io_nonblock().

See Also

io_nonblock(3), io_waitread(3), io_tryreadtimeout(3)

Referenced By

io_canread(3), io_tryreadtimeout(3).