public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] statx: fix compile errors with glibc<2.28
Date: Wed, 19 Sep 2018 12:48:13 +0800	[thread overview]
Message-ID: <20180919044813.22875-1-liwang@redhat.com> (raw)

glibc 2.28 has shipped with a wrapper for the statx() system call.
Currently the build is broken against it, because sys/stat.h suddenly
declares all the same types that lapi/stat.h does.  Fix it by taking
the sys/stat.h ones if glibc>=2.28.

  include/lapi/stat.h:26:8: error: redefinition of ‘struct statx_timestamp’
  include/lapi/stat.h:73:8: error: redefinition of ‘struct statx’
---
 include/lapi/stat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/lapi/stat.h b/include/lapi/stat.h
index 979e42d..7ba8618 100644
--- a/include/lapi/stat.h
+++ b/include/lapi/stat.h
@@ -20,7 +20,7 @@
  *
  * __reserved is held in case we need a yet finer resolution.
  */
-#if defined(HAVE_STRUCT_STATX_TIMESTAMP)
+#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 28)
 #include <sys/stat.h>
 #else
 struct statx_timestamp {
@@ -66,7 +66,7 @@ struct statx_timestamp {
  * will have values installed for compatibility purposes so that stat() and
  * co. can be emulated in userspace.
  */
-#if defined(HAVE_STRUCT_STATX)
+#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 28)
 #include <sys/stat.h>
 #else
 struct statx {
-- 
2.9.5


             reply	other threads:[~2018-09-19  4:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19  4:48 Li Wang [this message]
2018-09-19  7:48 ` [LTP] [PATCH] statx: fix compile errors with glibc<2.28 Cyril Hrubis
2018-09-19  9:44   ` Li Wang
2018-09-19 11:40     ` Cyril Hrubis
2018-09-26 14:15 ` [LTP] [PATCH v2] statx: fix compile errors Thadeu Lima de Souza Cascardo
2018-09-26 14:48   ` Cyril Hrubis

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=20180919044813.22875-1-liwang@redhat.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox