io_tryread man page on Alpinelinux

Man page or keyword search:  
man Server   18016 pages
apropos Keyword Search (all sections)
Output format
Alpinelinux logo
[printable version]

io_tryread(3)							 io_tryread(3)

NAME
       io_tryread - read from a descriptor without blocking

SYNTAX
       #include <io.h>

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

DESCRIPTION
       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:

       ·  o_tryread returns an integer between 1 and len: This number of bytes
	  was available for immediate reading; the bytes were  read  into  the
	  beginning  of	 buf.  Note  that  this	 number	 can be, and often is,
	  smaller than len; you must not assume that  io_tryread  always  suc‐
	  ceeds in reading exactly len bytes.

       ·  io_tryread  returns 0: No bytes were read, because the descriptor is
	  at end of file. For example, this descriptor has reached the end  of
	  a disk file, or is reading an empty pipe that has been closed by all
	  writers.

       ·  io_tryread returns -1, setting errno to EAGAIN: No bytes were	 read,
	  because  the descriptor is not ready. For example, the descriptor is
	  reading an empty pipe that could still be written to.

       ·  io_tryread returns -3, setting errno to something other than EAGAIN:
	  No  bytes  were read, because the read attempt encountered a persis‐
	  tent error, such as a serious disk  failure  (EIO),  an  unreachable
	  network (ENETUNREACH), or an invalid descriptor number (EBADF).

       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)

								 io_tryread(3)
[top]

List of man pages available for Alpinelinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net