tprints("}");
}
-void
+int
printsock(struct tcb *tcp, long addr, int addrlen)
{
- sockaddr_buf_t addrbuf;
-
if (addrlen < 2) {
printaddr(addr);
- return;
+ return -1;
}
- if (addrlen > (int) sizeof(addrbuf))
- addrlen = sizeof(addrbuf);
+ union {
+ struct sockaddr sa;
+ struct sockaddr_storage storage;
+ char pad[sizeof(struct sockaddr_storage) + 1];
+ } addrbuf;
+
+ if ((unsigned) addrlen > sizeof(addrbuf.storage))
+ addrlen = sizeof(addrbuf.storage);
- memset(&addrbuf, 0, sizeof(addrbuf));
if (umoven_or_printaddr(tcp, addr, addrlen, addrbuf.pad))
- return;
- addrbuf.pad[sizeof(addrbuf.pad) - 1] = '\0';
+ return -1;
+
+ memset(&addrbuf.pad[addrlen], 0, sizeof(addrbuf.pad) - addrlen);
print_sockaddr(tcp, &addrbuf, addrlen);
+
+ return addrbuf.sa.sa_family;
}
#include "xlat/scmvals.h"
printsock(tcp, (long)msg->msg_name, msg->msg_namelen);
tprintf(", msg_iov(%lu)=", (unsigned long)msg->msg_iovlen);
+
tprint_iov_upto(tcp, (unsigned long)msg->msg_iovlen,
- (unsigned long)msg->msg_iov, 1, data_size);
+ (unsigned long)msg->msg_iov, IOV_DECODE_STR, data_size);
#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
tprintf(", msg_controllen=%lu", (unsigned long)msg->msg_controllen);