pub fn sys_dup2(&self, fd1: FileDesc, fd2: FileDesc) -> SysResult {
        info!("dup2: from {:?} to {:?}", fd1, fd2);
        let proc = self.linux_process();
        // close fd2 first if it is opened
        let _ = proc.close_file(fd2);
        let file_like = proc.get_file_like(fd1)?.dup();
        let fd2 = proc.add_file_at(fd2, file_like)?;
        Ok(fd2.into())
    }
/// create a copy of the file descriptor oldfd.
create a copy of the file descriptor oldfd.
create a copy of the file descriptor oldfd .
pub fn sys_dup2(&self, fd1: FileDesc, fd2: FileDesc) -> SysResult {
        info!("dup2: from {:?} to {:?}", fd1, fd2);
        let proc = self.linux_process();
        // close fd2 first if it is opened
        let _ = proc.close_file(fd2);
        let file_like = proc.get_file_like(fd1)?.dup();
        let fd2 = proc.add_file_at(fd2, file_like)?;
        Ok(fd2.into())
    }
pub fn sys_dup2 ( & self , fd1 : FileDesc , fd2 : FileDesc ) -> SysResult { info ! ( " " fd1 fd2 ) ; let proc = self . linux_process ( ) ; // close fd2 first if it is opened let _ = proc . close_file ( fd2 ) ; let file_like = proc . get_file_like ( fd1 ) ? . dup ( ) ; let fd2 = proc . add_file_at ( fd2 , file_like ) ? ; Ok ( fd2 . into ( ) ) }
create a copy of the file descriptor oldfd.
create a copy of the file descriptor oldfd .
&self
fd1
FileDesc
fd2
FileDesc
&self
fd1
FileDesc
fd2
FileDesc