Paolo Bonzini wrote: > How so? Only for EAGAIN and EINTR. If FIONREAD is supported, it will > return EINVAL or something like that.
You're right, sorry. I was confused by the unified diffs (prefer context diffs). > >> + errno = 0; > >> > > > > What's the purpose of that? If recv() needs errro to be 0 upon entry, > > this statement should come before the recv() call. It cannot be needed > > for the caller, since at this point it is guaranteed that the function > > returns with "return rc;" which is positive. > > > The idea is that we return POLLHUP or POLLERR, so having poll set an > errno is misleading. If a function is allowed to modify errno > arbitrarily (as long as it returns a positive value) I'm ok with > removing this line. Sure. Most POSIX functions can modify errno even when they finally succeed. Even malloc() can return a valid pointer and set errno to any value, from ENOMEM to EINVAL. Bruno