On Sat, Oct 19, 2024 at 09:15:32AM -0700, Linus Torvalds wrote: > IOW, I think the (NULL, AT_EMPTY_PATH) tuple makes sense as a way to > pass just an 'fd', but I'm _not_ convinced it makes sense as a way to > pass in AT_FDCWD. > > Put another way: imagine you have a silly library implementation that does > > #define fstat(fd,buf) fstatat(fd, NULL, buf, AT_EMPTY_PATH) > > and I think *that* is what we want to support. But if 'fd' is not a > valid fd, you should get -EBADF, not "fstat of current working > directlry". > > Hmm? There'd been an example of live use of that posted upthread: https://sources.debian.org/src/snapd/2.65.3-1/tests/main/seccomp-statx/test-snapd-statx/bin/statx.py/?hl=71#L71 "" rather than NULL, but... > This is not a hugely important thing. If people really think that > doing "fstat()" on the current working directory is worth doing this > for, then whatever.