fix recvmsg return value
PATCH 1/1 fix recvmsg return value
Recvmsg must return the number of bytes received.
Signature · 2 lines
Lauro Ramos Venancio INdT - Instituto Nokia de Tecnologia
linux-user/syscall.c +6 -2
@@ -1267,7 +1267,7 @@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;
@@ -1308,8 +1308,12 @@ 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); fail: