krata/libs/xen/xenevtchn/examples/simple.rs

12 lines
282 B
Rust
Raw Normal View History

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