summaryrefslogtreecommitdiff
path: root/src/sys/signal.rs
diff options
context:
space:
mode:
authorGerman Maglione <gmaglione@redhat.com>2022-06-20 11:57:04 +0200
committerGerman Maglione <gmaglione@redhat.com>2022-07-12 17:25:51 +0200
commitb207aaee4ca5721314d03172bbf188e63ec21cc3 (patch)
treecc786cd4c04eed8fcd8257962ef01de24a1ad331 /src/sys/signal.rs
parent3d44d276e768f47cefe301e3affbefd315dc1327 (diff)
downloadnix-b207aaee4ca5721314d03172bbf188e63ec21cc3.zip
SigSet: Add the `repr(transparent)` attribute
This commit adds the `repr(transparent)` attribute to the `SigSet` struct, to make sure that its representation is exactly like the `sigset_t` struct from C, in all cases. Signed-off-by: German Maglione <gmaglione@redhat.com>
Diffstat (limited to 'src/sys/signal.rs')
-rw-r--r--src/sys/signal.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index 4ce09308..4a468b62 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -465,6 +465,9 @@ use std::iter::FromIterator;
use std::iter::IntoIterator;
/// Specifies a set of [`Signal`]s that may be blocked, waited for, etc.
+// We are using `transparent` here to be super sure that `SigSet`
+// is represented exactly like the `sigset_t` struct from C.
+#[repr(transparent)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct SigSet {
sigset: libc::sigset_t