From patchwork Mon May 3 17:07:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 51513 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EDAA1B7D1B for ; Tue, 4 May 2010 03:17:09 +1000 (EST) Received: from localhost ([127.0.0.1]:50009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8zFf-00012S-Te for incoming@patchwork.ozlabs.org; Mon, 03 May 2010 13:16:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8z8L-0007dR-LK for qemu-devel@nongnu.org; Mon, 03 May 2010 13:08:41 -0400 Received: from [140.186.70.92] (port=59049 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8z8K-0007d3-HA for qemu-devel@nongnu.org; Mon, 03 May 2010 13:08:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8z8J-0000FO-GQ for qemu-devel@nongnu.org; Mon, 03 May 2010 13:08:40 -0400 Received: from mail-qy0-f188.google.com ([209.85.221.188]:45614) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8z8J-0000FH-Dv for qemu-devel@nongnu.org; Mon, 03 May 2010 13:08:39 -0400 Received: by qyk26 with SMTP id 26so4138413qyk.19 for ; Mon, 03 May 2010 10:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject:date :message-id:x-mailer:in-reply-to:references; bh=Yl9E9WOd2fLcze/ulRaLxu+u06Mu+HZeIFeksBPQ9+M=; b=wx8eHg+FRk6pj4CDeZ9Mkf2uYSOyQ+Zm4yDaSDulP+CCrtcqzjBlT6rMFmckQKwV1I l74OQZjtG8FFy+v3yQvPW9zokV+wAADDfk2MUHGbakEvr3Ck2CQ/LuE8MF7UUQuN7Bbv 5z8whlqlgpJNCJTEotgd0kQ7Jz8KDvhQh2MGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=mjyZbYgaRWE1jtysodtvg0EJ47/ZZI6ANdm3vhrBElfSOY8cYtKSdmdPRPFMh4F54f g5w6DE3J0qO1Rpzd9eOgSGFpuESJ27q6Q0WfuKtDKpqayljaUkwUqTqqy923qsnhjv7p isiCl1SeaHCbczD/gt8ooQT0+qrA7AjOxNDnM= Received: by 10.224.25.203 with SMTP id a11mr3217741qac.104.1272906502649; Mon, 03 May 2010 10:08:22 -0700 (PDT) Received: from localhost.localdomain (are.twiddle.net [75.149.56.221]) by mx.google.com with ESMTPS id 2sm9954190qwi.29.2010.05.03.10.08.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 May 2010 10:08:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 3 May 2010 10:07:49 -0700 Message-Id: <1272906475-14480-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1272906475-14480-1-git-send-email-rth@twiddle.net> References: <1272906475-14480-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 1/7] alpha-linux-user: Fix brk error return. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson --- linux-user/syscall.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 17599eb..81e09b3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -718,9 +718,17 @@ abi_long do_brk(abi_ulong new_brk) PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIVATE, 0, 0)); - if (!is_error(mapped_addr)) +#if defined(TARGET_ALPHA) + /* We (partially) emulate OSF/1 on Alpha, which requires we + return a proper errno, not an unchanged brk value. */ + if (is_error(mapped_addr)) { + return -TARGET_ENOMEM; + } +#endif + + if (!is_error(mapped_addr)) { target_brk = new_brk; - + } return target_brk; }