From: Ian Campbell Subject: Re: [PATCH] libxl: use libxl_fd_set_{cloexec, nonblock} helpers Date: Tue, 29 Jul 2014 10:15:43 +0100 Message-ID: <1406625343.21498.6.camel@kazak.uk.xensource.com> References: <53D28D9F020000780002615D@mail.emea.novell.com> <21458.36567.506481.423244@mariner.uk.xensource.com> <53D60AB602000078000265E2@mail.emea.novell.com> <53D66362.8000901@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XC3Vc-0002E4-H4 for xen-devel@lists.xenproject.org; Tue, 29 Jul 2014 09:15:48 +0000 In-Reply-To: <53D66362.8000901@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel , Ian Jackson , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2014-07-28 at 15:51 +0100, David Vrabel wrote: > > > And of course I'd be perfectly fine with a one liner just dropping it > > (all I really care about is that the file builds correctly in all cases). > > The question of why cloexec is needed/wanted here I'll pass on to > > author and committer, but I'd guess this is just to avoid > > proliferation of file handles into clones. > > Surely it should be standard practice for a library to always set > CLOEXEC on any files it opens, to minimize the side effects the library > call has? > > And if CLOEXEC is required then setting it at open time is the only safe > way. Jan's problem (according to the commit log) is that O_CLOEXEC isn't universally available yet. Fortunately libxl has the carefd infrastructure which offers an alternative. Ian.