bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] sysctl.h: avoid including on glibc
@ 2020-02-02 15:29 Pádraig Brady
  2020-02-02 16:40 ` Bruno Haible
  0 siblings, 1 reply; 2+ messages in thread
From: Pádraig Brady @ 2020-02-02 15:29 UTC (permalink / raw)
  To: bug-gnulib

* lib/nproc.c: Avoid including deprecated and unneeded header on GLIBC.
* lib/physmem.c: Likewise.
---
 ChangeLog     | 6 ++++++
 lib/nproc.c   | 2 +-
 lib/physmem.c | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 55cd67f6f..1e5f94d3c 100644
--- 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.
diff --git a/lib/nproc.c b/lib/nproc.c
index da510214a..ee446bc44 100644
--- a/lib/nproc.c
+++ b/lib/nproc.c
@@ -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
 
diff --git a/lib/physmem.c b/lib/physmem.c
index b8ef16e00..38790d980 100644
--- a/lib/physmem.c
+++ b/lib/physmem.c
@@ -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
 
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sysctl.h: avoid including on glibc
  2020-02-02 15:29 [PATCH] sysctl.h: avoid including on glibc Pádraig Brady
@ 2020-02-02 16:40 ` Bruno Haible
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Haible @ 2020-02-02 16:40 UTC (permalink / raw)
  To: bug-gnulib

Pádraig Brady wrote:
> +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.

Looks good. The sysctl() invocations below are not enabled on glibc systems,
because glibc does not define HW_NCPU, HW_PHYSMEM, HW_USERMEM.

Bruno



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-02 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02 15:29 [PATCH] sysctl.h: avoid including on glibc Pádraig Brady
2020-02-02 16:40 ` Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).