* src/job.c: [SV 63185] Include sys/loadavg.h if needed.

This commit is contained in:
Paul Smith 2022-10-15 18:38:18 -04:00
parent e5e538fb7a
commit 72ee43c473

View File

@ -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);