Skip to content

Commit

Permalink
[roscpp] add missing header for writev().
Browse files Browse the repository at this point in the history
After an update of gcc and glibc roscpp started to fail builds with the error:

    /home/rojkov/work/ros/build/tmp-glibc/work/i586-oe-linux/roscpp/1.11.21-r0/ros_comm-1.11.21/clients/roscpp/src/libros/transport/transport_udp.cpp:579:25: error: 'writev' was not declared in this scope
         ssize_t num_bytes = writev(sock_, iov, 2);
                             ^~~~~~

According to POSIX.1-2001 the function writev() is declared in sys/uio.h.

The patch includes the missing header for POSIX compliant systems.
  • Loading branch information
Dmitry Rozhkov authored and dirk-thomas committed Oct 25, 2017
1 parent 720f610 commit daa9dac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clients/roscpp/src/libros/transport/transport_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
#elif defined(__ANDROID__)
// For readv() and writev() on ANDROID
#include <sys/uio.h>
#elif defined(_POSIX_VERSION)
// For readv() and writev()
#include <sys/uio.h>
#endif

namespace ros
Expand Down

0 comments on commit daa9dac

Please sign in to comment.