This function is unavailable on WASI without libc due to the memory allocation requirement.
See also:
getWindowscreateMappub fn getPosix(environ: Environ, key: []const u8) ?[:0]const u8
pub fn getPosix(environ: Environ, key: []const u8) ?[:0]const u8 {
if (mem.findScalar(u8, key, '=') != null) return null;
for (environ.block.view().slice) |entry| {
var entry_i: usize = 0;
while (entry[entry_i] != 0) : (entry_i += 1) {
if (entry_i == key.len) break;
if (entry[entry_i] != key[entry_i]) break;
}
if ((entry_i != key.len) or (entry[entry_i] != '=')) continue;
return mem.sliceTo(entry + entry_i + 1, 0);
}
return null;
}