[git commit master] poll: unavailable on linux < 2.2.0

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Mar 4 11:59:10 UTC 2010


commit: http://git.uclibc.org/uClibc/commit/?id=c034b2e1655dd2856f8b6f3247e6e406e46c24a4
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

fixes bug #253

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/sysdeps/linux/common/bits/kernel-features.h |    5 +++++
 libc/sysdeps/linux/common/poll.c                 |    3 ++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
index 8829734..b04ad6d 100644
--- a/libc/sysdeps/linux/common/bits/kernel-features.h
+++ b/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
diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c
index 4a6f06e..52f6c76 100644
--- a/libc/sysdeps/linux/common/poll.c
+++ b/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)
-- 
1.6.3.3



More information about the uClibc-cvs mailing list