O_DIRECTORY|O_TMPFILE
O_DIRECTORY|O_TMPFILE
Posted Aug 3, 2026 6:37 UTC (Mon) by neilbrown (subscriber, #359)In reply to: O_DIRECTORY|O_TMPFILE by jkoolstra
Parent article: Reconsidering O_CREAT|O_DIRECTORY
You cannot do this in this fashion since we have:
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
True, but opening with O_CREAT | O_TMPFILE | O_DIRECTORY could work. That combination is currently illegal and has been since O_DIRECTORY was added to O_TMPFILE.
That isn't exactly elegant, but isn't as inelegant as combining O_DIRECTORY with O_TMPFILE.
(I would have added O_EXCL to __O_TMPFILE as old kernels would return -EEXIST if O_TMPFILE we given but not understood).
