summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-15 18:38:18 -0400
committerPaul Smith <psmith@gnu.org>2022-10-16 16:19:42 -0400
commit72ee43c4732bb52c492cb4dd754912f6a943ae67 (patch)
treece4dffa2c810d754b54216c72ca8b682c1c53cb4 /src/job.c
parente5e538fb7a9cb6a42dae6aa1ad9f36a3dc769ad9 (diff)
downloadmake-git-72ee43c4732bb52c492cb4dd754912f6a943ae67.tar.gz
* src/job.c: [SV 63185] Include sys/loadavg.h if needed.
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/job.c b/src/job.c
index 19f27977..a47824a7 100644
--- a/src/job.c
+++ b/src/job.c
@@ -204,6 +204,15 @@ int getgid ();
# endif
#endif
+#if HAVE_SYS_LOADAVG_H
+# include <sys/time.h>
+# include <sys/loadavg.h>
+#endif
+
+#ifndef HAVE_DECL_GETLOADAVG
+int getloadavg (double loadavg[], int nelem);
+#endif
+
/* Different systems have different requirements for pid_t.
Plus we have to support gettext string translation... Argh. */
static const char *
@@ -220,10 +229,6 @@ pid2str (pid_t pid)
return pidstring;
}
-#ifndef HAVE_DECL_GETLOADAVG
-int getloadavg (double loadavg[], int nelem);
-#endif
-
static void free_child (struct child *);
static void start_job_command (struct child *child);
static int load_too_high (void);