[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 18/18] linux-user: Special-case ERESTARTSYS in t
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH 18/18] linux-user: Special-case ERESTARTSYS in target_strerror() |
Date: |
Tue, 7 Jun 2016 21:53:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
Le 06/06/2016 à 20:58, Peter Maydell a écrit :
> 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 <address@hidden>
> ---
> 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;
> }
This is not the aim of this patch, but target_to_host_errno() has now
these checks, perhaps we can remove this while we are here...
Laurent
- [Qemu-devel] [PATCH 12/18] linux-user: Use safe_syscall wrapper for accept and accept4 syscalls, (continued)
- [Qemu-devel] [PATCH 08/18] linux-user: Use safe_syscall wrapper for sleep syscalls, Peter Maydell, 2016/06/06
- [Qemu-devel] [PATCH 05/18] linux-user: Use safe_syscall wrapper for mq_timedsend and mq_timedreceive, Peter Maydell, 2016/06/06
- [Qemu-devel] [PATCH 03/18] linux-user: Use safe_syscall wrapper for send* and recv* syscalls, Peter Maydell, 2016/06/06
- [Qemu-devel] [PATCH 18/18] linux-user: Special-case ERESTARTSYS in target_strerror(), Peter Maydell, 2016/06/06
- Re: [Qemu-devel] [PATCH 18/18] linux-user: Special-case ERESTARTSYS in target_strerror(),
Laurent Vivier <=
- Re: [Qemu-devel] [PATCH 00/18] linux-user: Extend safe_syscall wrapper use, Riku Voipio, 2016/06/08