-
Notifications
You must be signed in to change notification settings - Fork 625
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
Return __WASI_EINVAL from fd_prestat_dir_name #2580
Conversation
ENAMETOOLONG sounds weird to me for this particular case. |
@yamt I think the error code is fine. From the posix spec page I think this matches the error condition here pretty much exactly: the filename is too long to fit in the provided buffer. |
ENAMETOOLONG usually means that the given filename is too long wrt PATH_MAX/NAME_MAX. |
Agree, I think EINVAL is fine in that case, as it's invalid value provided by the user that causes this error. |
Ok gotcha, I hadn't actually come across the error code before so just from the name and description it seemed to fit well.
It appears not, I've searched the internet but the error code seems to refer exclusively to that specific case of a path exceeding the OS path max. I'll still need to change this function to return |
38c8ae4
to
866a246
Compare
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c
Outdated
Show resolved
Hide resolved
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c
Outdated
Show resolved
Hide resolved
Return a WASI error code (rather than a host POSIX one). In addition, there is no need to return an error in the case that the provided buffer is too large.
866a246
to
4e90c8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Return a WASI error code (rather than a host POSIX one). In addition, there is no need to return an error in the case that the provided buffer is too large.
Return a WASI error code (rather than a host POSIX one). In addition,
there is no need to return an error in the case that the provided buffer
is too large.