RE: UDP recvmsg blocks after select(), 2.6 bug?

Hua Zhong
2004-10-06T20:31:08Z

> From what Andries posted, we can't block. If select says
> its readable, we can "return data, an end-of-file indication,
> or an error other than one indicating that it is blocked".

Arrrrgh..I misread it as "or an error indicating that it is blocked"..

So treating it simply as NON_BLOCKING isn't right.

> Hmm...no easy solution then.
>
> In any case, the current behaviour is not compliant with the
> POSIX text that Andries posted. Perhaps this should be
> documented somewhere?
> Alternately, how about having the recvmsg() call return a
> zero, and (if appropriate) the length of the name set to zero? This
> appears to comply with the man page for recvmsg().

If it's a read, returning zero means end-of-file. Not sure what it means
when recvmsg returns zero..But is this just the problem of UDP or
recvmsg? I doubt it.

So I guess the easiest solution is just admit Linux select
isn't posix compliant.

> Chris