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

Function fd_write_all

src/lib.rs:536–545  ·  view source on GitHub ↗
(fd: std::os::fd::BorrowedFd<'_>, mut data: &[u8])

Source from the content-addressed store, hash-verified

534impl std::error::Error for EnumParseError {}
535
536fn fd_write_all(fd: std::os::fd::BorrowedFd<'_>, mut data: &[u8]) -> nix::Result<()> {
537 loop {
538 match nix::unistd::write(fd, data) {
539 Ok(0) => return Ok(()),
540 Ok(n) => data = &data[n..],
541 Err(nix::Error::EINTR) => {}
542 Err(e) => return Err(e),
543 }
544 }
545}
546
547fn write_events(fd: std::os::fd::BorrowedFd<'_>, events: &[InputEvent]) -> nix::Result<()> {
548 let bytes = unsafe { cast_to_bytes(events) };

Callers 1

write_eventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…