Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KulmT-0008Bf-EA for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:26:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KulmR-0008Ae-CK for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:26:32 -0400 Received: from [199.232.76.173] (port=49529 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KulmQ-0008AM-Pr for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:26:31 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56412 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KulmQ-0000Wi-O1 for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:26:30 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KulmP-0000ln-QT for qemu-devel@nongnu.org; Tue, 28 Oct 2008 10:26:29 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KulmP-0000lj-Hu for qemu-devel@nongnu.org; Tue, 28 Oct 2008 10:26:29 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Tue, 28 Oct 2008 10:26:29 +0000 Subject: [Qemu-devel] [5564] Recvmsg must return the number of bytes received ( Lauro Ramos Venancio). Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5564 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5564 Author: balrog Date: 2008-10-28 10:26:29 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Recvmsg must return the number of bytes received (Lauro Ramos Venancio). Modified Paths: -------------- trunk/linux-user/syscall.c Modified: trunk/linux-user/syscall.c =================================================================== --- trunk/linux-user/syscall.c 2008-10-28 10:24:11 UTC (rev 5563) +++ trunk/linux-user/syscall.c 2008-10-28 10:26:29 UTC (rev 5564) @@ -1160,7 +1160,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; @@ -1199,8 +1199,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); unlock_user_struct(msgp, target_msg, send ? 0 : 1);