diff options
Diffstat (limited to 'libphobos/libdruntime/core/sys/posix/unistd.d')
-rw-r--r-- | libphobos/libdruntime/core/sys/posix/unistd.d | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libphobos/libdruntime/core/sys/posix/unistd.d b/libphobos/libdruntime/core/sys/posix/unistd.d index a691884cb2e..d996556fca0 100644 --- a/libphobos/libdruntime/core/sys/posix/unistd.d +++ b/libphobos/libdruntime/core/sys/posix/unistd.d @@ -2722,3 +2722,51 @@ else version (CRuntime_UClibc) int truncate(const scope char*, off_t); } } + +// Non-standard definition to access user process environment +version (CRuntime_Glibc) +{ + extern __gshared const char** environ; +} +else version (Darwin) +{ + extern (D) @property const(char**) environ()() + { + pragma (inline, true); + import core.sys.darwin.crt_externs : _NSGetEnviron; + return *_NSGetEnviron(); + } +} +else version (FreeBSD) +{ + extern __gshared const char** environ; +} +else version (NetBSD) +{ + extern __gshared const char** environ; +} +else version (OpenBSD) +{ + extern __gshared const char** environ; +} +else version (DragonFlyBSD) +{ + extern __gshared const char** environ; +} +else version (CRuntime_Bionic) +{ + extern __gshared const char** environ; +} +else version (CRuntime_Musl) +{ + extern __gshared const char** environ; +} +else version (Solaris) +{ + extern __gshared const char** environ; +} +else version (CRuntime_UClibc) +{ + extern __gshared const char** __environ; + alias environ = __environ; +} |