|
NAMEio_nonblock - switch to non-blocking I/OSYNTAX#include <libowfat/io.h>void io_nonblock(int64 fd); DESCRIPTIONio_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_trywrite go through the following contortions to avoid blocking:
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 contortions. SEE ALSOio_wait(3), io_canwrite(3) Visit the GSP FreeBSD Man Page Interface. |