Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2007-10-21 03:09:20


Author: chris_kohlhoff
Date: 2007-10-21 03:09:19 EDT (Sun, 21 Oct 2007)
New Revision: 40259
URL: http://svn.boost.org/trac/boost/changeset/40259

Log:
On HP-UX use pselect() rather than select() to avoid weirdness where
different select() prototypes are declared depending on the order the
system headers are included.

Text files modified:
   trunk/boost/asio/detail/socket_ops.hpp | 9 +++++++++
   1 files changed, 9 insertions(+), 0 deletions(-)

Modified: trunk/boost/asio/detail/socket_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_ops.hpp (original)
+++ trunk/boost/asio/detail/socket_ops.hpp 2007-10-21 03:09:19 EDT (Sun, 21 Oct 2007)
@@ -549,8 +549,17 @@
       && timeout->tv_usec > 0 && timeout->tv_usec < 1000)
     timeout->tv_usec = 1000;
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+
+#if defined(__hpux)
+ timespec ts;
+ ts.tv_sec = timeout ? timeout->tv_sec : 0;
+ ts.tv_nsec = timeout ? timeout->tv_usec * 1000 : 0;
+ return error_wrapper(::pselect(nfds, readfds,
+ writefds, exceptfds, timeout ? &ts : 0, 0), ec);
+#else
   return error_wrapper(::select(nfds, readfds,
         writefds, exceptfds, timeout), ec);
+#endif
 }
 
 inline int poll_read(socket_type s, boost::system::error_code& ec)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk