Set `O_NONBLOCK` on this device handle.
(&self, nonblocking: bool)
| 364 | |
| 365 | /// Set `O_NONBLOCK` on this device handle. |
| 366 | pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { |
| 367 | let mut flags = |
| 368 | fcntl::OFlag::from_bits_retain(fcntl::fcntl(self.as_raw_fd(), fcntl::F_GETFL)?); |
| 369 | flags.set(fcntl::OFlag::O_NONBLOCK, nonblocking); |
| 370 | fcntl::fcntl(self.as_raw_fd(), fcntl::F_SETFL(flags))?; |
| 371 | Ok(()) |
| 372 | } |
| 373 | |
| 374 | /// Grab the device through a kernel syscall. |
| 375 | /// |