Skip to main content

tool_output_env_value

Function tool_output_env_value 

Source
pub fn tool_output_env_value(fd: c_int) -> Result<String>
Expand description

The value Hermit passes an in-guest Tool for its output socket fd (reverie_sabre::TOOL_OUTPUT_ENV, detcore_liteinst::DETLOG_FORWARD_ENV): <fd>:<st_dev>:<st_ino>, the identity in 16 hexadecimal digits each. Guest code can run before the Tool adopts the descriptor (an executable’s .preinit_array) and close it or put a socket of its own at that number; the Tool adopts it only if it is still this socket (tool_output_env_target), so its records never reach the guest’s socket. The fixed width keeps the value’s length, which a scrubbed environment block keeps, independent of the host.