[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal pending |
Date: |
Fri, 11 Sep 2015 15:37:34 +0100 |
On 6 September 2015 at 00:57, Timothy E Baldwin
<address@hidden> wrote:
> Signed-off-by: Timothy Edward Baldwin <address@hidden>
> ---
> linux-user/signal.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index 15bd082..fc37f3b 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -629,7 +629,7 @@ out:
> return ret;
> }
>
> -/* do_sigaction() return host values and errnos */
> +/* do_sigaction() return target values and host errnos */
> int do_sigaction(int sig, const struct target_sigaction *act,
> struct target_sigaction *oact)
> {
> @@ -638,8 +638,14 @@ int do_sigaction(int sig, const struct target_sigaction
> *act,
> int host_sig;
> int ret = 0;
>
> - if (sig < 1 || sig > TARGET_NSIG || sig == TARGET_SIGKILL || sig ==
> TARGET_SIGSTOP)
> - return -EINVAL;
> + if (sig < 1 || sig > TARGET_NSIG || sig == TARGET_SIGKILL || sig ==
> TARGET_SIGSTOP) {
> + return -TARGET_EINVAL;
> + }
> +
> + if (block_signals()) {
> + return -TARGET_ERESTARTSYS;
> + }
> +
> k = &sigact_table[sig - 1];
> #if defined(DEBUG_SIGNAL)
> fprintf(stderr, "sigaction sig=%d act=0x%p, oact=0x%p\n",
This doesn't look right -- we change this function from returning
host errnos to returning guest errnos, but we haven't changed any
of its callers.
thanks
-- PMM
- [Qemu-devel] [PATCH 13/34] linux-user: Fix signal before blocking system calls race and SA_RESTART, (continued)
- [Qemu-devel] [PATCH 13/34] linux-user: Fix signal before blocking system calls race and SA_RESTART, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 30/34] linux-user: Support for restarting system calls for OpenRISC targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 29/34] linux-user: Support for restarting system calls for UniCore32 targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 12/34] linux-user: Support for restarting system calls for APLHA targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal pending, Timothy E Baldwin, 2015/09/05
- Re: [Qemu-devel] [PATCH 28/34] linux-user: Restart sigaction() if signal pending,
Peter Maydell <=
- [Qemu-devel] [PATCH 23/34] linux-user: Queue synchronous signals separately, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 32/34] linux-user: Support for restarting system calls for S390 targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 22/34] linux-user: Remove real-time signal queuing, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 33/34] linux-user: Support for restarting system calls for CRIS targets, Timothy E Baldwin, 2015/09/05
[Qemu-devel] [PATCH 18/34] linux-user: Fix race between multiple signals, Timothy E Baldwin, 2015/09/05