Skip to content

open on nonexistent file returns wrong error #1596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mkroening opened this issue Feb 11, 2025 · 0 comments
Open

open on nonexistent file returns wrong error #1596

mkroening opened this issue Feb 11, 2025 · 0 comments
Assignees

Comments

@mkroening
Copy link
Member

open should return ENOENT if

O_CREAT is not set and a component of path does not name an existing file, or O_CREAT is set and a component of the path prefix of path does not name an existing file, or path points to an empty string.

It should return ENOENT or ENOTDIR if

O_CREAT is set, and the path argument contains at least one non- character and ends with one or more trailing characters. If path without the trailing characters would name an existing file, an ENOENT error shall not occur.

Currently, open("/a") returns EINVAL, if /a does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants