Skip to content

Commit 80f447b

Browse files
committed
Added getters for the MqAttr struct
1 parent a392647 commit 80f447b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2121
(#[1537](https://github.com/nix-rust/nix/pull/1537))
2222
- Added the `SO_TIMESTAMPING` support
2323
(#[1547](https://github.com/nix-rust/nix/pull/1547))
24+
- Added getter methods to `MqAttr` struct
25+
(#[1619](https://github.com/nix-rust/nix/pull/1619))
2426

2527
### Changed
2628
### Fixed

src/mqueue.rs

+15
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ impl MqAttr {
6464
pub const fn flags(&self) -> mq_attr_member_t {
6565
self.mq_attr.mq_flags
6666
}
67+
68+
/// The max number of messages that can be held by the queue
69+
pub const fn maxmsg(&self) -> mq_attr_member_t {
70+
self.mq_attr.mq_maxmsg
71+
}
72+
73+
/// The maximum size of each message (in bytes)
74+
pub const fn msgsize(&self) -> mq_attr_member_t {
75+
self.mq_attr.mq_msgsize
76+
}
77+
78+
/// The number of messages currently held in the queue
79+
pub const fn curmsgs(&self) -> mq_attr_member_t {
80+
self.mq_attr.mq_curmsgs
81+
}
6782
}
6883

6984

0 commit comments

Comments
 (0)