io_nonblock 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_nonblock(3)							io_nonblock(3)

NAME
       io_nonblock - switch to non-blocking I/O

SYNTAX
       #include <io.h>

       void io_nonblock(int64 fd);

DESCRIPTION
       io_nonblock puts UNIX descriptor fd into ``non-blocking mode.'' Calling
       io_nonblock(fd)	before	io_fd(fd)  makes  io_tryread  and  io_trywrite
       faster and more efficient.

       Actually, current UNIX kernels do not support non-blocking descriptors;
       they support non-blocking open files. Furthermore, many	programs  will
       break if they encounter non-blocking mode. This means that you must not
       use io_nonblock for a descriptor inherited from another program.

       io_nonblock has no return value; it always succeeds. If d  is  not  the
       number of a UNIX descriptor, io_nonblock has no effect.

       If io_fd is given a descriptor in blocking mode, io_tryread and io_try‐
       write go through the following contortions to avoid blocking:

       1  Stop if poll says  that  the	descriptor  is	not  ready.  Otherwise
	  there's  a  good  chance, but not a guarantee: even if poll says the
	  descriptor is ready, the descriptor might  not  be  ready  a	moment
	  later. (Furthermore, poll can fail on some systems.)

       2  Catch	 SIGALRM.  SIGALRM  must  not be blocked, and must not be used
	  elsewhere in the program.

       3  Set an interval timer so that any blocking call will be  interrupted
	  by  SIGALRM  within  10  milliseconds.  (Current UNIX kernels do not
	  allow any shorter interval.)	Of  course,  this  may	still  mean  a
	  10-millisecond delay.

       If  io_fd  is  given a descriptor in non-blocking mode (or a descriptor
       for a regular disk file), io_tryread and io_trywrite avoid  these  con‐
       tortions.

SEE ALSO
       io_wait(3), io_canwrite(3)

								io_nonblock(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