summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/sysdeps/linux/common/poll.c12
-rw-r--r--libc/sysdeps/linux/common/syscalls.c11
2 files changed, 13 insertions, 10 deletions
diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c
index cf3db35eb..9896ef858 100644
--- a/libc/sysdeps/linux/common/poll.c
+++ b/libc/sysdeps/linux/common/poll.c
@@ -17,6 +17,14 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#ifdef __NR_poll
+
+#include "syscalls.h"
+#include <sys/poll.h>
+_syscall3(int, poll, struct pollfd *, fds,
+ unsigned long int, nfds, int, timeout);
+#else
+
#include <alloca.h>
#include <sys/poll.h>
#include <sys/types.h>
@@ -26,6 +34,8 @@
#include <sys/param.h>
#include <unistd.h>
+/* uClinux 2.0 doesn't have poll, emulate it using select */
+
/* Poll the file descriptors described by the NFDS structures starting at
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
an event to occur; if TIMEOUT is -1, block until an event occurs.
@@ -190,3 +200,5 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout)
return ready;
}
+#endif
+
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index 2fb0f97f1..09cbd1f83 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -1862,16 +1862,7 @@ int query_module(const char *name, int which,
#endif
//#define __NR_poll 168
-#ifdef L_poll
-#ifdef __NR_poll
-#include <sys/poll.h>
-_syscall3(int, poll, struct pollfd *, fds, unsigned long int, nfds, int,
- timeout);
-#else
-/* uClinux 2.0 doesn't have poll, emulate it using select */
-#include "poll.c"
-#endif
-#endif
+// See poll.c
//#define __NR_nfsservctl 169
//nfsservctl EXTRA nfsservctl i:ipp nfsservctl