Since, he said, nobody seems to have noticed the change over this time, it Three LTS releases all returning ENOTDIR even if the file was ENOTDIR has existed ever since v5.7 now. So before we continue down that road should we maybe treat this asĪ chance to fix the old bug? Because this behavior of returning Thing to do was to fix the kernel to do something more rational with that Makes a bit more sense than what the kernel does now and is, in any case, Viro, which was merged for the 5.7 release.įalcato included a patch to restore the previous behavior, which arguably The behavioral change down to this commit from Al It is fair to say that this behavior is even more Return ENOTDIR if the path does not exist - but it also stillĬreates a regular file. That the behavior in the final case above had changed the kernel will now Succeed after creating a regular file with the indicated name, which is If, however, the path does not exist at all, the open() call will O_DIRECTORY indicates that the path is expected to be a directory. If, instead, the path is an existing directory, theĮrror is EISDIR - perhaps a bit surprising, given that Is a regular file, open() fails and returns with anĮNOTDIR error. Two flags has been to flag an error in most situations. Since time immemorial, the kernel's response to the combination of those Requests the kernel to create a directory (which is supposed to alreadyĮxist) as a regular file - which clearly does not make sense. So the combination of O_CREAT and O_DIRECTORY It is not possible to create a directory with Instead, indicates that the call should only succeed if the path exists and The O_CREAT flag requests that open() create a regularįile if the named path doesn't exist (adding O_EXCL will cause theĬall to fail if the path does exist). Likely that this behavior will soon be fixed, resulting in a rare user-visible Though, that the kernel has responded in a surprising way to theĬombination of O_CREAT and O_DIRECTORY for a long time.Īfter a 2020 change made that response even more surprising, it seems System call offers a number of flags that modify its behavior not allĬombinations of those flags make sense in a single call.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |