fix: don't fail exceptfds with ENOSYS, just zero them' - #127
Conversation
|
Conclusion: try implementing this properly via a new syscall that does report errors |
Arshia001
left a comment
There was a problem hiding this comment.
This introduces a potential deviation from applications' expectations, where an app that actually depends on checking for errors through select will just never see any errors and assume everything is going well. The proper fix would be to introduce proper support for reporting errors through select, which probably requires a new syscall.
|
Thinking about it for a bit, I now think this is actually the right approach.
There are some edge cases in Linux where exceptional condtions may occur (procfs, sysfs, cgroup stuff) all of which don't exist inside wasix. The only real case would be TCP OOB which is generally discouraged, and we do not produce it anywhere at the moment. TL;DR: this is not fully correct, but it breaks way fewer consumers than the status quo. Full OOB handling could be done in a follow up but does not unblock any consumer I know of, so low prio |
|
nevermind, implementing TCP OOB is quite reasonably doable, gonna do that |
pselectreturnedENOSYSwhenevererrorfdsheld any descriptors, since wasixpoll_oneoffhas no exceptional-condition (POLLPRI) event type.This breaks the common idiom of passing all three fd sets defensively and treating only
EBADFas fatal (e.g. rsync, whose select loop spins on theENOSYS).Exceptional conditions are unobservable on wasix anyway, so report that no descriptor is exceptional (
FD_ZERO(errorfds)) and proceed on read/write instead of failing the call. Also fixesselect(), which forwards topselect().