A recent C run-time update added the poll() function, which we were not
testing for at configuration time. The patch below adds that test to
configure.com. However, the initial appearance of poll() was not
accompanied by poll.h, so the IO extension continues to use its own
home-grown version of poll(), which causes a multiply defined symbol
error at link time. I've remedied that by adding a macro in
ext/IO/poll.h that redefines poll. This is more along the lines of all
the other standard library replacements elsewhere in Perl.


--- configure.com;-0    Fri Mar 14 06:04:04 2003
+++ configure.com       Mon Mar 17 11:45:09 2003
@@ -4050,6 +4050,29 @@
 $ GOSUB inlibc
 $ d_mkdtemp = tmp
 $!
+$! Check for poll
+$!
+$ if i_poll .eqs. "define"
+$ then
+$   OS
+$   WS "#if defined(__DECC) || defined(__DECCXX)"
+$   WS "#include <stdlib.h>"
+$   WS "#endif"
+$   WS "#include <poll.h>"
+$   WS "int main()"
+$   WS "{"
+$   WS "struct pollfd pfd;"
+$   WS "int count=poll(&pfd,1,0);"
+$   WS "exit(0);"
+$   WS "}"
+$   CS
+$   tmp = "poll"
+$   GOSUB inlibc
+$   d_poll = tmp
+$ else
+$   d_poll = "undef"
+$ endif
+$!
 $! Check for setvbuf
 $!
 $ OS
@@ -5356,7 +5379,7 @@
 $ WC "d_perl_otherlibdirs='undef'"
 $ WC "d_phostname='" + d_phostname + "'"
 $ WC "d_pipe='define'"
-$ WC "d_poll='undef'"
+$ WC "d_poll='" + d_poll + "'"
 $ WC "d_procselfexe='undef'"
 $ WC "d_pthread_atfork='undef'"
 $ WC "d_pthread_yield='" + d_pthread_yield + "'"
--- ext/IO/poll.h;-0    Fri Jul 19 17:49:10 2002
+++ ext/IO/poll.h       Mon Mar 17 23:24:08 2003
@@ -20,6 +20,11 @@
 
 #define EMULATE_POLL_WITH_SELECT
 
+#ifdef poll
+# undef poll
+#endif
+#define poll Perl_my_poll
+
 typedef struct pollfd {
     int fd;
     short events;

Reply via email to