Function lrs::syscall::dup3

Duplicates a file descriptor by replacing another one.

Syntax

fn dup3(oldfd: i32, newfd: i32, flags: i32) -> i32

Arguments

NameDescription
oldfd

The file descriptor to duplicate.

newfd

The file descriptor to replace.

flags

Flags to use when creating the new file descriptor.

Remarks

Unless lrs was compiled with the no-auto-cloexec flag, this function automatically adds the O_CLOEXEC flag.

See also