Linus Nordberg wrote:
I don't know much about iovecs, but isn't this
a short write?
int tcp_send_msg(int fd, const uint8_t *msg, size_t
msglen)
{
...
int total_len = iov[0].iov_len + iov[1].iov_len;
int sent = writev(fd, iov, 2);
if (sent != total_len) {
return KNOT_ECONN;
}
At least, other daemons have writev() wrappers that handle partial
writes, e.g., "xwritev" in INN:
http://inn.eyrie.org/svn/trunk/lib/xwrite.c
--
Robert Edmonds
edmonds(a)debian.org