Repository navigation
std.posix: handle INVAL in openZ, openatZ and openatWasi - #19833
Conversation
|
Using the Ran with: (note:
So, Side note: |
In accordance with ziglang#19833 (comment)
I'm interested in investigating these other cases and handling them properly. I found some documentation on such cases here. Are you aware of any other cases? |
|
Those are the cases I was referring to. However, each operating system may also behave differently; that link is just for Linux. For example, it looks like FreeBSD doesn't document what happens in this case (the only documented So, the idea I had in mind would be something like:
Then, we'd try figure out if there are any commonalities, and potentially whether or not it would make sense to translate It also might make sense to handle .INVAL => switch (native_os) {
.linux => return error.BadPathName,
.freebsd => unreachable, // just a hypothetical, if it turns out that FreeBSD doesn't use INVAL for the illegal character case
// etc
},but, again, I feel like we would need more information about how different OSes handle the situation to determine what the switch cases should actually do. In the meantime, I think the changes in this PR are a step in the right direction. These are just my initial thoughts on this, though. Addressing #15607 has been on my todo list for a while but I haven't actually put any work into it yet. |
In accordance with ziglang#19833 (comment)
|
Thanks! |
Contributes to ziglang#15607 Although the case is not handled in `openatWasi` (as I could not get a working wasi environment to test the change) I have added a FIXME addressing it and linking to the issue.
In accordance with ziglang#19833 (comment)
|
Just to clarify what happened here: this PR was rebased and auto-merge was turned on, but |
In accordance with ziglang#19833 (comment)
Contributes to #15607
Although the case is not handled inopenatWasi(as I could not get aworking wasi environment to test the change) I have added a FIXME
addressing it and linking to the issue.
Edit: Handled case in openatWasi too