/* Test of getting load average.
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
if (printit)
printf ("%d-minute: %f ", minutes, avg);
+ else
+ {
+ /* Plausibility checks. */
+ if (avg < 0.01)
+ printf ("suspiciously low %d-minute average: %f\n", minutes, avg);
+ if (avg > 1000000)
+ printf ("suspiciously high %d-minute average: %f\n", minutes, avg);
+ }
if (avg < 0 || avg != avg)
exit (minutes);
}
int loads = getloadavg (avg, 3);
if (loads == -1)
{
- if (! (errno == ENOSYS || errno == ENOTSUP))
+ if (! (errno == ENOSYS || errno == ENOTSUP || errno == ENOENT))
return 1;
perror ("Skipping test; load average not supported");
return 77;