Return __WASI_EINVAL from fd_prestat_dir_name#2580
Return __WASI_EINVAL from fd_prestat_dir_name#2580wenyongh merged 1 commit intobytecodealliance:mainfrom
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
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.