I noticed this bug in the most recent Debian Hurd build of https://github.com/tavianator/bfs. Here's a simple reproducer:
$ cat foo.c #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <sys/stat.h> #include <unistd.h> int main() { struct stat sb; int ret = fstatat(STDOUT_FILENO, "", &sb, AT_EMPTY_PATH); int err = errno; printf("ret = %d, err = %d\n", ret, err); return 0; } $ gcc foo.c -o foo $ ./foo ret = 0, err = 0 $ ./foo | cat ret = -1, err = 1073741869 On the other hand, fstat(STDOUT_FILENO, &sb) works fine. -- Tavian Barnes