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(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org