pub fn set_nonblocking<F: AsRawFd>(
file: &mut F,
nonblocking: bool,
) -> Result<()>Expand description
Sets the nonblocking mode of the underlying file descriptor to either on
(true) or off (false). If File::new_nb was previously used to
construct the File, then nonblocking mode has already been turned on.
This function is not atomic. It should only called if you have exclusive control of the underlying file descriptor.
Implementation detail: uses fcntl to query the flags and set
O_NONBLOCK.