| 1 |
//! rustix's `init` function. |
| 2 |
//! |
| 3 |
//! # Safety |
| 4 |
//! |
| 5 |
//! When "use-explicitly-provided-auxv" is enabled, the `init` function must be |
| 6 |
//! called before any other function in this module. It is unsafe because it |
| 7 |
//! operates on raw pointers. |
| 8 |
#![allow(unsafe_code)] |
| 9 |
|
| 10 |
use crate::backend; |
| 11 |
|
| 12 |
/// Initialize process-wide state. |
| 13 |
/// |
| 14 |
/// # Safety |
| 15 |
/// |
| 16 |
/// This must be passed a pointer to the original environment variable block |
| 17 |
/// set up by the OS at process startup, and it must be called before any |
| 18 |
/// other rustix functions are called. |
| 19 |
#[inline] |
| 20 |
#[doc(hidden)] |
| 21 |
pub unsafe fn init(envp: *mut *mut u8) { |
| 22 |
backend::param::auxv::init(envp) |
| 23 |
} |