From b8acbba6f7ef3ea367fbf92997931c442f29fafe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 14 Feb 2023 12:04:41 +0100 Subject: [PATCH] include: improve statx fallback Addresses: https://github.com/util-linux/util-linux/pull/2065 Signed-off-by: Karel Zak --- configure.ac | 1 + include/fileutils.h | 4 ++-- meson.build | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9cb5f3e375..89ba867dfb 100644 --- a/configure.ac +++ b/configure.ac @@ -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 \ diff --git a/include/fileutils.h b/include/fileutils.h index 51fdcd5984..f2c6b23252 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -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 -# include +# include static inline int statx(int fd, const char *restrict path, int flags, unsigned int mask, struct statx *stx) { diff --git a/meson.build b/meson.build index bd1bbd4f66..5139a3fd05 100644 --- a/meson.build +++ b/meson.build @@ -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 -- 2.47.2