Recvmsg must return the number of bytes received (Lauro Ramos Venancio).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5564 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
55f280c90e
commit
6de645c7d1
@ -1160,7 +1160,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr,
|
|||||||
static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
|
static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
|
||||||
int flags, int send)
|
int flags, int send)
|
||||||
{
|
{
|
||||||
abi_long ret;
|
abi_long ret, len;
|
||||||
struct target_msghdr *msgp;
|
struct target_msghdr *msgp;
|
||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
int count;
|
int count;
|
||||||
@ -1199,8 +1199,12 @@ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
|
|||||||
ret = get_errno(sendmsg(fd, &msg, flags));
|
ret = get_errno(sendmsg(fd, &msg, flags));
|
||||||
} else {
|
} else {
|
||||||
ret = get_errno(recvmsg(fd, &msg, flags));
|
ret = get_errno(recvmsg(fd, &msg, flags));
|
||||||
if (!is_error(ret))
|
if (!is_error(ret)) {
|
||||||
|
len = ret;
|
||||||
ret = host_to_target_cmsg(msgp, &msg);
|
ret = host_to_target_cmsg(msgp, &msg);
|
||||||
|
if (!is_error(ret))
|
||||||
|
ret = len;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
unlock_iovec(vec, target_vec, count, !send);
|
unlock_iovec(vec, target_vec, count, !send);
|
||||||
unlock_user_struct(msgp, target_msg, send ? 0 : 1);
|
unlock_user_struct(msgp, target_msg, send ? 0 : 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user