summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c')
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
index 0bda8f7ac4..a544f7b348 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@@ -14,7 +14,7 @@
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/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
@@ -28,6 +28,7 @@
#if !XSTAT_IS_XSTAT64
#include "overflow.h"
+#include <statx_cp.h>
/* Get information about the file NAME in BUF. */
int
@@ -35,7 +36,16 @@ __fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag)
{
if (vers == _STAT_VER_KERNEL)
{
+# ifdef __NR_fstatat64
int rc = INLINE_SYSCALL (fstatat64, 4, fd, file, buf, flag);
+# else
+ struct statx tmp;
+ int rc = INLINE_SYSCALL (statx, 5, fd, file,
+ AT_NO_AUTOMOUNT | flag,
+ STATX_BASIC_STATS, &tmp);
+ if (rc == 0)
+ __cp_stat64_statx ((struct stat64 *)buf, &tmp);
+# endif
return rc ?: stat_overflow (buf);
}