Function rustix::io::dup2_with

pub fn dup2_with<Fd: AsFd>(fd: &Fd, new: &OwnedFd, flags: DupFlags) -> io::Result<()>
Documentation

dup3(fd, new, flags)—Creates a new OwnedFd instance that shares the same underlying file description as the existing OwnedFd instance, closing new and reusing its file descriptor, with flags.

dup2_with is the same as dup2 but adds an additional flags operand.

References