On Wed, Aug 19, 2009 at 05:57:04PM -0700, David Pacheco wrote: > Nicolas Williams wrote: > >To my reading you have these possible conditions: > > > > - max == 0 and port_getn() returns 0 -> *nget will have been set to the > > number of events available. > > Except when you hit 6455223. This unlikely case occurs when some events > on the port are not deliverable to the calling thread (e.g., async i/o > completion after a fork in the child process). This is not relevant to > this discussion, but it's worth noting that there are multiple edge > conditions not handled well by the current implementation.
Oh, ick. > > - port_getn() returns 0, or it returns -1 && errno is one of ETIME, > > EINTR, or EBADFD -> events may have been consumed and placed in > > list[], and *nget will have been set to the number of consumed > > events. > > EBADFD can't return with events. Ah, I misread the code. The same applies to EINTR, as you point out. > > [...] > > Yep. But really we should fix the implementation and make the man page > match the implementation. One shouldn't need to inspect kernel code to > know how to handle errors from a syscall. I used to own a few bugs in > this area, but I've removed myself as RE since I don't have the time to > get to them any time soon. I agree. So the only error condition that should return events is ETIME. That at least simplifies things. Nico -- _______________________________________________ networking-discuss mailing list networking-discuss@opensolaris.org