pub fn new(sigev_notify: SigevNotify) -> SigEvent {
            let mut sev = unsafe { mem::zeroed::<libc::sigevent>()};
            sev.sigev_notify = match sigev_notify {
                SigevNotify::SigevNone => libc::SIGEV_NONE,
                SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL,
                #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
                SigevNotify::SigevKevent{..} => libc::SIGEV_KEVENT,
                #[cfg(target_os = "freebsd")]
                SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
                #[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "mips")))]
                SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
                #[cfg(any(all(target_os = "linux", target_env = "musl"), target_arch = "mips"))]
                SigevNotify::SigevThreadId{..} => 4  // No SIGEV_THREAD_ID defined
            };
            sev.sigev_signo = match sigev_notify {
                SigevNotify::SigevSignal{ signal, .. } => signal as libc::c_int,
                #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
                SigevNotify::SigevKevent{ kq, ..} => kq,
                #[cfg(any(target_os = "linux", target_os = "freebsd"))]
                SigevNotify::SigevThreadId{ signal, .. } => signal as libc::c_int,
                _ => 0
            };
            sev.sigev_value.sival_ptr = match sigev_notify {
                SigevNotify::SigevNone => ptr::null_mut::<libc::c_void>(),
                SigevNotify::SigevSignal{ si_value, .. } => si_value as *mut libc::c_void,
                #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
                SigevNotify::SigevKevent{ udata, .. } => udata as *mut libc::c_void,
                #[cfg(any(target_os = "freebsd", target_os = "linux"))]
                SigevNotify::SigevThreadId{ si_value, .. } => si_value as *mut libc::c_void,
            };
            SigEvent::set_tid(&mut sev, &sigev_notify);
            SigEvent{sigevent: sev}
        }
/// **Note:** this constructor does not allow the user to set the
/// `sigev_notify_kevent_flags` field.  That's considered ok because on FreeBSD
/// at least those flags don't do anything useful.  That field is part of a
/// union that shares space with the more genuinely useful fields.
///
/// **Note:** This constructor also doesn't allow the caller to set the
/// `sigev_notify_function` or `sigev_notify_attributes` fields, which are
/// required for `SIGEV_THREAD`.  That's considered ok because on no operating
/// system is `SIGEV_THREAD` the most efficient way to deliver AIO
/// notification.  FreeBSD and DragonFly BSD programs should prefer `SIGEV_KEVENT`.
/// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or
/// `SIGEV_SIGNAL`.  That field is part of a union that shares space with the
/// more genuinely useful `sigev_notify_thread_id`
this constructor does not allow the user to set the
`sigev_notify_kevent_flags` field.  That's considered ok because on FreeBSD
at least those flags don't do anything useful.  That field is part of a
union that shares space with the more genuinely useful fields.


this constructor does not allow the user to set the ` sigev_notify_kevent_flags ` field . That ' s considered ok because on FreeBSD at least those flags don ' t do anything useful . That field is part of a union that shares space with the more genuinely useful fields .
pub fn new(sigev_notify: SigevNotify) -> SigEvent {
            let mut sev = unsafe { mem::zeroed::<libc::sigevent>()};
            sev.sigev_notify = match sigev_notify {
                SigevNotify::SigevNone => libc::SIGEV_NONE,
                SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL,
                #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
                SigevNotify::SigevKevent{..} => libc::SIGEV_KEVENT,
                #[cfg(target_os = "freebsd")]
                SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
                #[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "mips")))]
                SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
                #[cfg(any(all(target_os = "linux", target_env = "musl"), target_arch = "mips"))]
                SigevNotify::SigevThreadId{..} => 4  // No SIGEV_THREAD_ID defined
            };
            sev.sigev_signo = match sigev_notify {
                SigevNotify::SigevSignal{ signal, .. } => signal as libc::c_int,
                #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
                SigevNotify::SigevKevent{ kq, ..} => kq,
                #[cfg(any(target_os = "linux", target_os = "freebsd"))]
                SigevNotify::SigevThreadId{ signal, .. } => signal as libc::c_int,
                _ => 0
            };
            sev.sigev_value.sival_ptr = match sigev_notify {
                SigevNotify::SigevNone => ptr::null_mut::<libc::c_void>(),
                SigevNotify::SigevSignal{ si_value, .. } => si_value as *mut libc::c_void,
                #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
                SigevNotify::SigevKevent{ udata, .. } => udata as *mut libc::c_void,
                #[cfg(any(target_os = "freebsd", target_os = "linux"))]
                SigevNotify::SigevThreadId{ si_value, .. } => si_value as *mut libc::c_void,
            };
            SigEvent::set_tid(&mut sev, &sigev_notify);
            SigEvent{sigevent: sev}
        }
pub fn new ( sigev_notify : SigevNotify ) -> SigEvent { let mut sev = unsafe { mem :: zeroed :: < libc :: sigevent > ( ) } ; sev . sigev_notify = match sigev_notify { SigevNotify :: SigevNone => libc :: SIGEV_NONE , SigevNotify :: SigevSignal { .. } => libc :: SIGEV_SIGNAL , # [ cfg ( any ( target_os " " target_os " " ) ) ] SigevNotify :: SigevKevent { .. } => libc :: SIGEV_KEVENT , # [ cfg ( target_os " " ) ] SigevNotify :: SigevThreadId { .. } => libc :: SIGEV_THREAD_ID , # [ cfg ( all ( target_os " " target_env " " not ( target_arch " " ) ) ) ] SigevNotify :: SigevThreadId { .. } => libc :: SIGEV_THREAD_ID , # [ cfg ( any ( all ( target_os " " target_env " " ) target_arch " " ) ) ] SigevNotify :: SigevThreadId { .. } => 4 // No SIGEV_THREAD_ID defined } ; sev . sigev_signo = match sigev_notify { SigevNotify :: SigevSignal { signal , .. } => signal as libc :: c_int , # [ cfg ( any ( target_os " " target_os " " ) ) ] SigevNotify :: SigevKevent { kq , .. } => kq , # [ cfg ( any ( target_os " " target_os " " ) ) ] SigevNotify :: SigevThreadId { signal , .. } => signal as libc :: c_int , _ => 0 } ; sev . sigev_value . sival_ptr = match sigev_notify { SigevNotify :: SigevNone => ptr :: null_mut :: < libc :: c_void > ( ) , SigevNotify :: SigevSignal { si_value , .. } => si_value as * mut libc :: c_void , # [ cfg ( any ( target_os " " target_os " " ) ) ] SigevNotify :: SigevKevent { udata , .. } => udata as * mut libc :: c_void , # [ cfg ( any ( target_os " " target_os " " ) ) ] SigevNotify :: SigevThreadId { si_value , .. } => si_value as * mut libc :: c_void , } ; SigEvent :: set_tid ( & mut sev , & sigev_notify ) ; SigEvent { sigevent : sev } }
Note:** this constructor does not allow the user to set the
`sigev_notify_kevent_flags` field.
Note : ** this constructor does not allow the user to set the ` sigev_notify_kevent_flags ` field .
sigev_notify
SigevNotify
sigev_notify
SigevNotify