krata/xenevtchn/examples/simple.rs

11 lines
292 B
Rust
Raw Normal View History

2024-01-09 01:07:00 +00:00
use xenevtchn::{EventChannel, EventChannelError};
fn main() -> Result<(), EventChannelError> {
let mut channel = EventChannel::open()?;
println!("Channel opened.");
let port = channel.bind_unbound_port(1)?;
println!("port: {}", port);
channel.unbind(port)?;
Ok(())
}