[PATCH] Fix ETIME handling for Solaris event ports

Jeremy Allison jra at samba.org
Thu Feb 4 23:16:39 UTC 2016


On Thu, Feb 04, 2016 at 11:44:42PM +0100, Ralph Boehme wrote:
> 
> according to the Illumos libc sources, port_getn() doesn't update nget
> on return for any other error then ETIME.
> 
> This implies EINTR is only returned if there are no fd events,

Maybe. But look at the text from the link
you found:

http://networking-discuss.opensolaris.narkive.com/AdTgQU1i/port-getn-and-timeouts-is-this-a-bug-or-an-undocumented-feature>

"Think of ETIME/EINTR not as an error but as a supplementary bit of
inforation: port_getn() always returns, via the nget input/output
argument, the number of events fetched, and ETIME/EINTR merely indicate
whether a timeout or signal interrupted the wait for more events."

That does state EINTR can be returned *in addition*
to the number of events - but I do agree with your
assessment below - for that EINTR case to work nget
*must* be updated with the number of events.

> otherwise port_getn() would be completely broken for nget > 1. Luckily
> we're using it with n = 1 so I think we can assume if we get EINTR we
> got a signal and not a fd event, so there's no need to set and test
> events[0].portev_source.

In that case, how about this simplified version of the patch
that handles the ETIME case, but leaves the EINTR version
alone ?

Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-ETIME-and-EINTR-handling-for-solaris-event-po.patch
Type: text/x-diff
Size: 2400 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160204/118afe8e/0001-Handle-ETIME-and-EINTR-handling-for-solaris-event-po.diff>


More information about the samba-technical mailing list