MCPcopy Create free account
hub / github.com/emberian/evdev / set_nonblocking

Method set_nonblocking

src/sync_stream.rs:366–372  ·  view source on GitHub ↗

Set `O_NONBLOCK` on this device handle.

(&self, nonblocking: bool)

Source from the content-addressed store, hash-verified

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 ///

Callers 2

newMethod · 0.80
mainFunction · 0.80

Calls 2

setMethod · 0.80
as_raw_fdMethod · 0.45

Tested by 1

mainFunction · 0.64