summaryrefslogtreecommitdiff
path: root/rts/RtsSymbols.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/RtsSymbols.c')
-rw-r--r--rts/RtsSymbols.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index 7d7b8422c2..f76573e3ae 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -34,10 +34,17 @@
#include <elf.h> /* _DYNAMIC */
#endif
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h> /* environ */
+#endif
+
+#if !HAVE_DECL_ENVIRON
/* We must provide a prototype for environ since depending upon the libc
- * version it may or may not be provided by unistd.h. See #20577.
+ * version it may or may not be provided by unistd.h. See #20577 and #20861.
*/
extern char **environ;
+#endif
+
/* -----------------------------------------------------------------------------
* Symbols to be inserted into the RTS symbol table.