summaryrefslogtreecommitdiff
path: root/src/unix/notbsd/emscripten/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix/notbsd/emscripten/mod.rs')
-rw-r--r--src/unix/notbsd/emscripten/mod.rs44
1 files changed, 36 insertions, 8 deletions
diff --git a/src/unix/notbsd/emscripten/mod.rs b/src/unix/notbsd/emscripten/mod.rs
index 0a98eafb61..f2166d926f 100644
--- a/src/unix/notbsd/emscripten/mod.rs
+++ b/src/unix/notbsd/emscripten/mod.rs
@@ -139,14 +139,6 @@ s! {
__val: [::c_int; 2],
}
- pub struct mq_attr {
- pub mq_flags: ::c_long,
- pub mq_maxmsg: ::c_long,
- pub mq_msgsize: ::c_long,
- pub mq_curmsgs: ::c_long,
- pad: [::c_long; 4]
- }
-
pub struct cpu_set_t {
bits: [u32; 32],
}
@@ -436,6 +428,14 @@ s_no_extra_traits! {
pub mem_unit: ::c_uint,
pub __reserved: [::c_char; 256],
}
+
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ pad: [::c_long; 4]
+ }
}
cfg_if! {
@@ -571,6 +571,34 @@ cfg_if! {
self.__reserved.hash(state);
}
}
+
+ impl PartialEq for mq_attr {
+ fn eq(&self, other: &mq_attr) -> bool {
+ self.mq_flags == other.mq_flags &&
+ self.mq_maxmsg == other.mq_maxmsg &&
+ self.mq_msgsize == other.mq_msgsize &&
+ self.mq_curmsgs == other.mq_curmsgs
+ }
+ }
+ impl Eq for mq_attr {}
+ impl ::fmt::Debug for mq_attr {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mq_attr")
+ .field("mq_flags", &self.mq_flags)
+ .field("mq_maxmsg", &self.mq_maxmsg)
+ .field("mq_msgsize", &self.mq_msgsize)
+ .field("mq_curmsgs", &self.mq_curmsgs)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mq_attr {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mq_flags.hash(state);
+ self.mq_maxmsg.hash(state);
+ self.mq_msgsize.hash(state);
+ self.mq_curmsgs.hash(state);
+ }
+ }
}
}