diff options
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r-- | cpukit/libnetworking/libc/herror.c | 6 | ||||
-rw-r--r-- | cpukit/libnetworking/libc/res_send.c | 7 | ||||
-rw-r--r-- | cpukit/libnetworking/sys/uio.h | 7 |
3 files changed, 12 insertions, 8 deletions
diff --git a/cpukit/libnetworking/libc/herror.c b/cpukit/libnetworking/libc/herror.c index 45ce588569..621da3ec1d 100644 --- a/cpukit/libnetworking/libc/herror.c +++ b/cpukit/libnetworking/libc/herror.c @@ -69,6 +69,8 @@ int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] }; int h_errno; +#define HERROR_USE_WRITEV + /* * herror -- * print the error indicated by the h_errno value. @@ -77,7 +79,7 @@ void herror(s) const char *s; { -#if 0 +#if defined(HERROR_USE_WRITEV) struct iovec iov[4]; register struct iovec *v = iov; @@ -97,7 +99,7 @@ herror(s) writev(STDERR_FILENO, iov, (v - iov) + 1); #else /* - * RTEMS: no writev yet + * no writev implementation available */ if (s && *s) { write (2, s, strlen (s)); diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c index fa04d545b3..5f675a46e4 100644 --- a/cpukit/libnetworking/libc/res_send.c +++ b/cpukit/libnetworking/libc/res_send.c @@ -97,6 +97,9 @@ #include <poll.h> #endif +/* RTEMS now has writev */ +#define USE_WRITEV + #include "res_config.h" #if !defined(__rtems__) @@ -378,7 +381,7 @@ res_send(buf, buflen, ans, anssiz) if (v_circuit) { int truncated; -#if !defined(__rtems__) +#if defined(USE_WRITEV) struct iovec iov[2]; #endif u_short len; @@ -416,7 +419,7 @@ res_send(buf, buflen, ans, anssiz) * Send length & message */ putshort((u_short)buflen, (u_char*)&len); -#if !defined(__rtems__) +#if defined(USE_WRITEV) iov[0].iov_base = (caddr_t)&len; iov[0].iov_len = INT16SZ; iov[1].iov_base = (caddr_t)buf; diff --git a/cpukit/libnetworking/sys/uio.h b/cpukit/libnetworking/sys/uio.h index 4a27faa8fa..5aec197848 100644 --- a/cpukit/libnetworking/sys/uio.h +++ b/cpukit/libnetworking/sys/uio.h @@ -40,12 +40,11 @@ #include <rtems/bsd/sys/cdefs.h> /* - * XXX - * iov_base should be a void *. + * POSIX compliant iovec definition */ struct iovec { - char *iov_base; /* Base address. */ - size_t iov_len; /* Length. */ + void *iov_base; /* pointer to data to be written */ + size_t iov_len; /* length of this data block */ }; #if __BSD_VISIBLE |