aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-05-31 14:41:57 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-06 19:10:37 +0100
commita9662f2efdf27e225c0bf3d85076569e13b3849a (patch)
treeaaf224e5d4b6bb81bf9c72e1a00256b0c816cd0f
parent95902cb84f433095b21560e5ff2c0f05f9c0d8e8 (diff)
linux-user: Special-case ERESTARTSYS in target_strerror()sigrace-fixes-3
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 <peter.maydell@linaro.org>
-rw-r--r--linux-user/syscall.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bcee02dfe8..782d475f7c 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;
}