[libvirt] [BUG] EPOLL_CLOEXEC undeclared

Eric Blake eblake at redhat.com
Mon Jan 16 15:36:00 UTC 2012


On 01/16/2012 08:07 AM, Philipp Hahn wrote:
> Hi,
> 
> $ cat /etc/debian_version 
> 5.0.1
> $ dpkg -S eventpoll.h
> linux-libc-dev: /usr/include/linux/eventpoll.h
> $ dpkg-query -W linux-libc-dev
> linux-libc-dev  2.6.32-35~ucs1.48.201109051614

glibc has supported epoll_create1() and EPOLL_CLOEXEC since glibc 2.9.

On my Fedora systems, I see that even eventpoll.h from Fedora 12
kernel-headers-2.6.32.26-175.fc12.i686 had

#define EPOLL_CLOEXEC O_CLOEXEC

But I _also_ see that /usr/include/sys/epoll.h has EPOLL_CLOEXEC (as
well as EPOLL_NONBLOCK) defined; in my case on glibc-headers-2.11.2-3.i686.

Our file includes <sys/epoll.h>, not <linux/eventpoll.h>; so now the
trick is to figure out why your <sys/epoll.h> seems to be so old as to
lack EPOLL_CLOEXEC.  Meanwhile, given that Linux has tied EPOLL_CLOEXEC
to O_CLOEXEC, and further that EPOLL_CLOEXEC doesn't exist on any other
systems, I think the trivial patch would be to use O_CLOEXEC instead,
along with a comment why we don't use the documented interface (in order
to cater to older systems).

Would you like to submit the patch for that?

-- 
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/20120116/7b0f0957/attachment-0001.sig>


More information about the libvir-list mailing list