From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nz3di-0003rX-5z for qemu-devel@nongnu.org; Tue, 06 Apr 2010 03:56:02 -0400 Received: from [140.186.70.92] (port=36452 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nz3dg-0003qx-8B for qemu-devel@nongnu.org; Tue, 06 Apr 2010 03:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nz3de-00034s-PY for qemu-devel@nongnu.org; Tue, 06 Apr 2010 03:56:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17076) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nz3de-00034n-9w for qemu-devel@nongnu.org; Tue, 06 Apr 2010 03:55:58 -0400 Date: Tue, 6 Apr 2010 13:24:28 +0530 From: Amit Shah Message-ID: <20100406075428.GI4135@amit-x200.redhat.com> References: <1270471538-31275-1-git-send-email-amit.shah@redhat.com> <1270471538-31275-2-git-send-email-amit.shah@redhat.com> <4BBAE587.1070003@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BBAE587.1070003@redhat.com> Subject: [Qemu-devel] Re: [PATCH 1/5] char: Let the caller know how many bytes were written in case of incomplete writes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu list , Juan Quintela On (Tue) Apr 06 2010 [09:40:55], Gerd Hoffmann wrote: > Hi, > >> Make 'len' a pointer instead, and indicate how much of the string was >> written. The return value will either be the same as 'len' or a negative >> number indicating an error condition. > > I would follow the unix write syscall semantic here and report the > number of written bytes using the return value. Matter of taste though. Yeah; some re-org in the write() calls in qemu-char would be needed to do that, but yes, that can be done too. Amit