xref: /third_party/rust/crates/rustix/src/param/init.rs (revision b8a62b91)
1//! rustix's `init` function.
2//!
3//! # Safety
4//!
5//! On mustang, or on any non-glibc non-musl platform, the `init` function must
6//! be called before any other function in this module. It is unsafe because it
7//! operates on raw pointers.
8#![allow(unsafe_code)]
9
10use 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)]
21pub unsafe fn init(envp: *mut *mut u8) {
22    backend::param::auxv::init(envp)
23}
24