[PATCH] Fix ETIME handling for Solaris event ports

Nathan Huff nhuff at acm.org
Thu Feb 4 21:50:04 UTC 2016


The relavent line from the man page is

The nget argument points to the desired number of events to be retrieved

So setting it to 1 in this case is correct.

On Thu, Feb 4, 2016 at 2:33 PM, Ralph Boehme <rb at sernet.de> wrote:

> On Thu, Feb 04, 2016 at 01:32:51PM -0800, Jeremy Allison wrote:
> > On Wed, Feb 03, 2016 at 03:24:48PM -0700, Nathan Huff wrote:
> > > Turns out EINTR is even more messed up than ETIME.  It is possible to
> not
> > > get an event and not have nget updated either so you have to actually
> check
> > > the event structure you get back.  I have attached an updated patch to
> deal
> > > with that situation as well.
> >
> > Reviewed-by: Jeremy Allison <jra at samba.org>
> >
> > Nice work Nathan, good catch.
> >
> > Can I get a second Team reviewer ?
>
> Nack, I'm not convinced this is the correct fix. The EINTR handling
> still seems wrong.
>
> > > From c7790ac220217e4d6c03750e11eb2c03ace4df83 Mon Sep 17 00:00:00 2001
> > > From: Nathan Huff <nhuff at acm.org>
> > > Date: Wed, 3 Feb 2016 13:06:52 -0700
> > > Subject: [PATCH] Handle ETIME and EINTR handling for solaris event
> ports.
> > >
> > > It is quite possible to get a return of -1 and a errno of ETIME from
> > > port_getn and also get an event returned. The attached patch checks for
> > > the number of events returned and if it isn't 0 it falls through to the
> > > event handling code.
> > >
> > > If you get EINTR back it might be possible that you got an event, but
> it
> > > also is possible that you didn't get an event and nget isn't updated so
> > > you need to check whether the event list was actually filled in.
>
> If I understand the Illumos libc sources correctly, we should
> initialize nget to 0 before calling port_getn(). That way we can check
> nget when port_getn returns -1 with ETIME or EINTR.
>
> -Ralph
>
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de,mailto:kontakt@sernet.de
>


More information about the samba-technical mailing list