//! The process-environment boundary of the Rust kernel (INV-596).
//!
//! This is the one kernel module that reads `std::env` variables. Every other module calls these
//! delegates, so the boundary can be narrowed in one place; `check_parameter_boundary.py` rejects any
//! other ambient read. Writes (`set_var`, `remove_var`) stay explicit `unsafe` calls at their sites.
use std::ffi::{OsStr, OsString};
/// `std::env::var`: the value of `key`, if set and valid Unicode.
pub fn var<K: AsRef<OsStr>>(key: K) -> Result<String, std::env::VarError> {
std::env::var(key)
}
/// `std::env::var_os`: the raw value of `key`, if set.
pub fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString> {
std::env::var_os(key)
}
/// `std::env::vars`: every variable of the process environment.
pub fn vars() -> std::env::Vars {
std::env::vars()
}