]> Savannah Git Hosting - gnulib.git/commitdiff
sysctl.h: avoid including on glibc
authorPádraig Brady <P@draigBrady.com>
Sun, 2 Feb 2020 15:24:02 +0000 (15:24 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 2 Feb 2020 16:52:48 +0000 (16:52 +0000)
* lib/nproc.c: Avoid including deprecated and unneeded header on GLIBC.
glibc deprecated this header since v2.30.
* lib/physmem.c: Likewise.

ChangeLog
lib/nproc.c
lib/physmem.c

index 55cd67f6fb2fa24e33eb647322d7c4598e0f4074..1e5f94d3c89b931f1184eff22795fb1e4d3df7b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-02  Pádraig Brady  <P@draigBrady.com>
+
+       sysctl.h: avoid including on glibc
+       * lib/nproc.c: Avoid including deprecated and unneeded header on GLIBC.
+       * lib/physmem.c: Likewise.
+
 2020-02-02  Bruno Haible  <bruno@clisp.org>
 
        list, set, oset, map, omap: Avoid imperative voice in documentation.
index da510214a752a150d37578b0327ca2e033122554..4fc8747e1b0462620b459a10a4c229608a89034b 100644 (file)
@@ -46,7 +46,7 @@
 # include <sys/param.h>
 #endif
 
-#if HAVE_SYS_SYSCTL_H
+#if HAVE_SYS_SYSCTL_H && ! defined __GLIBC__
 # include <sys/sysctl.h>
 #endif
 
@@ -306,7 +306,7 @@ num_processors_ignoring_omp (enum nproc_query query)
   /* Finally, as fallback, use the APIs that don't distinguish between
      NPROC_CURRENT and NPROC_ALL.  */
 
-#if HAVE_SYSCTL && defined HW_NCPU
+#if HAVE_SYSCTL && ! defined __GLIBC__ && defined HW_NCPU
   { /* This works on Mac OS X, FreeBSD, NetBSD, OpenBSD.  */
     int nprocs;
     size_t len = sizeof (nprocs);
index b8ef16e0050330101ab92b26457f3c2536a2edd9..76813a43d7341a0d6ba2792feffb611271131ffd 100644 (file)
@@ -50,7 +50,7 @@
 # include <sys/param.h>
 #endif
 
-#if HAVE_SYS_SYSCTL_H
+#if HAVE_SYS_SYSCTL_H && ! defined __GLIBC__
 # include <sys/sysctl.h>
 #endif
 
@@ -149,7 +149,7 @@ physmem_total (void)
   }
 #endif
 
-#if HAVE_SYSCTL && defined HW_PHYSMEM
+#if HAVE_SYSCTL && ! defined __GLIBC__ && defined HW_PHYSMEM
   { /* This works on *bsd and darwin.  */
     unsigned int physmem;
     size_t len = sizeof physmem;
@@ -263,7 +263,7 @@ physmem_available (void)
   }
 #endif
 
-#if HAVE_SYSCTL && defined HW_USERMEM
+#if HAVE_SYSCTL && ! defined __GLIBC__ && defined HW_USERMEM
   { /* This works on *bsd and darwin.  */
     unsigned int usermem;
     size_t len = sizeof usermem;