os
Operating System Interface
Functions
| Function | Description |
|---|---|
os_getenv | Get environment variable value. Scans /proc/self/environ for name=value pairs. |
os_getcwd | Get current working directory. |
os_chdir | Change current directory. |
os_getpid | Get current process ID. |
os_getppid | Get parent process ID. |
os_getuid | Get user ID. |
os_exit | Exit the process. |
os_fork | Fork the current process. |
os_exec | Execute a program (replaces current process image). |
os_wait | Wait for child process. |
os_kill | Send signal to process. |
os_sleep_ms | Sleep for given milliseconds. |
os_hostname | Get hostname. |
os_uname | Get system info (uname). |
Details
os_getenv
fn os_getenv(name: &i8, name_len: i64, buf: &i8, max: i64) -> i64Get environment variable value. Scans /proc/self/environ for name=value pairs.
os_getcwd
fn os_getcwd(buf: &i8, max: i64) -> i64Get current working directory.
os_chdir
fn os_chdir(path: &i8) -> i64Change current directory.
os_getpid
fn os_getpid() -> i64Get current process ID.
os_getppid
fn os_getppid() -> i64Get parent process ID.
os_getuid
fn os_getuid() -> i64Get user ID.
os_exit
fn os_exit(code: i64) -> i64Exit the process.
os_fork
fn os_fork() -> i64Fork the current process.
os_exec
fn os_exec(path: &i8, argv: &i64, envp: &i64) -> i64Execute a program (replaces current process image).
os_wait
fn os_wait(status_ptr: &i64) -> i64Wait for child process.
os_kill
fn os_kill(pid: i64, sig: i64) -> i64Send signal to process.
os_sleep_ms
fn os_sleep_ms(ms: i64) -> i64Sleep for given milliseconds.
os_hostname
fn os_hostname(buf: &i8, max: i64) -> i64Get hostname.
os_uname
fn os_uname(buf: &i8, max: i64) -> i64Get system info (uname).