On Sat, Oct 19, 2024 at 06:11:18PM +0100, Al Viro wrote: > 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... Which I think is really broken testing nonsense anyway so really we could easily get them to change this and not even have to worry about this. We've done stuff like that before. But I'm fine either way.