From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQKsI-00022W-2J for qemu-devel@nongnu.org; Fri, 23 Jan 2009 07:11:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQKsG-0001ya-9s for qemu-devel@nongnu.org; Fri, 23 Jan 2009 07:11:01 -0500 Received: from [199.232.76.173] (port=35952 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQKsG-0001yN-6z for qemu-devel@nongnu.org; Fri, 23 Jan 2009 07:11:00 -0500 Received: from mx2.redhat.com ([66.187.237.31]:36795) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQKsF-0005A1-O4 for qemu-devel@nongnu.org; Fri, 23 Jan 2009 07:11:00 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0NCAwFn011001 for ; Fri, 23 Jan 2009 07:10:58 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0NCAxea022665 for ; Fri, 23 Jan 2009 07:10:59 -0500 Received: from zweiblum.travel.kraxel.org (vpn-10-167.str.redhat.com [10.32.10.167]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0NCAurf006238 for ; Fri, 23 Jan 2009 07:10:58 -0500 Message-ID: <4979B3CD.3000302@redhat.com> Date: Fri, 23 Jan 2009 13:10:53 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060701080805070405060104" Subject: [Qemu-devel] [patch] unbreak linux-user builds 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 This is a multi-part message in MIME format. --------------060701080805070405060104 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit $subject says all please apply, Gerd --------------060701080805070405060104 Content-Type: text/plain; name="0001-linux-user-add-qemu_realloc-implementation-to-unb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-linux-user-add-qemu_realloc-implementation-to-unb.patch" >>From b0dbc4afae21c0f8fb9c6ec509fd07515307fc6d Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 23 Jan 2009 12:49:00 +0100 Subject: [PATCH 1/3] linux-user: add qemu_realloc() implementation to unbreak the build. Signed-off-by: Gerd Hoffmann --- linux-user/mmap.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 8e81cde..d0fc3e3 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -123,6 +123,19 @@ void qemu_free(void *ptr) munmap(p, *p); } +void *qemu_realloc(void *ptr, size_t size) +{ + size_t old_size, copy; + void *new_ptr; + + old_size = *(size_t *)((char *)ptr - 16); + copy = old_size < size ? old_size : size; + new_ptr = qemu_malloc(size); + memcpy(new_ptr, ptr, copy); + qemu_free(ptr); + return new_ptr; +} + /* NOTE: all the constants are the HOST ones, but addresses are target. */ int target_mprotect(abi_ulong start, abi_ulong len, int prot) { -- 1.6.1 --------------060701080805070405060104--