Skip to main content

openat

Function openat 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn openat( fd: c_int, path: *const c_char, oflag: c_int, ... ) -> c_int
Expand description

See https://pubs.opengroup.org/onlinepubs/9799919799/functions/openat.html.

Establishes a connection between a file and a file descriptor. Equivalent to open() except in the case where path specifies a relative path (the file to be opened is determined relative to the directory associated with the file descriptor fd instead of the current working directory).

Upon success, opens the file and returns a non-negative integer representing the file descriptor. Upon failure, returns -1 and sets errno to indicate the error. If -1 is returned, no files shall be created or modified.