aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-06-12 12:04:09 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-06-12 13:04:43 +0200
commit5dad6ffbb2b76215cfcd38c3001778536ada8e8a (patch)
tree3e4e55117be3039d516c14243beddb9041469d5b /sysdeps
parent4e75c2a43bb3208f32556a2b19c939cfe1f54ba6 (diff)
downloadglibc-5dad6ffbb2b76215cfcd38c3001778536ada8e8a.tar
glibc-5dad6ffbb2b76215cfcd38c3001778536ada8e8a.tar.gz
glibc-5dad6ffbb2b76215cfcd38c3001778536ada8e8a.tar.bz2
glibc-5dad6ffbb2b76215cfcd38c3001778536ada8e8a.zip
<sys/stat.h>: Use Linux UAPI header for statx if available and useful
This will automatically import new STATX_* constants. It also avoids a conflict between <sys/stat.h> and <linux/stat.h>.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/bits/statx.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/statx.h b/sysdeps/unix/sysv/linux/bits/statx.h
new file mode 100644
index 0000000000..d36f44efc6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/statx.h
@@ -0,0 +1,34 @@
+/* statx-related definitions and declarations. Linux version.
+ Copyright (C) 2018-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This interface is based on <linux/stat.h> in Linux. */
+
+#ifndef _SYS_STAT_H
+# error Never include <bits/statx.h> directly, include <sys/stat.h> instead.
+#endif
+
+/* Use the Linux kernel header if available. */
+#if __glibc_has_include (<linux/stat.h>)
+# include <linux/stat.h>
+# ifdef STATX_TYPE
+# define __statx_timestamp_defined 1
+# define __statx_defined 1
+# endif
+#endif
+
+#include <bits/statx-generic.h>