GNU libc implements getloadavg(3) on Linux by parsing /proc/loadavg file. When /proc is not mounted, it always fails with ENOENT. * tests/test-getloadavg.c (main): Treat ENOENT return code from getloadavg(3) the same way as ENOSYS and ENOTSUP. --- ChangeLog | 8 ++++++++ tests/test-getloadavg.c | 2 +- 2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 82c8468..0569fe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-04-24 Dmitry V. Levin <l...@altlinux.org> + + getloadavg test: skip the test on GNU/Linux without /proc mounted + GNU libc implements getloadavg(3) on Linux by parsing /proc/loadavg + file. When /proc is not mounted, it always fails with ENOENT. + * tests/test-getloadavg.c (main): Treat ENOENT return code from + getloadavg(3) the same way as ENOSYS and ENOTSUP. + 2011-04-22 Paul Eggert <egg...@cs.ucla.edu> * modules/strnlen (Depends-on): Remove memchr. diff --git a/tests/test-getloadavg.c b/tests/test-getloadavg.c index f039776..fc5d59f 100644 --- a/tests/test-getloadavg.c +++ b/tests/test-getloadavg.c @@ -60,7 +60,7 @@ main (int argc, char **argv) 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; -- ldv