Skip to main content

SignalInfo

Struct SignalInfo 

Source
pub struct SignalInfo { /* private fields */ }
Expand description

Payload siginfo_t opaque associé à un syscall d’envoi de signal (pidfd_send_signal, rt_sigqueueinfo).

Représentation interne. Buffer brut de 128 octets, alignement 4, layout siginfo_t Linux côté x86_64 et aarch64 (identique sur ces deux architectures). Opaque côté API publique : on n’expose pas les champs individuels — le kernel valide ses propres invariants (notamment si_code) et un usage à champs ouverts serait un footgun de sécurité (cf. la note dans kernel/signal.c::do_rt_sigqueueinfo : « Not even root can pretend to send signals from the kernel »).

Construction. Pas de champ public. Seuls des constructeurs Air disciplinés (Self::new_queue) fabriquent des SignalInfo dont le kernel accepte le si_code. Cela ferme la dette d’ambiguïté avec SignalQueueInfo consignée à la PR pidfd_* (le type SignalQueueInfo a été retiré ; le concept est porté par Self::new_queue).

Implementations§

Source§

impl SignalInfo

Source

pub fn new_queue(value: SignalValue) -> Self

Construit un SignalInfo pour le pattern SI_QUEUE (rt_sigqueueinfo, équivalent userspace de sigqueue(3)).

Le si_code est fixé à SI_QUEUE (-1), seule valeur que le kernel accepte pour un envoi cross-process userspace (cf. do_rt_sigqueueinfo dans kernel/signal.c). Les champs si_signo, si_pid, si_uid sont laissés à zéro — le kernel les écrase avec les valeurs correctes au moment de la délivrance (sig du syscall, pid/uid de l’appelant).

Le champ si_value (offset 24, 8 octets) reçoit la valeur fournie : variante Integer(i32) écrit les 4 premiers octets, variante Pointer(u64) écrit les 8 octets.

Source

pub const fn zeroed() -> Self

siginfo_t zéro-initialisé — tampon de sortie destiné à être rempli par le kernel (ex. IORING_OP_WAITID, où le kernel y écrit l’état du processus). Lire ensuite via Self::as_bytes.

Trait Implementations§

Source§

impl Debug for SignalInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.