[$] The curious case of O_DIRECTORY|O_CREAT

Post Syndicated from original https://lwn.net/Articles/926782/

The open()
system call offers a number of flags that modify its behavior; not all
combinations of those flags make sense in a single call. It turns out,
though, that the kernel has responded in a surprising way to the
combination of O_CREAT and O_DIRECTORY for a long time.
After a 2020 change made that response even more surprising, it seems
likely that this behavior will soon be fixed, resulting in a rare user-visible
semantic change to a core system call.