From b207aaee4ca5721314d03172bbf188e63ec21cc3 Mon Sep 17 00:00:00 2001 From: German Maglione Date: Mon, 20 Jun 2022 11:57:04 +0200 Subject: 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 --- src/sys/signal.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sys/signal.rs') 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 -- cgit v1.2.3