All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] statx: fix compile errors with glibc<2.28
@ 2018-09-19  4:48 Li Wang
  2018-09-19  7:48 ` Cyril Hrubis
  2018-09-26 14:15 ` [LTP] [PATCH v2] statx: fix compile errors Thadeu Lima de Souza Cascardo
  0 siblings, 2 replies; 6+ messages in thread
From: Li Wang @ 2018-09-19  4:48 UTC (permalink / raw)
  To: ltp

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


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

end of thread, other threads:[~2018-09-26 14:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19  4:48 [LTP] [PATCH] statx: fix compile errors with glibc<2.28 Li Wang
2018-09-19  7:48 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.