aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/getloadavg.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/getloadavg.c b/src/getloadavg.c
index 49612bf2b57..8dba8a181f3 100644
--- a/src/getloadavg.c
+++ b/src/getloadavg.c
@@ -436,7 +436,7 @@ static kvm_t *kd;
436 436
437/* Put the 1 minute, 5 minute and 15 minute load averages 437/* Put the 1 minute, 5 minute and 15 minute load averages
438 into the first NELEM elements of LOADAVG. 438 into the first NELEM elements of LOADAVG.
439 Return the number written (never more than 3), 439 Return the number written (never more than 3, but may be less than NELEM),
440 or -1 if an error occurred. */ 440 or -1 if an error occurred. */
441 441
442int 442int
@@ -494,12 +494,8 @@ getloadavg (loadavg, nelem)
494 struct processor_set_basic_info info; 494 struct processor_set_basic_info info;
495 unsigned info_count; 495 unsigned info_count;
496 496
497 if (nelem > 1) 497 /* We only know how to get the 1-minute average for this system,
498 { 498 so even if the caller asks for more than 1, we only return 1. */
499 /* We only know how to get the 1-minute average for this system. */
500 errno = EINVAL;
501 return -1;
502 }
503 499
504 if (!getloadavg_initialized) 500 if (!getloadavg_initialized)
505 { 501 {