]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include: improve statx fallback
authorKarel Zak <kzak@redhat.com>
Tue, 14 Feb 2023 11:04:41 +0000 (12:04 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 14 Feb 2023 11:04:41 +0000 (12:04 +0100)
Addresses: https://github.com/util-linux/util-linux/pull/2065
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
include/fileutils.h
meson.build

index 9cb5f3e3753c87d6bd7845d640d6fead0e8afa65..89ba867dfb352fa6d0401da468c9e0e44315b2e5 100644 (file)
@@ -315,6 +315,7 @@ AC_CHECK_HEADERS([ \
        linux/nsfs.h \
        linux/pr.h \
        linux/raw.h \
+       linux/stat.h \
        linux/securebits.h \
        linux/tiocl.h \
        linux/version.h \
index 51fdcd5984faebcb7043c3d6e2edcb3b3b3117f2..f2c6b232528bf65c4dad290a4b68657b86436c56 100644 (file)
@@ -94,9 +94,9 @@ static inline int close_range(unsigned int first, unsigned int last, int flags)
 #  define HAVE_CLOSE_RANGE 1
 # endif        /* SYS_close_range */
 
-# if !defined(HAVE_STATX) && defined(SYS_statx)
+# if !defined(HAVE_STATX) && defined(SYS_statx) && defined(HAVE_LINUX_STAT_H)
 #  include <fcntl.h>
-#  include <sys/stat.h>
+#  include <linux/stat.h>
 static inline int statx(int fd, const char *restrict path, int flags,
                    unsigned int mask, struct statx *stx)
 {
index bd1bbd4f66e96a67a8d049423726b60b8fec08d4..5139a3fd0593f82e05b4cca7d72262adf30c3e62 100644 (file)
@@ -171,6 +171,7 @@ headers = '''
        linux/gsmmux.h
         linux/net_namespace.h
         linux/nsfs.h
+        linux/stat.h
         linux/securebits.h
         linux/tiocl.h
         linux/version.h