pub fn new(flag: i32) -> result::Result<EventFd, io::Error> {
        // This is safe because eventfd merely allocated an eventfd for
        // our process and we handle the error case.
        let ret = unsafe { eventfd(0, flag) };
        if ret < 0 {
            Err(io::Error::last_os_error())
        } else {
            // This is safe because we checked ret for success and know
            // the kernel gave us an fd that we own.
            Ok(EventFd {
                eventfd: unsafe { File::from_raw_fd(ret) },
            })
        }
    }
/// Creates a new blocking EventFd with an initial value.
///
/// `flag`: The initial value. Refer to Linux eventfd(2).
Creates a new blocking EventFd with an initial value.
`flag`: The initial value.
Creates a new blocking EventFd with an initial value . ` flag ` : The initial value .
pub fn new(flag: i32) -> result::Result<EventFd, io::Error> {
        // This is safe because eventfd merely allocated an eventfd for
        // our process and we handle the error case.
        let ret = unsafe { eventfd(0, flag) };
        if ret < 0 {
            Err(io::Error::last_os_error())
        } else {
            // This is safe because we checked ret for success and know
            // the kernel gave us an fd that we own.
            Ok(EventFd {
                eventfd: unsafe { File::from_raw_fd(ret) },
            })
        }
    }
pub fn new ( flag : i32 ) -> result :: Result < EventFd , io :: Error > { // This is safe because eventfd merely allocated an eventfd for // our process and we handle the error case. let ret = unsafe { eventfd ( 0 , flag ) } ; if ret < 0 { Err ( io :: Error :: last_os_error ( ) ) } else { // This is safe because we checked ret for success and know // the kernel gave us an fd that we own. Ok ( EventFd { eventfd : unsafe { File :: from_raw_fd ( ret ) } , } ) } }
Creates a new blocking EventFd with an initial value.
Creates a new blocking EventFd with an initial value .
flag
i32
flag
i32