Fix: build failure when __GLIBC_PREREQ is missing
authorBaruch Siach <baruch@tkos.co.il>
Tue, 8 Mar 2016 12:55:04 +0000 (14:55 +0200)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 18 Mar 2016 20:31:16 +0000 (16:31 -0400)
The musl C library does not provide the __GLIBC_PREREQ macro. Instead of
relying on glibc version test, check directly for the availability of
epoll_create1().

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
src/common/compat/poll.h

index 391c781e16f74061212798205cdd31732c65f9d5..ef9894cc9ed76fa7c6794cce56276f7c69acd1e6 100644 (file)
@@ -122,7 +122,7 @@ AC_CHECK_FUNCS([ \
        gethostbyname gethostname getpagesize localtime_r memchr memset \
        mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
        strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
-       strtoull dirfd gethostbyname2 getipnodebyname \
+       strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \
 ])
 
 # Babeltrace viewer check
index 5f45da2b3b04cf3330c02236ef13793a71f02d21..34d0cffda479661b95fdba56b5e7cb5356b08e65 100644 (file)
@@ -73,7 +73,7 @@ enum {
        LPOLLNVAL = EPOLLHUP,
        LPOLLRDHUP = EPOLLRDHUP,
        /* Close on exec feature of epoll */
-#if __GLIBC_PREREQ(2, 9)
+#if defined(HAVE_EPOLL_CREATE1) && defined(EPOLL_CLOEXEC)
        LTTNG_CLOEXEC = EPOLL_CLOEXEC,
 #else
        /*
@@ -127,7 +127,7 @@ extern int compat_epoll_create(struct lttng_poll_event *events,
 #define lttng_poll_create(events, size, flags) \
        compat_epoll_create(events, size, flags)
 
-#if __GLIBC_PREREQ(2, 9)
+#if defined(HAVE_EPOLL_CREATE1) && defined(EPOLL_CLOEXEC)
 static inline int compat_glibc_epoll_create(int size __attribute__((unused)),
                int flags)
 {
This page took 0.027813 seconds and 5 git commands to generate.