summaryrefslogtreecommitdiff
path: root/lib/getloadavg.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-06-29 17:31:04 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-06-29 17:32:35 -0700
commit35e9dcab5141bf9cae67abe740933fe627ecc371 (patch)
tree2813d1f6340df34a97695874e5546e4b2454d555 /lib/getloadavg.c
parent2e2811865f0adb6658a87d3581a2dc3a9022f451 (diff)
downloademacs-35e9dcab5141bf9cae67abe740933fe627ecc371.tar.gz
Update from Gnulib
This incorporates: 2018-06-29 regex: glibc does not use intprops.h 2018-06-28 regex: port to recently proposed glibc regex merge 2018-06-25 Continue to use spaces for indentation, not tabs 2018-06-25 manywarnings: Don't enable -Wjump-misses-init by default 2018-06-25 acl-internal.h: remove _GL_ATTRIBUTE_CONST on void function 2018-06-24 manywarnings: accommodate GCC 9: remove -Wchkp and -Wabi 2018-06-24 maint: clarify comments about sticky EOF 2018-06-24 af_alg: avoid hangs when reading from streams 2018-06-17 crypto: use byteswap 2018-06-17 getloadavg: Return 0 on MS-Windows without Cygwi 2018-06-17 getloadavg: Allow building on MS-Windows without Cygwin * build-aux/config.guess, build-aux/config.sub, doc/misc/texinfo.tex: * lib/acl-internal.c, lib/acl-internal.h, lib/get-permissions.c: * lib/getloadavg.c, lib/gettimeofday.c, lib/md5.c, lib/pselect.c: * lib/set-permissions.c, lib/sha1.c, lib/sha256.c, lib/sha512.c: * lib/time.in.h, m4/getloadavg.m4, m4/gnulib-common.m4: * m4/manywarnings.m4, m4/pthread_sigmask.m4, m4/vararrays.m4: Copy from Gnulib.
Diffstat (limited to 'lib/getloadavg.c')
-rw-r--r--lib/getloadavg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 702338fb9e9..435d10a6b10 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -68,7 +68,7 @@
UMAX
UMAX4_3
VMS
- WINDOWS32 No-op for Windows95/NT.
+ _WIN32 Native Windows (possibly also defined on Cygwin)
__linux__ Linux: assumes /proc file system mounted.
Support from Michael K. Johnson.
__CYGWIN__ Cygwin emulates linux /proc/loadavg.
@@ -97,6 +97,10 @@
# include "intprops.h"
+# if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS32
+# endif
+
# if !defined (BSD) && defined (ultrix)
/* Ultrix behaves like BSD on Vaxen. */
# define BSD
@@ -324,7 +328,9 @@
# define LDAV_SYMBOL "avenrun"
# endif
-# include <unistd.h>
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* LOAD_AVE_TYPE should only get defined if we're going to use the
nlist method. */