Skip to main content

open

Function open 

Source
pub fn open<T: AsRef<str>>(path: T, posix_flags: u32) -> Result<usize>
Expand description

Open a file at a specific path with POSIX flags.

This is a convenience wrapper that converts POSIX O_* flags to Strat9 ABI flags. For direct Strat9 ABI usage, prefer openat.

§Arguments

  • path - Path to the file to open
  • posix_flags - POSIX O_* flags (e.g., O_RDONLY, O_CREAT, O_WRONLY)

§Example

use strat9_syscall::{call, flag};
// Open a file read-only using POSIX flags
let fd = call::open("/etc/passwd", flag::O_RDONLY).unwrap();