Skip to main content

libc/new/glibc/sysdeps/unix/linux/bits/
sigaction.rs

1//! Header: `sysdeps/unix/sysv/linux/bits/sigaction.h`
2
3use crate::prelude::*;
4
5#[repr(C)]
#[allow(deprecated)]
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
    pub sa_sigaction: crate::sighandler_t,
    pub sa_mask: crate::sigset_t,
    pub sa_flags: c_int,
    pub sa_restorer: Option<extern "C" fn()>,
}
#[automatically_derived]
#[doc(hidden)]
#[allow(deprecated)]
#[allow(unpredictable_function_pointer_comparisons)]
unsafe impl ::core::clone::TrivialClone for sigaction { }
#[automatically_derived]
#[allow(deprecated)]
#[allow(unpredictable_function_pointer_comparisons)]
impl ::core::clone::Clone for sigaction {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<crate::sighandler_t>;
        let _: ::core::clone::AssertParamIsClone<crate::sigset_t>;
        let _: ::core::clone::AssertParamIsClone<c_int>;
        let _: ::core::clone::AssertParamIsClone<Option<extern "C" fn()>>;
        *self
    }
}
#[automatically_derived]
#[allow(deprecated)]
#[allow(unpredictable_function_pointer_comparisons)]
impl ::core::marker::Copy for sigaction { }
#[automatically_derived]
#[allow(deprecated)]
#[allow(unpredictable_function_pointer_comparisons)]
impl ::core::fmt::Debug for sigaction {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f, "sigaction",
            "sa_sigaction", &self.sa_sigaction, "sa_mask", &self.sa_mask,
            "sa_flags", &self.sa_flags, "sa_restorer", &&self.sa_restorer)
    }
}s! {
6    // FIXME(1.0): This should not implement `PartialEq`
7    #[allow(unpredictable_function_pointer_comparisons)]
8    pub struct sigaction {
9        pub sa_sigaction: crate::sighandler_t,
10        pub sa_mask: crate::sigset_t,
11        pub sa_flags: c_int,
12        // This function should be unsafe everywhere but is currently only done on
13        // newer arches.
14        #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
15        pub sa_restorer: Option<unsafe extern "C" fn()>,
16        #[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
17        pub sa_restorer: Option<extern "C" fn()>,
18    }
19}
20
21pub const SA_NOCLDSTOP: c_int = 0x00000001;
22pub const SA_NOCLDWAIT: c_int = 0x00000002;
23pub const SA_SIGINFO: c_int = 0x00000004;
24pub const SA_ONSTACK: c_int = 0x08000000;
25pub const SA_RESTART: c_int = 0x10000000;
26pub const SA_NODEFER: c_int = 0x40000000;
27pub const SA_RESETHAND: c_int = u32_cast_int(0x80000000);
28
29pub const SIG_BLOCK: c_int = 0;
30pub const SIG_UNBLOCK: c_int = 1;
31pub const SIG_SETMASK: c_int = 2;