Parcourir la source

poll: unavailable on linux < 2.2.0

fixes bug #253

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer il y a 14 ans
Parent
commit
c034b2e165

+ 5 - 0
libc/sysdeps/linux/common/bits/kernel-features.h

@@ -28,6 +28,11 @@
 #include <linux/version.h>
 #define __LINUX_KERNEL_VERSION	LINUX_VERSION_CODE
 
+/* When was `poll' introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_POLL_SYSCALL          1
+#endif
+
 /* Real-time signal became usable in 2.1.70.  */
 #if __LINUX_KERNEL_VERSION >= 131398
 # define __ASSUME_REALTIME_SIGNALS	1

+ 2 - 1
libc/sysdeps/linux/common/poll.c

@@ -19,8 +19,9 @@
 
 #include <sys/syscall.h>
 #include <sys/poll.h>
+#include <bits/kernel-features.h>
 
-#ifdef __NR_poll
+#if defined __ASSUME_POLL_SYSCALL && defined __NR_poll
 
 _syscall3(int, poll, struct pollfd *, fds,
 	unsigned long int, nfds, int, timeout)