From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Peter Maydell Date: Mon, 6 Jun 2016 19:58:19 +0100 Message-Id: <1465239499-5048-19-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1465239499-5048-1-git-send-email-peter.maydell@linaro.org> References: <1465239499-5048-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 18/18] linux-user: Special-case ERESTARTSYS in target_strerror() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Laurent Vivier 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; } -- 1.9.1