view modules/getloadavg @ 14313:dd51e283d6cd

getloadavg: don't depend on c-strtod, cloexec, fcntl-safer See the thread rooted at <http://lists.gnu.org/archive/html/bug-gnulib/2011-02/msg00090.html>. * lib/getloadavg.c: Do not include c-strtod.h, cloexec.h, or fcntl--.h. Include <fcntl.h> only if (defined __linux__ || defined __CYGWIN__ || defined SUNOS_5 || (defined LOAD_AVE_TYPE && ! defined __VMS)); previously it was always included (via fcntl--.h). (getloadavg): Do not use c_strtod. Instead, approximate it by hand; this is good enough for load averages. Also, do not use set_cloexec_flag; instead, use the O_CLOEXEC and F_DUPFD_CLOEXEC flags directly if available and don't bother otherwise. (Packages that need the extra reliability should use the modules that define these flags on older platforms that lack them.) * modules/getloadavg (Depends-on): Remove c-strtod, cloexec, fcntl-safer.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 08 Feb 2011 12:23:29 -0800
parents 64b96a2d148c
children d937d219a168
line wrap: on
line source

Description:
Return the current system load averages.

Files:
lib/getloadavg.c
m4/getloadavg.m4

Depends-on:
extensions
intprops
stdbool
stdlib

configure.ac:
gl_GETLOADAVG([$gl_source_base])
gl_STDLIB_MODULE_INDICATOR([getloadavg])

Makefile.am:

Include:
<stdlib.h>

License:
GPL

Maintainer:
Jim Meyering