summaryrefslogtreecommitdiff
path: root/support/misc
diff options
context:
space:
mode:
authorDoug Nazar <nazard@nazar.ca>2019-12-09 10:53:37 -0500
committerSteve Dickson <steved@redhat.com>2019-12-09 10:53:37 -0500
commitff3ad88c233ecd87f7983ad13836323f944540ec (patch)
tree52fe41017cb369f647ebdf1231a8e7faf66c9180 /support/misc
parentdc50aaf0e958983ce04337a93e505706ab9aa3d3 (diff)
downloadnfs-utils-ff3ad88c233ecd87f7983ad13836323f944540ec.tar.gz
Disable statx if using glibc emulation
On older kernels without statx, glibc with statx support will attempt to emulate the call. However it doesn't support AT_STATX_DONT_SYNC and will return EINVAL. This causes all xstat/xlstat calls to fail. Signed-off-by: Doug Nazar <nazard@nazar.ca> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/misc')
-rw-r--r--support/misc/xstat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/support/misc/xstat.c b/support/misc/xstat.c
index 661e29e..a438fbc 100644
--- a/support/misc/xstat.c
+++ b/support/misc/xstat.c
@@ -51,6 +51,9 @@ statx_do_stat(int fd, const char *pathname, struct stat *statbuf, int flags)
statx_copy(statbuf, &stxbuf);
return 0;
}
+ /* glibc emulation doesn't support AT_STATX_DONT_SYNC */
+ if (errno == EINVAL)
+ errno = ENOSYS;
if (errno == ENOSYS)
statx_supported = 0;
} else