2023-10-14 11:59:30 +02:00
|
|
|
# Sysvmq
|
|
|
|
|
2023-12-08 01:20:38 +01:00
|
|
|
This library provides a convenient and easy usable API for SysV IPC
|
|
|
|
message queues.
|
2023-10-14 11:59:30 +02:00
|
|
|
|
2023-12-08 01:20:38 +01:00
|
|
|
```rust
|
|
|
|
use sysvmq::{SysvMq, SysvMqError};
|
2023-10-14 11:59:30 +02:00
|
|
|
|
2023-12-08 01:20:38 +01:00
|
|
|
fn example() -> Result<(), SysvMqError> {
|
|
|
|
let mut mq = SysvMq::new(0)?;
|
|
|
|
let mut buf = [0u8; 11];
|
|
|
|
|
|
|
|
mq.send(b"hello queue")?;
|
|
|
|
mq.recv(&mut buf)?;
|
|
|
|
mq.delete()?;
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
```
|