Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions images/instrumentation/injector/src/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ fn initEnviron() callconv(.C) void {

fn updateStdOsEnviron() !void {
// Dynamic libs do not get the std.os.environ initialized, see https://github.com/ziglang/zig/issues/4524, so we
// back fill it. This logic is based on parsing of envp on zig's start. We re-bind the environment every time, as
// we cannot ensure it did not change since the previous invocation. libc implementations can re-allocate the
// environment (http://github.com/lattera/glibc/blob/master/stdlib/setenv.c;
// https://git.musl-libc.org/cgit/musl/tree/src/env/setenv.c) if the backing memory location is outgrown by apps
// modifying the environment via setenv or putenv.
// back fill it. This logic is based on parsing of envp on zig's start.
if (environ_ptr) |environment_ptr| {
const env_array = environment_ptr.*;
var env_var_count: usize = 0;
Expand Down