]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If no eloop mechanism has been selected for us, print a message
authorRoy Marples <roy@marples.name>
Thu, 13 Apr 2017 16:42:55 +0000 (17:42 +0100)
committerRoy Marples <roy@marples.name>
Thu, 13 Apr 2017 16:42:55 +0000 (17:42 +0100)
to state which one eloop has chosen.

src/eloop.c
tests/eloop-bench/README.md

index 52b7e1b186bab4e7c60c6189bfaf8b88e6976009..7e3937a1d01ff6b65090ffaac80dc529d43f3460 100644 (file)
 /* Assume BSD has a working sys/queue.h and kqueue(2) interface. */
 #define HAVE_SYS_QUEUE_H
 #define HAVE_KQUEUE
+#define WARN_SELECT
 #elif defined(__linux__) || defined(__sun)
 /* Assume Linux and Solaris have a working epoll(3) interface. */
 #define HAVE_EPOLL
+#define WARN_SELECT
 #else
 /* pselect(2) is a POSIX standard. */
 #define HAVE_PSELECT
+#define WARN_SELECT
 #endif
 #endif
 
 #include <poll.h>
 #endif
 
+#ifdef WARN_SELECT
+#if defined(HAVE_KQUEUE)
+#pragma message("Compiling eloop with kqueue(2) support.")
+#elif defined(HAVE_EPOLL)
+#pragma message("Compiling eloop with epoll(7) support.")
+#elif defined(HAVE_PSELECT)
+#pragma message("Compiling eloop with pselect(2) support.")
+#elif defined(HAVE_PPOLL)
+#pragma message("Compiling eloop with ppoll(2) support.")
+#elif defined(HAVE_POLLTS)
+#pragma message("Compiling eloop with pollts(2) support.")
+#else
+#error Unknown select mechanism for eloop
+#endif
+#endif
+
 /* Our structures require TAILQ macros, which really every libc should
  * ship as they are useful beyond belief.
  * Sadly some libc's don't have sys/queue.h and some that do don't have
index d5983c65832c377f9a9b572065d71fbbed69c87b..6f4a20c7ea81aa9d3acf73934c11e6b78417c8b9 100644 (file)
@@ -19,7 +19,7 @@ by giving one of these CPPFLAGS to the Makefile:
   *  `HAVE_PPOLL`
 
 kqueue(2) is found on modern BSD kernels.
-epoll(2) is found on modern Linux and Solaris kernels.
+epoll(7) is found on modern Linux and Solaris kernels.
 These two *should* be the best performers.
 
 pselect(2) *should* be found on any POSIX libc.