X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FIO%2Fpoll.c;h=a09c2472a7625da8a00295bd33868340f4c2b853;hb=9d7debe1023b7931d135e515197539d2f69518ce;hp=50a5151475d415b8db001737b77a886a074ccc75;hpb=cf7fe8a27ac6ee8776974a7c83e80425f2ec0ff8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/IO/poll.c b/ext/IO/poll.c index 50a5151..a09c247 100644 --- a/ext/IO/poll.c +++ b/ext/IO/poll.c @@ -5,8 +5,8 @@ * This program is free software; you can redistribute it and/or * modify it under the same terms as Perl itself. * - * For systems that do not have the poll() system call (for example Linux) - * try to emulate it as closely as possible using select() + * For systems that do not have the poll() system call (for example Linux + * kernels < v2.1.23) try to emulate it as closely as possible using select() * */ @@ -26,6 +26,12 @@ #include #include +#ifdef HAS_SELECT +#ifdef I_SYS_SELECT +#include +#endif +#endif + #ifdef EMULATE_POLL_WITH_SELECT # define POLL_CAN_READ (POLLIN | POLLRDNORM ) @@ -35,10 +41,7 @@ # define POLL_EVENTS_MASK (POLL_CAN_READ | POLL_CAN_WRITE | POLL_HAS_EXCP) int -poll(fds, nfds, timeout) -struct pollfd *fds; -unsigned long nfds; -int timeout; +poll(struct pollfd *fds, unsigned long nfds, int timeout) { int i,err; fd_set rfd,wfd,efd,ifd; @@ -55,7 +58,7 @@ again: FD_ZERO(&wfd); FD_ZERO(&efd); - for(i = 0 ; i < nfds ; i++) { + for(i = 0 ; i < (int)nfds ; i++) { int events = fds[i].events; int fd = fds[i].fd; @@ -102,7 +105,7 @@ again: count = 0; - for(i = 0 ; i < nfds ; i++) { + for(i = 0 ; i < (int)nfds ; i++) { int revents = (fds[i].events & POLL_EVENTS_MASK); int fd = fds[i].fd;