summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile2
-rw-r--r--posix/environ.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/posix/Makefile b/posix/Makefile
index b6851b99f3..ae4c1a5fb0 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -43,7 +43,7 @@ routines := \
glob fnmatch \
confstr \
getopt getopt1
-aux := init-posix
+aux := init-posix environ
tests := tstgetopt testfnm
others := getconf
install-bin := getconf
diff --git a/posix/environ.c b/posix/environ.c
new file mode 100644
index 0000000000..3eee48e7ea
--- /dev/null
+++ b/posix/environ.c
@@ -0,0 +1,8 @@
+/* This file just defines the `__environ' variable (and alias `environ'). */
+
+#include <unistd.h>
+#include <stddef.h>
+
+/* This must be initialized; we cannot have a weak alias into bss. */
+char **__environ = NULL;
+weak_alias (__environ, environ)