[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 18/31] libxl: Protect fds with CLOEXEC even with forking threads



Ian Campbell writes ("Re: [Xen-devel] [PATCH 18/31] libxl: Protect fds with 
CLOEXEC even with forking threads"):
> On Tue, 2012-04-10 at 20:07 +0100, Ian Jackson wrote:
> > +    r = pthread_atfork(atfork_lock, atfork_unlock, atfork_unlock);
> > +    if (r) libxl__alloc_failed(ctx, __func__, 0,0);
> 
> This is a bit subtle -- the only documented error from pthread_atfork is
> ENOMEM. Perhaps "assert(r == 0 || errno == ENOMEM)" as both
> belt'n'braces and doc?

Sure.  I have done this:

      r = pthread_atfork(atfork_lock, atfork_unlock, atfork_unlock);
      if (r) {
          assert(r == ENOMEM);
          libxl__alloc_failed(ctx, __func__, 0,0);
      }

> The above wouldn't stop me from acking though:
> 
> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.