On Fri, Aug 08, 2025 at 07:51:26AM +1000, Aleksa Sarai wrote: > On 2025-08-07, Josh Triplett <josh@xxxxxxxxxxxxxxxx> wrote: > > I just discovered that opening a file with O_PATH gives an fd that works > > with > > > > utimensat(fd, "", times, O_EMPTY_PATH) > > I guess you mean AT_EMPTY_PATH? We don't have O_EMPTY_PATH on Linux > (yet, at least...). Yes, that was a typo. > The set of things that are and are not allowed on O_PATH file > descriptors is a bit of a hodge-podge these days. Originally the > intention was for all of these things to be blocked by O_PATH (kind of > like O_SEARCH on other *nix systems) but the existence of AT_EMPTY_PATH > (and /proc/self/fd/... hackery) slowly led more and more things to be > allowed. I do appreciate that. In large part, I'm trying to figure out if it would be reasonable for this specific case to work, based on the premise that it doesn't add any new capability, just makes an existing capability available more consistently. Having that would make it easier to write portable code with *fewer* branches for Linux. It'd still be necessary to *open* files with the Linux-specific O_PATH, but generic library routines that operate on open files wouldn't have to change. - Josh Triplett