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

Method get_syspath

src/uinput.rs:284–292  ·  view source on GitHub ↗

Get the syspath representing this uinput device. The syspath returned is the one of the input node itself (e.g. `/sys/devices/virtual/input/input123`), not the syspath of the device node.

(&mut self)

Source from the content-addressed store, hash-verified

282 /// The syspath returned is the one of the input node itself (e.g.
283 /// `/sys/devices/virtual/input/input123`), not the syspath of the device node.
284 pub fn get_syspath(&mut self) -> io::Result<PathBuf> {
285 let mut syspath = vec![0u8; 256];
286 let len = unsafe { sys::ui_get_sysname(self.fd.as_raw_fd(), &mut syspath)? };
287 syspath.truncate(len as usize - 1);
288
289 let syspath = OsStr::from_bytes(&syspath);
290
291 Ok(Path::new(SYSFS_PATH).join(syspath))
292 }
293
294 /// Get the syspaths of the corresponding device nodes in /dev/input.
295 pub fn enumerate_dev_nodes_blocking(&mut self) -> io::Result<DevNodesBlocking> {

Callers 2

enumerate_dev_nodesMethod · 0.80

Calls 1

as_raw_fdMethod · 0.45

Tested by

no test coverage detected