[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: Emulate SOCK_CLOEXEC/NONBLOCK if un
From: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: Emulate SOCK_CLOEXEC/NONBLOCK if unavailable |
Date: |
Mon, 23 Sep 2013 13:28:54 +0200 |
User-agent: |
Mutt/1.5.21+155 (d3096e8796e7) (2012-12-30) |
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, address@hidden wrote:
> > From: "Edgar E. Iglesias" <address@hidden>
> >
> > 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