diff -ur libxml2-2.7.3/config.h.in libxml2-2.7.3-poll/config.h.in
--- libxml2-2.7.3/config.h.in	2009-01-18 22:31:43.000000000 +0100
+++ libxml2-2.7.3-poll/config.h.in	2009-08-10 21:57:23.000000000 +0200
@@ -207,6 +207,9 @@
 /* Define to 1 if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H
 
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
diff -ur libxml2-2.7.3/configure.in libxml2-2.7.3-poll/configure.in
--- libxml2-2.7.3/configure.in	2009-01-18 22:31:09.000000000 +0100
+++ libxml2-2.7.3-poll/configure.in	2009-08-10 21:56:49.000000000 +0200
@@ -414,6 +414,7 @@
 AC_CHECK_HEADERS([netdb.h])
 AC_CHECK_HEADERS([sys/time.h])
 AC_CHECK_HEADERS([sys/select.h])
+AC_CHECK_HEADERS([poll.h])
 AC_CHECK_HEADERS([sys/mman.h])
 AC_CHECK_HEADERS([sys/timeb.h])
 AC_CHECK_HEADERS([signal.h])
diff -ur libxml2-2.7.3/nanohttp.c libxml2-2.7.3-poll/nanohttp.c
--- libxml2-2.7.3/nanohttp.c	2008-08-29 21:37:00.000000000 +0200
+++ libxml2-2.7.3-poll/nanohttp.c	2009-08-10 22:21:47.000000000 +0200
@@ -54,9 +54,13 @@
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
+#ifndef HAVE_POLL_H
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#else
+#include <poll.h>
+#endif
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
@@ -467,6 +471,9 @@
 		**  to retrying.
 		*/
 
+        #ifndef HAVE_POLL_H
+        if (ctxt->fd > FD_SETSIZE) return -1;
+
 		struct timeval	tv;
 		fd_set		wfd;
 
@@ -482,6 +489,11 @@
 #pragma warning(pop)
 #endif
 		(void)select( ctxt->fd + 1, NULL, &wfd, NULL, &tv );
+        #else
+        struct pollfd p;
+        p.fd = ctxt->fd; p.events = POLLOUT;
+        (void)poll(& p, 1, timeout * 1000);
+        #endif /* !HAVE_POLL_H */
 	    }
 	}
     }
@@ -501,8 +513,12 @@
 
 static int
 xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt) {
+    #ifndef HAVE_POLL_H
     fd_set rfd;
     struct timeval tv;
+    #else
+    struct pollfd p;
+    #endif
 
 
     while (ctxt->state & XML_NANO_HTTP_READ) {
@@ -570,6 +586,8 @@
 	    }
 	}
 
+    #ifndef HAVE_POLL_H
+    if (ctxt->fd > FD_SETSIZE) return 0;
 	tv.tv_sec = timeout;
 	tv.tv_usec = 0;
 	FD_ZERO(&rfd);
@@ -583,6 +601,10 @@
 #endif
 	
 	if ( (select(ctxt->fd+1, &rfd, NULL, NULL, &tv)<1)
+    #else
+    p.fd = ctxt->fd; p.events = POLLIN;
+    if ( (poll(& p, 1, timeout * 1000) <1)
+    #endif /* !HAVE_POLL_H */
 #if defined(EINTR)
 		&& (errno != EINTR)
 #endif
@@ -803,11 +825,15 @@
 static int
 xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
 {
+    #ifndef HAVE_POLL_H
     fd_set wfd;
 #ifdef _WINSOCKAPI_
     fd_set xfd;
 #endif
     struct timeval tv;
+    #else
+    struct pollfd p;
+    #endif /* !HAVE_POLL_H */
     int status;
     int addrlen;
     SOCKET s;
@@ -883,7 +909,8 @@
 		return(-1);
 	}
     }	
-    
+
+    #ifndef HAVE_POLL_H
     tv.tv_sec = timeout;
     tv.tv_usec = 0;
 
@@ -891,6 +918,7 @@
 #pragma warning(push)
 #pragma warning(disable: 4018)
 #endif
+    if (s > FD_SETSIZE) return -1;
     FD_ZERO(&wfd);
     FD_SET(s, &wfd);
 
@@ -905,6 +933,10 @@
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
+    #else
+    p.fd = s; p.events = POLLOUT;
+    switch(poll(& p, 1, timeout * 1000))
+    #endif /* !HAVE_POLL_H */
     {
 	case 0:
 	    /* Time out */
@@ -918,10 +950,14 @@
 	    return(-1);
     }
 
+    #ifndef HAVE_POLL_H
     if ( FD_ISSET(s, &wfd)
 #ifdef _WINSOCKAPI_
                            || FD_ISSET(s, &xfd)
 #endif
+    #else
+    if (p.revents == POLLOUT
+    #endif /* !HAVE_POLL_H */
                                                 ) {
 	XML_SOCKLEN_T len;
 	len = sizeof(status);
