aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-28 10:26:29 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-28 10:26:29 +0000
commit6de645c7d1f2dfce6df9823ef599b1bb4ef87d9a (patch)
tree33e7db066ab52df4748a405a03d8a75245d6183d /linux-user
parent55f280c90ed7288b392fcf718efc2d3caca11e91 (diff)
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
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 06d1597650..07652cf163 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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,
int flags, int send)
{
- abi_long ret;
+ abi_long ret, len;
struct target_msghdr *msgp;
struct msghdr msg;
int count;
@@ -1199,8 +1199,12 @@ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
ret = get_errno(sendmsg(fd, &msg, flags));
} else {
ret = get_errno(recvmsg(fd, &msg, flags));
- if (!is_error(ret))
+ if (!is_error(ret)) {
+ len = ret;
ret = host_to_target_cmsg(msgp, &msg);
+ if (!is_error(ret))
+ ret = len;
+ }
}
unlock_iovec(vec, target_vec, count, !send);
unlock_user_struct(msgp, target_msg, send ? 0 : 1);