diff -r -u boost_1_38_0/boost/asio/detail/descriptor_ops.hpp boost_1_38_vxworks/boost/asio/detail/descriptor_ops.hpp --- boost_1_38_0/boost/asio/detail/descriptor_ops.hpp 2008-10-09 01:41:50.000000000 -0400 +++ boost_1_38_vxworks/boost/asio/detail/descriptor_ops.hpp 2009-04-18 15:35:31.492875000 -0400 @@ -50,7 +50,11 @@ inline int open(const char* path, int flags, boost::system::error_code& ec) { clear_error(ec); +#if defined(__VXWORKS__) && defined(_WRS_KERNEL) + return error_wrapper(::open(path, flags, 0), ec); +#else return error_wrapper(::open(path, flags), ec); +#endif } inline int close(int d, boost::system::error_code& ec) @@ -95,14 +99,22 @@ boost::system::error_code& ec) { clear_error(ec); +#if defined(__VXWORKS__) + return error_wrapper(::writev(d, const_cast(bufs), static_cast(count)), ec); +#else return error_wrapper(::writev(d, bufs, static_cast(count)), ec); +#endif } inline int ioctl(int d, long cmd, ioctl_arg_type* arg, boost::system::error_code& ec) { clear_error(ec); +#if defined(__VXWORKS__) && defined(_WRS_KERNEL) + return error_wrapper(::ioctl(d, cmd, (int)arg), ec); +#else return error_wrapper(::ioctl(d, cmd, arg), ec); +#endif } inline int fcntl(int d, long cmd, boost::system::error_code& ec) diff -r -u boost_1_38_0/boost/asio/detail/pipe_select_interrupter.hpp boost_1_38_vxworks/boost/asio/detail/pipe_select_interrupter.hpp --- boost_1_38_0/boost/asio/detail/pipe_select_interrupter.hpp 2009-02-04 00:22:44.000000000 -0500 +++ boost_1_38_vxworks/boost/asio/detail/pipe_select_interrupter.hpp 2009-04-18 15:11:00.446000000 -0400 @@ -23,7 +23,7 @@ #include #include -#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) +#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) && !defined(__VXWORKS__) #include #include Only in boost_1_38_vxworks/boost/asio/detail: pipe_select_interrupter.hpp.rej diff -r -u boost_1_38_0/boost/asio/detail/select_interrupter.hpp boost_1_38_vxworks/boost/asio/detail/select_interrupter.hpp --- boost_1_38_0/boost/asio/detail/select_interrupter.hpp 2008-10-09 01:41:50.000000000 -0400 +++ boost_1_38_vxworks/boost/asio/detail/select_interrupter.hpp 2009-04-18 15:11:00.446000000 -0400 @@ -29,7 +29,7 @@ namespace asio { namespace detail { -#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__VXWORKS__) typedef socket_select_interrupter select_interrupter; #elif defined(BOOST_ASIO_HAS_EVENTFD) typedef eventfd_select_interrupter select_interrupter; Only in boost_1_38_vxworks/boost/asio/detail: select_interrupter.hpp.rej diff -r -u boost_1_38_0/boost/asio/detail/socket_ops.hpp boost_1_38_vxworks/boost/asio/detail/socket_ops.hpp --- boost_1_38_0/boost/asio/detail/socket_ops.hpp 2009-02-04 00:22:44.000000000 -0500 +++ boost_1_38_vxworks/boost/asio/detail/socket_ops.hpp 2009-04-18 16:02:31.664750000 -0400 @@ -40,6 +40,14 @@ struct msghdr { int msg_namelen; }; #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#if defined(__VXWORKS__) + // vxworks has strange function definitions, uses int instead of socklen_t (which is unsigned) +# define SockLenTypeImpl int +#else +# define SockLenTypeImpl SockLenType +#endif + + #if defined(__hpux) // HP-UX doesn't declare these functions extern "C", so they are declared again // here to avoid linker errors about undefined symbols. @@ -75,7 +83,7 @@ inline socket_type call_accept(SockLenType msghdr::*, socket_type s, socket_addr_type* addr, std::size_t* addrlen) { - SockLenType tmp_addrlen = addrlen ? (SockLenType)*addrlen : 0; + SockLenTypeImpl tmp_addrlen = addrlen ? (SockLenTypeImpl)*addrlen : 0; socket_type result = ::accept(s, addr, addrlen ? &tmp_addrlen : 0); if (addrlen) *addrlen = (std::size_t)tmp_addrlen; @@ -114,7 +122,7 @@ inline int call_bind(SockLenType msghdr::*, socket_type s, const socket_addr_type* addr, std::size_t addrlen) { - return ::bind(s, addr, (SockLenType)addrlen); + return ::bind(s, const_cast(addr), (SockLenTypeImpl)addrlen); } inline int bind(socket_type s, const socket_addr_type* addr, @@ -158,7 +166,7 @@ inline int call_connect(SockLenType msghdr::*, socket_type s, const socket_addr_type* addr, std::size_t addrlen) { - return ::connect(s, addr, (SockLenType)addrlen); + return ::connect(s, const_cast(addr), (SockLenTypeImpl)addrlen); } inline int connect(socket_type s, const socket_addr_type* addr, @@ -177,7 +185,7 @@ inline int socketpair(int af, int type, int protocol, socket_type sv[2], boost::system::error_code& ec) { -#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__VXWORKS__) (void)(af); (void)(type); (void)(protocol); @@ -418,8 +426,13 @@ socket_type s, int level, int optname, const void* optval, std::size_t optlen) { +#if defined(__VXWORKS__) return ::setsockopt(s, level, optname, - (const char*)optval, (SockLenType)optlen); + (char*)optval, (SockLenTypeImpl)optlen); +#else + return ::setsockopt(s, level, optname, + (const char*)optval, (SockLenTypeImpl)optlen); +#endif // defined(__VXWORKS__) } inline int setsockopt(socket_type s, int level, int optname, @@ -465,7 +478,7 @@ socket_type s, int level, int optname, void* optval, std::size_t* optlen) { - SockLenType tmp_optlen = (SockLenType)*optlen; + SockLenTypeImpl tmp_optlen = (SockLenTypeImpl)*optlen; int result = ::getsockopt(s, level, optname, (char*)optval, &tmp_optlen); *optlen = (std::size_t)tmp_optlen; return result; @@ -552,7 +565,7 @@ inline int call_getpeername(SockLenType msghdr::*, socket_type s, socket_addr_type* addr, std::size_t* addrlen) { - SockLenType tmp_addrlen = (SockLenType)*addrlen; + SockLenTypeImpl tmp_addrlen = (SockLenTypeImpl)*addrlen; int result = ::getpeername(s, addr, &tmp_addrlen); *addrlen = (std::size_t)tmp_addrlen; return result; @@ -575,7 +588,7 @@ inline int call_getsockname(SockLenType msghdr::*, socket_type s, socket_addr_type* addr, std::size_t* addrlen) { - SockLenType tmp_addrlen = (SockLenType)*addrlen; + SockLenTypeImpl tmp_addrlen = (SockLenTypeImpl)*addrlen; int result = ::getsockname(s, addr, &tmp_addrlen); *addrlen = (std::size_t)tmp_addrlen; return result; @@ -603,9 +616,11 @@ if (result == 0) clear_error(ec); return result; -#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#elif defined(__VXWORKS__) && defined(_WRS_KERNEL) + return error_wrapper(::ioctl(s, cmd, (int)arg), ec); +#else // defined(__VXWORKS__) return error_wrapper(::ioctl(s, cmd, arg), ec); -#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#endif } inline int select(int nfds, fd_set* readfds, fd_set* writefds, diff -r -u boost_1_38_0/boost/asio/detail/socket_types.hpp boost_1_38_vxworks/boost/asio/detail/socket_types.hpp --- boost_1_38_0/boost/asio/detail/socket_types.hpp 2009-02-04 00:22:44.000000000 -0500 +++ boost_1_38_vxworks/boost/asio/detail/socket_types.hpp 2009-04-18 16:07:14.977250000 -0400 @@ -92,6 +92,31 @@ # endif // defined(_MSC_VER) || defined(__BORLANDC__) # endif // !defined(BOOST_ASIO_NO_DEFAULT_LINKED_LIBS) # include +#elif defined(__VXWORKS__) +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +// vxworks has some really braindead macros defined +#ifdef m_flags +# undef m_flags +#endif +#ifdef m_data +# undef m_data +#endif + #else # include # include Only in boost_1_38_vxworks/boost/asio/detail: socket_types.hpp.rej