diff -r -u boost_1_38_0/boost/asio/detail/descriptor_ops.hpp boost_1_38_vxworks/boost/asio/detail/descriptor_ops.hpp
|
old
|
new
|
|
| 50 | 50 | inline int open(const char* path, int flags, boost::system::error_code& ec) |
| 51 | 51 | { |
| 52 | 52 | clear_error(ec); |
| | 53 | #if defined(__VXWORKS__) && defined(_WRS_KERNEL) |
| | 54 | return error_wrapper(::open(path, flags, 0), ec); |
| | 55 | #else |
| 53 | 56 | return error_wrapper(::open(path, flags), ec); |
| | 57 | #endif |
| 54 | 58 | } |
| 55 | 59 | |
| 56 | 60 | inline int close(int d, boost::system::error_code& ec) |
| … |
… |
|
| 95 | 99 | boost::system::error_code& ec) |
| 96 | 100 | { |
| 97 | 101 | clear_error(ec); |
| | 102 | #if defined(__VXWORKS__) |
| | 103 | return error_wrapper(::writev(d, const_cast<buf*>(bufs), static_cast<int>(count)), ec); |
| | 104 | #else |
| 98 | 105 | return error_wrapper(::writev(d, bufs, static_cast<int>(count)), ec); |
| | 106 | #endif |
| 99 | 107 | } |
| 100 | 108 | |
| 101 | 109 | inline int ioctl(int d, long cmd, ioctl_arg_type* arg, |
| 102 | 110 | boost::system::error_code& ec) |
| 103 | 111 | { |
| 104 | 112 | clear_error(ec); |
| | 113 | #if defined(__VXWORKS__) && defined(_WRS_KERNEL) |
| | 114 | return error_wrapper(::ioctl(d, cmd, (int)arg), ec); |
| | 115 | #else |
| 105 | 116 | return error_wrapper(::ioctl(d, cmd, arg), ec); |
| | 117 | #endif |
| 106 | 118 | } |
| 107 | 119 | |
| 108 | 120 | 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
|
old
|
new
|
|
| 23 | 23 | #include <boost/system/system_error.hpp> |
| 24 | 24 | #include <boost/asio/detail/pop_options.hpp> |
| 25 | 25 | |
| 26 | | #if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) |
| | 26 | #if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) && !defined(__VXWORKS__) |
| 27 | 27 | |
| 28 | 28 | #include <boost/asio/detail/push_options.hpp> |
| 29 | 29 | #include <fcntl.h> |
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
|
old
|
new
|
|
| 29 | 29 | namespace asio { |
| 30 | 30 | namespace detail { |
| 31 | 31 | |
| 32 | | #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) |
| | 32 | #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__VXWORKS__) |
| 33 | 33 | typedef socket_select_interrupter select_interrupter; |
| 34 | 34 | #elif defined(BOOST_ASIO_HAS_EVENTFD) |
| 35 | 35 | 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
|
old
|
new
|
|
| 40 | 40 | struct msghdr { int msg_namelen; }; |
| 41 | 41 | #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) |
| 42 | 42 | |
| | 43 | #if defined(__VXWORKS__) |
| | 44 | // vxworks has strange function definitions, uses int instead of socklen_t (which is unsigned) |
| | 45 | # define SockLenTypeImpl int |
| | 46 | #else |
| | 47 | # define SockLenTypeImpl SockLenType |
| | 48 | #endif |
| | 49 | |
| | 50 | |
| 43 | 51 | #if defined(__hpux) |
| 44 | 52 | // HP-UX doesn't declare these functions extern "C", so they are declared again |
| 45 | 53 | // here to avoid linker errors about undefined symbols. |
| … |
… |
|
| 75 | 83 | inline socket_type call_accept(SockLenType msghdr::*, |
| 76 | 84 | socket_type s, socket_addr_type* addr, std::size_t* addrlen) |
| 77 | 85 | { |
| 78 | | SockLenType tmp_addrlen = addrlen ? (SockLenType)*addrlen : 0; |
| | 86 | SockLenTypeImpl tmp_addrlen = addrlen ? (SockLenTypeImpl)*addrlen : 0; |
| 79 | 87 | socket_type result = ::accept(s, addr, addrlen ? &tmp_addrlen : 0); |
| 80 | 88 | if (addrlen) |
| 81 | 89 | *addrlen = (std::size_t)tmp_addrlen; |
| … |
… |
|
| 114 | 122 | inline int call_bind(SockLenType msghdr::*, |
| 115 | 123 | socket_type s, const socket_addr_type* addr, std::size_t addrlen) |
| 116 | 124 | { |
| 117 | | return ::bind(s, addr, (SockLenType)addrlen); |
| | 125 | return ::bind(s, const_cast<socket_addr_type*>(addr), (SockLenTypeImpl)addrlen); |
| 118 | 126 | } |
| 119 | 127 | |
| 120 | 128 | inline int bind(socket_type s, const socket_addr_type* addr, |
| … |
… |
|
| 158 | 166 | inline int call_connect(SockLenType msghdr::*, |
| 159 | 167 | socket_type s, const socket_addr_type* addr, std::size_t addrlen) |
| 160 | 168 | { |
| 161 | | return ::connect(s, addr, (SockLenType)addrlen); |
| | 169 | return ::connect(s, const_cast<socket_addr_type*>(addr), (SockLenTypeImpl)addrlen); |
| 162 | 170 | } |
| 163 | 171 | |
| 164 | 172 | inline int connect(socket_type s, const socket_addr_type* addr, |
| … |
… |
|
| 177 | 185 | inline int socketpair(int af, int type, int protocol, |
| 178 | 186 | socket_type sv[2], boost::system::error_code& ec) |
| 179 | 187 | { |
| 180 | | #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) |
| | 188 | #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__VXWORKS__) |
| 181 | 189 | (void)(af); |
| 182 | 190 | (void)(type); |
| 183 | 191 | (void)(protocol); |
| … |
… |
|
| 418 | 426 | socket_type s, int level, int optname, |
| 419 | 427 | const void* optval, std::size_t optlen) |
| 420 | 428 | { |
| | 429 | #if defined(__VXWORKS__) |
| 421 | 430 | return ::setsockopt(s, level, optname, |
| 422 | | (const char*)optval, (SockLenType)optlen); |
| | 431 | (char*)optval, (SockLenTypeImpl)optlen); |
| | 432 | #else |
| | 433 | return ::setsockopt(s, level, optname, |
| | 434 | (const char*)optval, (SockLenTypeImpl)optlen); |
| | 435 | #endif // defined(__VXWORKS__) |
| 423 | 436 | } |
| 424 | 437 | |
| 425 | 438 | inline int setsockopt(socket_type s, int level, int optname, |
| … |
… |
|
| 465 | 478 | socket_type s, int level, int optname, |
| 466 | 479 | void* optval, std::size_t* optlen) |
| 467 | 480 | { |
| 468 | | SockLenType tmp_optlen = (SockLenType)*optlen; |
| | 481 | SockLenTypeImpl tmp_optlen = (SockLenTypeImpl)*optlen; |
| 469 | 482 | int result = ::getsockopt(s, level, optname, (char*)optval, &tmp_optlen); |
| 470 | 483 | *optlen = (std::size_t)tmp_optlen; |
| 471 | 484 | return result; |
| … |
… |
|
| 552 | 565 | inline int call_getpeername(SockLenType msghdr::*, |
| 553 | 566 | socket_type s, socket_addr_type* addr, std::size_t* addrlen) |
| 554 | 567 | { |
| 555 | | SockLenType tmp_addrlen = (SockLenType)*addrlen; |
| | 568 | SockLenTypeImpl tmp_addrlen = (SockLenTypeImpl)*addrlen; |
| 556 | 569 | int result = ::getpeername(s, addr, &tmp_addrlen); |
| 557 | 570 | *addrlen = (std::size_t)tmp_addrlen; |
| 558 | 571 | return result; |
| … |
… |
|
| 575 | 588 | inline int call_getsockname(SockLenType msghdr::*, |
| 576 | 589 | socket_type s, socket_addr_type* addr, std::size_t* addrlen) |
| 577 | 590 | { |
| 578 | | SockLenType tmp_addrlen = (SockLenType)*addrlen; |
| | 591 | SockLenTypeImpl tmp_addrlen = (SockLenTypeImpl)*addrlen; |
| 579 | 592 | int result = ::getsockname(s, addr, &tmp_addrlen); |
| 580 | 593 | *addrlen = (std::size_t)tmp_addrlen; |
| 581 | 594 | return result; |
| … |
… |
|
| 603 | 616 | if (result == 0) |
| 604 | 617 | clear_error(ec); |
| 605 | 618 | return result; |
| 606 | | #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__) |
| | 619 | #elif defined(__VXWORKS__) && defined(_WRS_KERNEL) |
| | 620 | return error_wrapper(::ioctl(s, cmd, (int)arg), ec); |
| | 621 | #else // defined(__VXWORKS__) |
| 607 | 622 | return error_wrapper(::ioctl(s, cmd, arg), ec); |
| 608 | | #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) |
| | 623 | #endif |
| 609 | 624 | } |
| 610 | 625 | |
| 611 | 626 | 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
|
old
|
new
|
|
| 92 | 92 | # endif // defined(_MSC_VER) || defined(__BORLANDC__) |
| 93 | 93 | # endif // !defined(BOOST_ASIO_NO_DEFAULT_LINKED_LIBS) |
| 94 | 94 | # include <boost/asio/detail/old_win_sdk_compat.hpp> |
| | 95 | #elif defined(__VXWORKS__) |
| | 96 | # include <sys/ioctl.h> |
| | 97 | # include <poll.h> |
| | 98 | # include <sys/types.h> |
| | 99 | # include <selectLib.h> |
| | 100 | # include <sys/socket.h> |
| | 101 | # include <sockLib.h> |
| | 102 | # include <ioLib.h> |
| | 103 | # include <hostLib.h> |
| | 104 | # include <net/uio.h> |
| | 105 | # include <sys/un.h> |
| | 106 | # include <netinet/in.h> |
| | 107 | # include <netinet/tcp.h> |
| | 108 | # include <arpa/inet.h> |
| | 109 | # include <netdb.h> |
| | 110 | # include <net/if.h> |
| | 111 | # include <limits.h> |
| | 112 | // vxworks has some really braindead macros defined |
| | 113 | #ifdef m_flags |
| | 114 | # undef m_flags |
| | 115 | #endif |
| | 116 | #ifdef m_data |
| | 117 | # undef m_data |
| | 118 | #endif |
| | 119 | |
| 95 | 120 | #else |
| 96 | 121 | # include <sys/ioctl.h> |
| 97 | 122 | # include <sys/poll.h> |