pub fn try_clone(&self) -> result::Result<EventFd, io::Error> {
        // This is safe because we made this fd and properly check that it returns without error.
        let ret = unsafe { dup(self.as_raw_fd()) };
        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) },
            })
        }
    }
/// Clones this EventFd, internally creating a new file descriptor. The new EventFd will share
/// the same underlying count within the kernel.
Clones this EventFd, internally creating a new file descriptor. The new EventFd will share
the same underlying count within the kernel.
Clones this EventFd internally creating a new file descriptor . The new EventFd will share the same underlying count within the kernel .
pub fn try_clone(&self) -> result::Result<EventFd, io::Error> {
        // This is safe because we made this fd and properly check that it returns without error.
        let ret = unsafe { dup(self.as_raw_fd()) };
        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 try_clone ( & self ) -> result :: Result < EventFd , io :: Error > { // This is safe because we made this fd and properly check that it returns without error. let ret = unsafe { dup ( self . as_raw_fd ( ) ) } ; 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 ) } , } ) } }
Clones this EventFd, internally creating a new file descriptor.
Clones this EventFd internally creating a new file descriptor .
&self
&self