From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO4KG-0006G6-Qr for qemu-devel@nongnu.org; Mon, 23 Sep 2013 07:29:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO4K8-0003D9-DZ for qemu-devel@nongnu.org; Mon, 23 Sep 2013 07:29:12 -0400 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:34982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO4K8-0003Cz-5U for qemu-devel@nongnu.org; Mon, 23 Sep 2013 07:29:04 -0400 Received: by mail-la0-f52.google.com with SMTP id ev20so2346957lab.39 for ; Mon, 23 Sep 2013 04:29:02 -0700 (PDT) Date: Mon, 23 Sep 2013 13:28:54 +0200 From: "Edgar E. Iglesias" Message-ID: <20130923112854.GC3076@zapo.xilinx.com> References: <1379336886-14715-1-git-send-email-edgar.iglesias@gmail.com> <20130923093710.GA13144@afflict.kos.to> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130923093710.GA13144@afflict.kos.to> Subject: Re: [Qemu-devel] [PATCH] linux-user: Emulate SOCK_CLOEXEC/NONBLOCK if unavailable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: qemu-devel@nongnu.org On Mon, Sep 23, 2013 at 12:37:10PM +0300, Riku Voipio wrote: > Hi, Hi Riku, > > On Mon, Sep 16, 2013 at 03:08:06PM +0200, edgar.iglesias@gmail.com wrote: > > From: "Edgar E. Iglesias" > > > > If the host lacks support for SOCK_CLOEXEC or SOCK_NONBLOCK, > > try to emulate them with fcntl() FD_CLOEXEC and O_NONBLOCK. > > Last time emulating CLOEXEC with fcntl was discussed, the idea > was rejected[1]. The whole point of CLOEXEC flag is guarantee > race free open, which when implemented this way it is no longer. > > It is better to tell the userspace that atomic operation is not > available and let the userspace app/library to cope with that, > than give the application false sense of safety. Agreed, I'll send a v2 that EINVALs on lack of SOCK_CLOEXEC. My primary concern is to avoid the build error of qemu. Thanks, Edgar