From patchwork Mon Jun 6 18:58:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9159069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ACA9E60573 for ; Mon, 6 Jun 2016 19:39:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C36028355 for ; Mon, 6 Jun 2016 19:39:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FB2B2835B; Mon, 6 Jun 2016 19:39:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3462B28355 for ; Mon, 6 Jun 2016 19:39:43 +0000 (UTC) Received: from localhost ([::1]:45256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bA0NC-0006hf-Hn for patchwork-qemu-devel@patchwork.kernel.org; Mon, 06 Jun 2016 15:39:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bA09X-0002yo-7g for qemu-devel@nongnu.org; Mon, 06 Jun 2016 15:25:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bA09V-0004jK-H1 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 15:25:34 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:57594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bA09V-0004j6-9u for qemu-devel@nongnu.org; Mon, 06 Jun 2016 15:25:33 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1b9zjK-0008TP-9J; Mon, 06 Jun 2016 19:58:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 6 Jun 2016 19:58:19 +0100 Message-Id: <1465239499-5048-19-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465239499-5048-1-git-send-email-peter.maydell@linaro.org> References: <1465239499-5048-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 18/18] 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: Riku Voipio , Laurent Vivier , patches@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- linux-user/syscall.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bcee02d..782d475 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -619,6 +619,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; }