From patchwork Wed Jun 8 13:30:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 69658 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2518160qgf; Wed, 8 Jun 2016 07:12:22 -0700 (PDT) X-Received: by 10.55.26.219 with SMTP id l88mr4904209qkh.14.1465395142553; Wed, 08 Jun 2016 07:12:22 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n75si766621qgd.77.2016.06.08.07.12.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Jun 2016 07:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAeDV-0000ER-ST for patch@linaro.org; Wed, 08 Jun 2016 10:12:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZr-0004iC-CM for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZp-0005ua-Fp for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:22 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:35757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZo-0005uC-Jx for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:21 -0400 Received: by mail-lf0-x22f.google.com with SMTP id u74so5860340lff.2 for ; Wed, 08 Jun 2016 06:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jrMwxxnr9tgjQ2j0B1AP1ahEedqTPTQG4z3MGUSB9DU=; b=VZ2w7XJVBmewftGLc4FEIwlSNPmM0PcqlK0BXnOgduvFUxey1XBtch3/ZajpxSsgGU xrkXYL2OQx8/EeJAAET5bBmK0cEE/lyGqqs4Fbho8hRDOfwNKrnc+hbly3Wb4+Bmne5A nGt5KX2QgG5KKu8rXGU/h9dPwSa85E/R0ydw4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jrMwxxnr9tgjQ2j0B1AP1ahEedqTPTQG4z3MGUSB9DU=; b=TcWjYd95O3py+fVIMtA7ia3SjVvndaIN2Z3pqzACnDxQ34lEzBt2njVznYyeKHNEXL KgzSsqtA3ePZXw7W8/L8seM5rrLcoeiBpGaVdaqdBZmuT2xAKIgnzsD7PlPB96p/lH3i 2NR4wyDrjnc3zGk5yrGImONHjTs3umAl7yNoAkQwdA4O1KEu6uZTzkQR9pJyUY1aPJib nnc/gxZ9D1Ymiw/PCCH/5l7ItsJsm/y84xXURuRK1Twh/brue/HiwLYesmqtzB7nqD2Z LhP+3BurQDnXY8S9Eq4OiHdfRO2dLkmlSGVIP/M5mN7bHdy24cjISeIhMlu6XoZz5K3S ptkA== X-Gm-Message-State: ALyK8tJbnsw6km2o0pUyvoshb/FIRhZK9HXDkUNygJ6Yl9VgYOZ+NkBPuS5JVxgGKzYM9quV X-Received: by 10.46.71.20 with SMTP id u20mr1403431lja.18.1465392679721; Wed, 08 Jun 2016 06:31:19 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.31.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:31:18 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:30:24 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22f Subject: [Qemu-devel] [PULL 43/44] linux-user: Special-case ERESTARTSYS in target_strerror() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Since TARGET_ERESTARTSYS and TARGET_ESIGRETURN are internal-to-QEMU error numbers, handle them specially in target_strerror(), to avoid confusing strace output like: 9521 rt_sigreturn(14,8,274886297808,8,0,268435456) = -1 errno=513 (Unknown error 513) Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.1.4 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 262c645..bd8095c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -632,6 +632,13 @@ static inline int is_error(abi_long ret) const char *target_strerror(int err) { + if (err == TARGET_ERESTARTSYS) { + return "To be restarted"; + } + if (err == TARGET_QEMU_ESIGRETURN) { + return "Successful exit from sigreturn"; + } + if ((err >= ERRNO_TABLE_SIZE) || (err < 0)) { return NULL; }