[libvirt] [Qemu-devel] [PATCH v4 3/7] qapi: Add pass-fd QMP command
Eric Blake
eblake at redhat.com
Mon Jun 25 16:13:22 UTC 2012
On 06/25/2012 09:34 AM, Kevin Wolf wrote:
> Am 25.06.2012 16:51, schrieb Corey Bryant:
>> Thanks for catching this. I'll fix this in v5. In terms of platforms
>> that support dup3 vs dup2, I'm assuming the following preprocessor
>> checks will do what we need:
>>
>> #if defined(__linux__) || defined(__CYGWIN__)
>> dup3(fd, monfd->fd, O_CLOEXEC)
>> #else
>> dup2()+fcntl(F_GETFD/F_SETFD)
>> #endif
>
> Checking for dup3() in configure might be the better option. It's not
> like it has been there forever, even on Linux.
Agreed. Furthermore, since dup3() has been proposed for addition into
POSIX[1], it won't be long before other platforms add it. Always favor
feature checks (a configure probe for dup3) over platform checks
(hard-coding the assumption that Linux and Cygwin are the only platforms
that will ever provide it).
[1] http://austingroupbugs.net/view.php?id=411
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120625/f46a6b5e/attachment-0001.sig>
More information about the libvir-list
mailing list