mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Petr Vorel <petr.vorel@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Petr Vorel <petr.vorel@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Michal Kubecek <mkubecek@suse.cz>,
	musl@lists.openwall.com
Subject: [musl] [PATCH 1/1] linux/sysinfo.h: Add guarder for struct sysinfo
Date: Wed, 30 Sep 2020 23:46:36 +0200	[thread overview]
Message-ID: <20200930214636.186132-1-petr.vorel@gmail.com> (raw)

for all but glibc libc.

This fixes redefinition on MUSL which also defines struct sysinfo when
including <linux/netlink.h> (which includes <linux/sysinfo.h> via
<linux/kernel.h>) and <sys/sysinfo.h>.

glibc loads <linux/sysinfo.h> in <sys/sysinfo.h>.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 include/uapi/linux/sysinfo.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/sysinfo.h b/include/uapi/linux/sysinfo.h
index 435d5c23f0c0..c8ab18cd36b2 100644
--- a/include/uapi/linux/sysinfo.h
+++ b/include/uapi/linux/sysinfo.h
@@ -5,6 +5,8 @@
 #include <linux/types.h>
 
 #define SI_LOAD_SHIFT	16
+
+#if defined(__KERNEL__) || defined(__GLIBC__)
 struct sysinfo {
 	__kernel_long_t uptime;		/* Seconds since boot */
 	__kernel_ulong_t loads[3];	/* 1, 5, and 15 minute load averages */
@@ -21,5 +23,6 @@ struct sysinfo {
 	__u32 mem_unit;			/* Memory unit size in bytes */
 	char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)];	/* Padding: libc5 uses this.. */
 };
+#endif
 
 #endif /* _LINUX_SYSINFO_H */
-- 
2.27.0.rc0


             reply	other threads:[~2020-09-30 21:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 21:46 Petr Vorel [this message]
2020-09-30 23:42 ` Rich Felker
2020-10-01  5:47   ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200930214636.186132-1-petr.vorel@gmail.com \
    --to=petr.vorel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).