Function lrs::syscall::openat

Opens a file relative to a file descriptor.

Syntax

fn openat(dir: i32, path: &CStr, flags: i32, mode: u16) -> i32

Arguments

NameDescription
dir

The file descriptor relative to which relative paths are interpreted.

path

The path of the file.

flags

The flags used to open the file.

mode

The mode used to create new files.

Return value

Rteruns an open file descriptor or an error value.

Remarks

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

See also