[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] linux-user/signal.c: define __SIGRTMIN/MAX
From: |
Natanael Copa |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] linux-user/signal.c: define __SIGRTMIN/MAX for non-GNU platforms |
Date: |
Tue, 29 Apr 2014 16:53:58 +0200 |
On Tue, 29 Apr 2014 08:28:29 -0600
Eric Blake <address@hidden> wrote:
> On 04/29/2014 08:17 AM, Natanael Copa wrote:
> > The __SIGRTMIN and __SIGRTMAX are glibc internals and are not available
> > on all platforms, so we define those if they are missing.
> >
> > This is needed for musl libc.
> >
> > Signed-off-by: Natanael Copa <address@hidden>
> > ---
> > linux-user/signal.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/linux-user/signal.c b/linux-user/signal.c
> > index 7d6246f..6019dbb 100644
> > --- a/linux-user/signal.c
> > +++ b/linux-user/signal.c
> > @@ -32,6 +32,13 @@
> >
> > //#define DEBUG_SIGNAL
> >
> > +#ifndef __SIGRTMIN
> > +#define __SIGRTMIN 32
>
> Rather than defining the implementation-specific __SIGRTMIN to a magic
> number that is liable to be wrong, why not instead fix the code to use
> the POSIX-mandated SIGRTMIN and SIGRTMAX public defines instead?
>
Those seems to be runtime values:
/usr/include/signal.h:#define SIGRTMIN (__libc_current_sigrtmin())
/usr/include/signal.h:#define SIGRTMAX (__libc_current_sigrtmax())
so it gives:
/home/ncopa/src/qemu/linux-user/signal.c:93:5: error: nonconstant array index
in initializer
[SIGRTMIN] = __SIGRTMAX,
I could have used (NSIG-1) but are not sure if NSIG is a runtime macro
in glibc. The array itself is using _NSIG instead of NSIG for some
reason.
-nc
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 0/5] fix building with musl libc, Natanael Copa, 2014/04/29
- [Qemu-devel] [PATCH 1/5] util/qemu-openpty: fix build with musl libc by include termios.h as fallback, Natanael Copa, 2014/04/29
- [Qemu-devel] [PATCH 2/5] xen: replace ffsl with ctzl, Natanael Copa, 2014/04/29
- [Qemu-devel] [PATCH 3/5] vhost: replace ffsl with ctzl, Natanael Copa, 2014/04/29
- [Qemu-devel] [PATCH 4/5] exec: replace ffsl with ctzl, Natanael Copa, 2014/04/29
- [Qemu-devel] [PATCH 5/5] linux-user/signal.c: define __SIGRTMIN/MAX for non-GNU platforms, Natanael Copa, 2014/04/29