Function openat2::openat2[][src]

pub fn openat2<P: AsRef<Path>>(
    dirfd: Option<RawFd>,
    path: P,
    how: &OpenHow
) -> Result<RawFd>

Call the openat2() syscall to open the specified path.

This function converts the given path to a CString and calls openat2_cstr().

See openat2(2) for general information on the openat2() syscall.

Notes:

  • If dirfd is None, it will be translated to AT_FDCWD when calling the syscall.
  • The returned file descriptor will NOT have its close-on-exec flag set by default! It is recommended to include O_CLOEXEC in the flags specified using how to ensure this is set.