From 23a4c2369ac1007e170eaa3089b60b66392bb114 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 10 Dec 2021 14:23:15 -0500 Subject: stat: Work around GNU Hurd bug fstatat(fd, "", buf, AT_EMPTY_PATH) fails with a nonsense errno on Hurd. Since fstat() itself works fine, just use that. Link: https://lists.gnu.org/archive/html/bug-hurd/2021-12/msg00001.html --- stat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stat.c b/stat.c index 6042ffb..47e60b6 100644 --- a/stat.c +++ b/stat.c @@ -325,7 +325,8 @@ int bfs_stat(int at_fd, const char *at_path, enum bfs_stat_flags flags, struct b return bfs_stat_explicit(at_fd, at_path, at_flags, flags, buf); } -#ifdef AT_EMPTY_PATH + // Check __GNU__ to work around https://lists.gnu.org/archive/html/bug-hurd/2021-12/msg00001.html +#if defined(AT_EMPTY_PATH) && !__GNU__ static bool has_at_ep = true; if (has_at_ep) { at_flags |= AT_EMPTY_PATH; -- cgit v1.2.3