Trait method lrs::fd::FDContainer::duplicate_as

Duplicates the file descriptor, replacing an existing one.

Syntax

fn duplicate_as(&self, new: i32) -> Result<Self, Errno>

Arguments

NameDescription
new

The file descriptor to replace.

Remarks

The new argument can refer to an open file descriptor but does not have to. In this case, new will be atomically closed and replaced by a duplicate of this file descriptor.

See also