Skip to main content

posix_oflags_to_strat9

Function posix_oflags_to_strat9 

Source
pub fn posix_oflags_to_strat9(posix: u32) -> OpenFlags
Expand description

Translate POSIX O_* flags to Strat9 ABI OpenFlags.

This function is used by POSIX compatibility layers (relibc, musl-compat) to convert standard Linux/POSIX open flags to the Strat9 native format.

§Example

let strat9_flags = posix_oflags_to_strat9(libc::O_RDONLY | libc::O_CREAT);
assert!(strat9_flags.contains(OpenFlags::READ));
assert!(strat9_flags.contains(OpenFlags::CREATE));