environ.c is referencing functions like getuid(), geteuid(), getgid()
and getegid(), but it does not include the header file that declares
them.
I also noticed that libgfortran is not consistent about checking that
unistd.h exists.
* runtime/pause.c: Test HAVE_UNISTD_H.
* runtime/environ.c: Include unistd.h.
* runtime/stop.c: Test HAVE_UNISTD_H.
Index: runtime/pause.c
===================================================================
--- runtime/pause.c (revision 198587)
+++ runtime/pause.c (working copy)
@@ -25,8 +25,12 @@
#include "libgfortran.h"
#include <string.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
static void
do_pause (void)
{
Index: runtime/environ.c
===================================================================
--- runtime/environ.c (revision 198587)
+++ runtime/environ.c (working copy)
@@ -28,7 +28,11 @@
#include <stdlib.h>
#include <ctype.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
/* Environment scanner. Examine the environment for controlling minor
* aspects of the program's execution. Our philosophy here that the
* environment should not prevent the program from running, so an
Index: runtime/stop.c
===================================================================
--- runtime/stop.c (revision 198587)
+++ runtime/stop.c (working copy)
@@ -26,8 +26,12 @@
#include "libgfortran.h"
#include <stdlib.h>
#include <string.h>
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
/* A numeric STOP statement. */
extern void stop_numeric (GFC_INTEGER_4)