|
|
d8307d |
commit 5dad6ffbb2b76215cfcd38c3001778536ada8e8a
|
|
|
d8307d |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
d8307d |
Date: Wed Jun 12 12:04:09 2019 +0200
|
|
|
d8307d |
|
|
|
d8307d |
<sys/stat.h>: Use Linux UAPI header for statx if available and useful
|
|
|
d8307d |
|
|
|
d8307d |
This will automatically import new STATX_* constants. It also avoids
|
|
|
d8307d |
a conflict between <sys/stat.h> and <linux/stat.h>.
|
|
|
d8307d |
|
|
|
d8307d |
Conflicts:
|
|
|
d8307d |
io/bits/statx.h
|
|
|
d8307d |
(Year range in copyright header.)
|
|
|
d8307d |
|
|
|
d8307d |
diff --git a/include/bits/statx-generic.h b/include/bits/statx-generic.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..21674721b6d85265
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/include/bits/statx-generic.h
|
|
|
d8307d |
@@ -0,0 +1 @@
|
|
|
d8307d |
+#include <io/bits/statx-generic.h>
|
|
|
d8307d |
diff --git a/include/bits/types/struct_statx.h b/include/bits/types/struct_statx.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..82add6484f2ee963
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/include/bits/types/struct_statx.h
|
|
|
d8307d |
@@ -0,0 +1 @@
|
|
|
d8307d |
+#include <io/bits/types/struct_statx.h>
|
|
|
d8307d |
diff --git a/include/bits/types/struct_statx_timestamp.h b/include/bits/types/struct_statx_timestamp.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..9fbedd5749fc1172
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/include/bits/types/struct_statx_timestamp.h
|
|
|
d8307d |
@@ -0,0 +1 @@
|
|
|
d8307d |
+#include <io/bits/types/struct_statx_timestamp.h>
|
|
|
d8307d |
diff --git a/io/Makefile b/io/Makefile
|
|
|
d8307d |
index ec5c6d7a2fb87914..787a5c550ab64b17 100644
|
|
|
d8307d |
--- a/io/Makefile
|
|
|
d8307d |
+++ b/io/Makefile
|
|
|
d8307d |
@@ -25,7 +25,9 @@ include ../Makeconfig
|
|
|
d8307d |
headers := sys/stat.h bits/stat.h sys/statfs.h bits/statfs.h sys/vfs.h \
|
|
|
d8307d |
sys/statvfs.h bits/statvfs.h fcntl.h sys/fcntl.h bits/fcntl.h \
|
|
|
d8307d |
poll.h sys/poll.h bits/poll.h bits/fcntl2.h bits/poll2.h \
|
|
|
d8307d |
- bits/statx.h utime.h ftw.h fts.h sys/sendfile.h
|
|
|
d8307d |
+ bits/statx.h bits/statx-generic.h bits/types/struct_statx.h \
|
|
|
d8307d |
+ bits/types/struct_statx_timestamp.h \
|
|
|
d8307d |
+ utime.h ftw.h fts.h sys/sendfile.h
|
|
|
d8307d |
|
|
|
d8307d |
routines := \
|
|
|
d8307d |
utime \
|
|
|
d8307d |
diff --git a/io/bits/statx-generic.h b/io/bits/statx-generic.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..1f5abbf148681e9b
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/io/bits/statx-generic.h
|
|
|
d8307d |
@@ -0,0 +1,60 @@
|
|
|
d8307d |
+/* Generic statx-related definitions and declarations.
|
|
|
d8307d |
+ Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
|
|
d8307d |
+ This file is part of the GNU C Library.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
d8307d |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
d8307d |
+ License as published by the Free Software Foundation; either
|
|
|
d8307d |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
d8307d |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
d8307d |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
d8307d |
+ Lesser General Public License for more details.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
d8307d |
+ License along with the GNU C Library; if not, see
|
|
|
d8307d |
+ <http://www.gnu.org/licenses/>. */
|
|
|
d8307d |
+
|
|
|
d8307d |
+/* This interface is based on <linux/stat.h> in Linux. */
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef _SYS_STAT_H
|
|
|
d8307d |
+# error Never include <bits/statx-generic.h> directly, include <sys/stat.h> instead.
|
|
|
d8307d |
+#endif
|
|
|
d8307d |
+
|
|
|
d8307d |
+#include <bits/types/struct_statx_timestamp.h>
|
|
|
d8307d |
+#include <bits/types/struct_statx.h>
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef STATX_TYPE
|
|
|
d8307d |
+# define STATX_TYPE 0x0001U
|
|
|
d8307d |
+# define STATX_MODE 0x0002U
|
|
|
d8307d |
+# define STATX_NLINK 0x0004U
|
|
|
d8307d |
+# define STATX_UID 0x0008U
|
|
|
d8307d |
+# define STATX_GID 0x0010U
|
|
|
d8307d |
+# define STATX_ATIME 0x0020U
|
|
|
d8307d |
+# define STATX_MTIME 0x0040U
|
|
|
d8307d |
+# define STATX_CTIME 0x0080U
|
|
|
d8307d |
+# define STATX_INO 0x0100U
|
|
|
d8307d |
+# define STATX_SIZE 0x0200U
|
|
|
d8307d |
+# define STATX_BLOCKS 0x0400U
|
|
|
d8307d |
+# define STATX_BASIC_STATS 0x07ffU
|
|
|
d8307d |
+# define STATX_ALL 0x0fffU
|
|
|
d8307d |
+# define STATX_BTIME 0x0800U
|
|
|
d8307d |
+# define STATX__RESERVED 0x80000000U
|
|
|
d8307d |
+
|
|
|
d8307d |
+# define STATX_ATTR_COMPRESSED 0x0004
|
|
|
d8307d |
+# define STATX_ATTR_IMMUTABLE 0x0010
|
|
|
d8307d |
+# define STATX_ATTR_APPEND 0x0020
|
|
|
d8307d |
+# define STATX_ATTR_NODUMP 0x0040
|
|
|
d8307d |
+# define STATX_ATTR_ENCRYPTED 0x0800
|
|
|
d8307d |
+# define STATX_ATTR_AUTOMOUNT 0x1000
|
|
|
d8307d |
+#endif /* !STATX_TYPE */
|
|
|
d8307d |
+
|
|
|
d8307d |
+__BEGIN_DECLS
|
|
|
d8307d |
+
|
|
|
d8307d |
+/* Fill *BUF with information about PATH in DIRFD. */
|
|
|
d8307d |
+int statx (int __dirfd, const char *__restrict __path, int __flags,
|
|
|
d8307d |
+ unsigned int __mask, struct statx *__restrict __buf)
|
|
|
d8307d |
+ __THROW __nonnull ((2, 5));
|
|
|
d8307d |
+
|
|
|
d8307d |
+__END_DECLS
|
|
|
d8307d |
diff --git a/io/bits/statx.h b/io/bits/statx.h
|
|
|
d8307d |
index e31254e3617bb17b..b3147bfa8af1818f 100644
|
|
|
d8307d |
--- a/io/bits/statx.h
|
|
|
d8307d |
+++ b/io/bits/statx.h
|
|
|
d8307d |
@@ -1,5 +1,5 @@
|
|
|
d8307d |
-/* statx-related definitions and declarations.
|
|
|
d8307d |
- Copyright (C) 2018 Free Software Foundation, Inc.
|
|
|
d8307d |
+/* statx-related definitions and declarations. Generic version.
|
|
|
d8307d |
+ Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
|
|
d8307d |
This file is part of the GNU C Library.
|
|
|
d8307d |
|
|
|
d8307d |
The GNU C Library is free software; you can redistribute it and/or
|
|
|
d8307d |
@@ -19,73 +19,8 @@
|
|
|
d8307d |
/* This interface is based on <linux/stat.h> in Linux. */
|
|
|
d8307d |
|
|
|
d8307d |
#ifndef _SYS_STAT_H
|
|
|
d8307d |
-# error Never include <bits/stat.x.h> directly, include <sys/stat.h> instead.
|
|
|
d8307d |
+# error Never include <bits/statx.h> directly, include <sys/stat.h> instead.
|
|
|
d8307d |
#endif
|
|
|
d8307d |
|
|
|
d8307d |
-struct statx_timestamp
|
|
|
d8307d |
-{
|
|
|
d8307d |
- __int64_t tv_sec;
|
|
|
d8307d |
- __uint32_t tv_nsec;
|
|
|
d8307d |
- __int32_t __statx_timestamp_pad1[1];
|
|
|
d8307d |
-};
|
|
|
d8307d |
-
|
|
|
d8307d |
-/* Warning: The kernel may add additional fields to this struct in the
|
|
|
d8307d |
- future. Only use this struct for calling the statx function, not
|
|
|
d8307d |
- for storing data. (Expansion will be controlled by the mask
|
|
|
d8307d |
- argument of the statx function.) */
|
|
|
d8307d |
-struct statx
|
|
|
d8307d |
-{
|
|
|
d8307d |
- __uint32_t stx_mask;
|
|
|
d8307d |
- __uint32_t stx_blksize;
|
|
|
d8307d |
- __uint64_t stx_attributes;
|
|
|
d8307d |
- __uint32_t stx_nlink;
|
|
|
d8307d |
- __uint32_t stx_uid;
|
|
|
d8307d |
- __uint32_t stx_gid;
|
|
|
d8307d |
- __uint16_t stx_mode;
|
|
|
d8307d |
- __uint16_t __statx_pad1[1];
|
|
|
d8307d |
- __uint64_t stx_ino;
|
|
|
d8307d |
- __uint64_t stx_size;
|
|
|
d8307d |
- __uint64_t stx_blocks;
|
|
|
d8307d |
- __uint64_t stx_attributes_mask;
|
|
|
d8307d |
- struct statx_timestamp stx_atime;
|
|
|
d8307d |
- struct statx_timestamp stx_btime;
|
|
|
d8307d |
- struct statx_timestamp stx_ctime;
|
|
|
d8307d |
- struct statx_timestamp stx_mtime;
|
|
|
d8307d |
- __uint32_t stx_rdev_major;
|
|
|
d8307d |
- __uint32_t stx_rdev_minor;
|
|
|
d8307d |
- __uint32_t stx_dev_major;
|
|
|
d8307d |
- __uint32_t stx_dev_minor;
|
|
|
d8307d |
- __uint64_t __statx_pad2[14];
|
|
|
d8307d |
-};
|
|
|
d8307d |
-
|
|
|
d8307d |
-#define STATX_TYPE 0x0001U
|
|
|
d8307d |
-#define STATX_MODE 0x0002U
|
|
|
d8307d |
-#define STATX_NLINK 0x0004U
|
|
|
d8307d |
-#define STATX_UID 0x0008U
|
|
|
d8307d |
-#define STATX_GID 0x0010U
|
|
|
d8307d |
-#define STATX_ATIME 0x0020U
|
|
|
d8307d |
-#define STATX_MTIME 0x0040U
|
|
|
d8307d |
-#define STATX_CTIME 0x0080U
|
|
|
d8307d |
-#define STATX_INO 0x0100U
|
|
|
d8307d |
-#define STATX_SIZE 0x0200U
|
|
|
d8307d |
-#define STATX_BLOCKS 0x0400U
|
|
|
d8307d |
-#define STATX_BASIC_STATS 0x07ffU
|
|
|
d8307d |
-#define STATX_ALL 0x0fffU
|
|
|
d8307d |
-#define STATX_BTIME 0x0800U
|
|
|
d8307d |
-#define STATX__RESERVED 0x80000000U
|
|
|
d8307d |
-
|
|
|
d8307d |
-#define STATX_ATTR_COMPRESSED 0x0004
|
|
|
d8307d |
-#define STATX_ATTR_IMMUTABLE 0x0010
|
|
|
d8307d |
-#define STATX_ATTR_APPEND 0x0020
|
|
|
d8307d |
-#define STATX_ATTR_NODUMP 0x0040
|
|
|
d8307d |
-#define STATX_ATTR_ENCRYPTED 0x0800
|
|
|
d8307d |
-#define STATX_ATTR_AUTOMOUNT 0x1000
|
|
|
d8307d |
-
|
|
|
d8307d |
-__BEGIN_DECLS
|
|
|
d8307d |
-
|
|
|
d8307d |
-/* Fill *BUF with information about PATH in DIRFD. */
|
|
|
d8307d |
-int statx (int __dirfd, const char *__restrict __path, int __flags,
|
|
|
d8307d |
- unsigned int __mask, struct statx *__restrict __buf)
|
|
|
d8307d |
- __THROW __nonnull ((2, 5));
|
|
|
d8307d |
-
|
|
|
d8307d |
-__END_DECLS
|
|
|
d8307d |
+/* Use the generic definitions. */
|
|
|
d8307d |
+#include <bits/statx-generic.h>
|
|
|
d8307d |
diff --git a/io/bits/types/struct_statx.h b/io/bits/types/struct_statx.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..4f3ae3ece62a0ad2
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/io/bits/types/struct_statx.h
|
|
|
d8307d |
@@ -0,0 +1,55 @@
|
|
|
d8307d |
+/* Definition of the generic version of struct statx.
|
|
|
d8307d |
+ Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
|
|
d8307d |
+ This file is part of the GNU C Library.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
d8307d |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
d8307d |
+ License as published by the Free Software Foundation; either
|
|
|
d8307d |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
d8307d |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
d8307d |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
d8307d |
+ Lesser General Public License for more details.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
d8307d |
+ License along with the GNU C Library; if not, see
|
|
|
d8307d |
+ <http://www.gnu.org/licenses/>. */
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef _SYS_STAT_H
|
|
|
d8307d |
+# error Never include <bits/types/struct_statx.h> directly, include <sys/stat.h> instead.
|
|
|
d8307d |
+#endif
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef __statx_defined
|
|
|
d8307d |
+#define __statx_defined 1
|
|
|
d8307d |
+
|
|
|
d8307d |
+/* Warning: The kernel may add additional fields to this struct in the
|
|
|
d8307d |
+ future. Only use this struct for calling the statx function, not
|
|
|
d8307d |
+ for storing data. (Expansion will be controlled by the mask
|
|
|
d8307d |
+ argument of the statx function.) */
|
|
|
d8307d |
+struct statx
|
|
|
d8307d |
+{
|
|
|
d8307d |
+ __uint32_t stx_mask;
|
|
|
d8307d |
+ __uint32_t stx_blksize;
|
|
|
d8307d |
+ __uint64_t stx_attributes;
|
|
|
d8307d |
+ __uint32_t stx_nlink;
|
|
|
d8307d |
+ __uint32_t stx_uid;
|
|
|
d8307d |
+ __uint32_t stx_gid;
|
|
|
d8307d |
+ __uint16_t stx_mode;
|
|
|
d8307d |
+ __uint16_t __statx_pad1[1];
|
|
|
d8307d |
+ __uint64_t stx_ino;
|
|
|
d8307d |
+ __uint64_t stx_size;
|
|
|
d8307d |
+ __uint64_t stx_blocks;
|
|
|
d8307d |
+ __uint64_t stx_attributes_mask;
|
|
|
d8307d |
+ struct statx_timestamp stx_atime;
|
|
|
d8307d |
+ struct statx_timestamp stx_btime;
|
|
|
d8307d |
+ struct statx_timestamp stx_ctime;
|
|
|
d8307d |
+ struct statx_timestamp stx_mtime;
|
|
|
d8307d |
+ __uint32_t stx_rdev_major;
|
|
|
d8307d |
+ __uint32_t stx_rdev_minor;
|
|
|
d8307d |
+ __uint32_t stx_dev_major;
|
|
|
d8307d |
+ __uint32_t stx_dev_minor;
|
|
|
d8307d |
+ __uint64_t __statx_pad2[14];
|
|
|
d8307d |
+};
|
|
|
d8307d |
+
|
|
|
d8307d |
+#endif /* __statx_defined */
|
|
|
d8307d |
diff --git a/io/bits/types/struct_statx_timestamp.h b/io/bits/types/struct_statx_timestamp.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..0f104ef84ed7d356
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/io/bits/types/struct_statx_timestamp.h
|
|
|
d8307d |
@@ -0,0 +1,33 @@
|
|
|
d8307d |
+/* Definition of the generic version of struct statx_timestamp.
|
|
|
d8307d |
+ Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
|
|
d8307d |
+ This file is part of the GNU C Library.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
d8307d |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
d8307d |
+ License as published by the Free Software Foundation; either
|
|
|
d8307d |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
d8307d |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
d8307d |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
d8307d |
+ Lesser General Public License for more details.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
d8307d |
+ License along with the GNU C Library; if not, see
|
|
|
d8307d |
+ <http://www.gnu.org/licenses/>. */
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef _SYS_STAT_H
|
|
|
d8307d |
+# error Never include <bits/types/struct_statx_timestamp.h> directly, include <sys/stat.h> instead.
|
|
|
d8307d |
+#endif
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef __statx_timestamp_defined
|
|
|
d8307d |
+#define __statx_timestamp_defined 1
|
|
|
d8307d |
+
|
|
|
d8307d |
+struct statx_timestamp
|
|
|
d8307d |
+{
|
|
|
d8307d |
+ __int64_t tv_sec;
|
|
|
d8307d |
+ __uint32_t tv_nsec;
|
|
|
d8307d |
+ __int32_t __statx_timestamp_pad1[1];
|
|
|
d8307d |
+};
|
|
|
d8307d |
+
|
|
|
d8307d |
+#endif /* __statx_timestamp_defined */
|
|
|
d8307d |
diff --git a/io/statx_generic.c b/io/statx_generic.c
|
|
|
d8307d |
index df327f8c525f748c..987c84fb45f5db63 100644
|
|
|
d8307d |
--- a/io/statx_generic.c
|
|
|
d8307d |
+++ b/io/statx_generic.c
|
|
|
d8307d |
@@ -18,9 +18,16 @@
|
|
|
d8307d |
|
|
|
d8307d |
#include <errno.h>
|
|
|
d8307d |
#include <fcntl.h>
|
|
|
d8307d |
+#include <string.h>
|
|
|
d8307d |
#include <sys/stat.h>
|
|
|
d8307d |
#include <sys/sysmacros.h>
|
|
|
d8307d |
|
|
|
d8307d |
+/* Obtain the original definition of struct statx. */
|
|
|
d8307d |
+#undef __statx_defined
|
|
|
d8307d |
+#define statx original_statx
|
|
|
d8307d |
+#include <bits/types/struct_statx.h>
|
|
|
d8307d |
+#undef statx
|
|
|
d8307d |
+
|
|
|
d8307d |
static inline struct statx_timestamp
|
|
|
d8307d |
statx_convert_timestamp (struct timespec tv)
|
|
|
d8307d |
{
|
|
|
d8307d |
@@ -57,7 +64,7 @@ statx_generic (int fd, const char *path, int flags,
|
|
|
d8307d |
/* The interface is defined in such a way that unused (padding)
|
|
|
d8307d |
fields have to be cleared. STATX_BASIC_STATS corresponds to the
|
|
|
d8307d |
data which is available via fstatat64. */
|
|
|
d8307d |
- *buf = (struct statx)
|
|
|
d8307d |
+ struct original_statx obuf =
|
|
|
d8307d |
{
|
|
|
d8307d |
.stx_mask = STATX_BASIC_STATS,
|
|
|
d8307d |
.stx_blksize = st.st_blksize,
|
|
|
d8307d |
@@ -76,6 +83,8 @@ statx_generic (int fd, const char *path, int flags,
|
|
|
d8307d |
.stx_dev_major = major (st.st_dev),
|
|
|
d8307d |
.stx_dev_minor = minor (st.st_dev),
|
|
|
d8307d |
};
|
|
|
d8307d |
+ _Static_assert (sizeof (*buf) >= sizeof (obuf), "struct statx size");
|
|
|
d8307d |
+ memcpy (buf, &obuf, sizeof (obuf));
|
|
|
d8307d |
|
|
|
d8307d |
return 0;
|
|
|
d8307d |
}
|
|
|
d8307d |
diff --git a/sysdeps/unix/sysv/linux/bits/statx.h b/sysdeps/unix/sysv/linux/bits/statx.h
|
|
|
d8307d |
new file mode 100644
|
|
|
d8307d |
index 0000000000000000..d36f44efc60a0bed
|
|
|
d8307d |
--- /dev/null
|
|
|
d8307d |
+++ b/sysdeps/unix/sysv/linux/bits/statx.h
|
|
|
d8307d |
@@ -0,0 +1,34 @@
|
|
|
d8307d |
+/* statx-related definitions and declarations. Linux version.
|
|
|
d8307d |
+ Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
|
|
d8307d |
+ This file is part of the GNU C Library.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
d8307d |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
d8307d |
+ License as published by the Free Software Foundation; either
|
|
|
d8307d |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
d8307d |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
d8307d |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
d8307d |
+ Lesser General Public License for more details.
|
|
|
d8307d |
+
|
|
|
d8307d |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
d8307d |
+ License along with the GNU C Library; if not, see
|
|
|
d8307d |
+ <http://www.gnu.org/licenses/>. */
|
|
|
d8307d |
+
|
|
|
d8307d |
+/* This interface is based on <linux/stat.h> in Linux. */
|
|
|
d8307d |
+
|
|
|
d8307d |
+#ifndef _SYS_STAT_H
|
|
|
d8307d |
+# error Never include <bits/statx.h> directly, include <sys/stat.h> instead.
|
|
|
d8307d |
+#endif
|
|
|
d8307d |
+
|
|
|
d8307d |
+/* Use the Linux kernel header if available. */
|
|
|
d8307d |
+#if __glibc_has_include (<linux/stat.h>)
|
|
|
d8307d |
+# include <linux/stat.h>
|
|
|
d8307d |
+# ifdef STATX_TYPE
|
|
|
d8307d |
+# define __statx_timestamp_defined 1
|
|
|
d8307d |
+# define __statx_defined 1
|
|
|
d8307d |
+# endif
|
|
|
d8307d |
+#endif
|
|
|
d8307d |
+
|
|
|
d8307d |
+#include <bits/statx-generic.h>
|