On Tue, Aug 30, 2016 at 4:45 PM, Benoit Canet <
[email protected]> wrote:

> The last signal of the list didn't have enough room for
> him because signal numbers start at 1.
> Make him some room so sigaction won't fail for him
> when go lib execute.
>


We have a bunch of other places which keep arrays of length nsignals,
iterate until < nsignals, and so on.
I think we will also need to fix all of those, or the signal 64 won't be
supported properly?

Alternatively, why not, much more simply, just change nsignals from 64 to
65, with no other change? This will allow all the signals up to, and
including, the number 64.


>
> Reviewed-by: BenoĆ®t Canet <[email protected]>
>

You mean Signed-off-by?


> ---
>  libc/signal.cc | 4 ++--
>  libc/signal.hh | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libc/signal.cc b/libc/signal.cc
> index 66b9fc7..f42baf6 100644
> --- a/libc/signal.cc
> +++ b/libc/signal.cc
> @@ -33,7 +33,7 @@ __thread __attribute__((aligned(sizeof(sigset))))
>  // pending signal changes: returning any one is fine
>  __thread int thread_pending_signal;
>
> -struct sigaction signal_actions[nsignals];
> +struct sigaction signal_actions[nsignals + 1];
>
>  sigset* from_libc(sigset_t* s)
>  {
> @@ -216,7 +216,7 @@ int sigprocmask(int how, const sigset_t* _set,
> sigset_t* _oldset)
>  int sigaction(int signum, const struct sigaction* act, struct sigaction*
> oldact)
>  {
>      // FIXME: We do not support any sa_flags besides SA_SIGINFO.
> -    if (signum < 0 || signum >= (int)nsignals) {
> +    if (signum < 0 || signum > (int)nsignals) {
>          errno = EINVAL;
>          return -1;
>      }
> diff --git a/libc/signal.hh b/libc/signal.hh
> index 0699b80..0549ad6 100644
> --- a/libc/signal.hh
> +++ b/libc/signal.hh
> @@ -20,7 +20,7 @@ struct sigset {
>      std::bitset<nsignals> mask;
>  };
>
> -extern struct sigaction signal_actions[nsignals];
> +extern struct sigaction signal_actions[nsignals + 1];
>
>  sigset* from_libc(sigset_t* s);
>  const sigset* from_libc(const sigset_t* s);
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to