* [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN
@ 2022-04-25 9:21 Richard Palethorpe via ltp
2022-04-25 9:35 ` Cyril Hrubis
0 siblings, 1 reply; 6+ messages in thread
From: Richard Palethorpe via ltp @ 2022-04-25 9:21 UTC (permalink / raw)
To: ltp; +Cc: Richard Palethorpe
The minimum real-time signal is always 32 according to
signal(7). Meanwhile __SIGRTMIN is not defined in all lib C
implementations.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
index daa86192e..1cfb7688b 100644
--- a/testcases/kernel/syscalls/sighold/sighold02.c
+++ b/testcases/kernel/syscalls/sighold/sighold02.c
@@ -33,7 +33,7 @@ static int sigs_map[NUMSIGS];
static int skip_sig(int sig)
{
- if (sig >= __SIGRTMIN && sig < SIGRTMIN)
+ if (sig >= 32 && sig < SIGRTMIN)
return 1;
switch (sig) {
--
2.35.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN
2022-04-25 9:21 [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN Richard Palethorpe via ltp
@ 2022-04-25 9:35 ` Cyril Hrubis
2022-04-25 11:08 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2022-04-25 9:35 UTC (permalink / raw)
To: Richard Palethorpe; +Cc: ltp
Hi!
> The minimum real-time signal is always 32 according to
> signal(7). Meanwhile __SIGRTMIN is not defined in all lib C
> implementations.
>
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
> testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
> index daa86192e..1cfb7688b 100644
> --- a/testcases/kernel/syscalls/sighold/sighold02.c
> +++ b/testcases/kernel/syscalls/sighold/sighold02.c
> @@ -33,7 +33,7 @@ static int sigs_map[NUMSIGS];
>
> static int skip_sig(int sig)
> {
> - if (sig >= __SIGRTMIN && sig < SIGRTMIN)
> + if (sig >= 32 && sig < SIGRTMIN)
> return 1;
Looks like __SIGRTMIN is defined to 32 for all architectures glibc
supports, so this should be pretty much safe.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN
2022-04-25 9:35 ` Cyril Hrubis
@ 2022-04-25 11:08 ` Petr Vorel
2022-04-25 11:09 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2022-04-25 11:08 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Richard Palethorpe, ltp
Hi all,
> Hi!
> > The minimum real-time signal is always 32 according to
> > signal(7). Meanwhile __SIGRTMIN is not defined in all lib C
> > implementations.
> > Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> > ---
> > testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
> > index daa86192e..1cfb7688b 100644
> > --- a/testcases/kernel/syscalls/sighold/sighold02.c
> > +++ b/testcases/kernel/syscalls/sighold/sighold02.c
> > @@ -33,7 +33,7 @@ static int sigs_map[NUMSIGS];
> > static int skip_sig(int sig)
> > {
> > - if (sig >= __SIGRTMIN && sig < SIGRTMIN)
> > + if (sig >= 32 && sig < SIGRTMIN)
> > return 1;
> Looks like __SIGRTMIN is defined to 32 for all architectures glibc
> supports, so this should be pretty much safe.
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Well, we have __SIGRTMIN 32 fallback definition in include/lapi/signal.h,
we use it in few tests. It was used in old variant, but you removed it during
rewrite in 38e69985cb2707a056f9c86a90c8570c721e6a7d.
BTW I looked whether we could use SIGRTMIN instead of underscore variants,
I suppose we can't (looks like SIGRTMIN is 32 + something):
musl:
#define SIGRTMIN (__libc_current_sigrtmin())
src/signal/sigrtmin.c
#include <signal.h>
int __libc_current_sigrtmin()
{
return 35;
}
glibc:
static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT;
(current_rtmin is used in __libc_current_sigrtmin(), RESERVED_SIGRT is defined 0 and 2)
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN
2022-04-25 11:08 ` Petr Vorel
@ 2022-04-25 11:09 ` Petr Vorel
2022-04-25 11:23 ` Cyril Hrubis
0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2022-04-25 11:09 UTC (permalink / raw)
To: Cyril Hrubis, Richard Palethorpe, ltp
> Hi all,
> > Hi!
> > > The minimum real-time signal is always 32 according to
> > > signal(7). Meanwhile __SIGRTMIN is not defined in all lib C
> > > implementations.
> > > Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> > > ---
> > > testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
> > > index daa86192e..1cfb7688b 100644
> > > --- a/testcases/kernel/syscalls/sighold/sighold02.c
> > > +++ b/testcases/kernel/syscalls/sighold/sighold02.c
> > > @@ -33,7 +33,7 @@ static int sigs_map[NUMSIGS];
> > > static int skip_sig(int sig)
> > > {
> > > - if (sig >= __SIGRTMIN && sig < SIGRTMIN)
> > > + if (sig >= 32 && sig < SIGRTMIN)
> > > return 1;
> > Looks like __SIGRTMIN is defined to 32 for all architectures glibc
> > supports, so this should be pretty much safe.
> > Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
> Well, we have __SIGRTMIN 32 fallback definition in include/lapi/signal.h,
> we use it in few tests. It was used in old variant, but you removed it during
> rewrite in 38e69985cb2707a056f9c86a90c8570c721e6a7d.
> BTW I looked whether we could use SIGRTMIN instead of underscore variants,
> I suppose we can't (looks like SIGRTMIN is 32 + something):
Ah, looking at the code "if (sig >= __SIGRTMIN && sig < SIGRTMIN)",
we need both underscore and non-underscore.
Let's go back to use lapi again.
Kind regards,
Petr
> musl:
> #define SIGRTMIN (__libc_current_sigrtmin())
> src/signal/sigrtmin.c
> #include <signal.h>
> int __libc_current_sigrtmin()
> {
> return 35;
> }
> glibc:
> static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT;
> (current_rtmin is used in __libc_current_sigrtmin(), RESERVED_SIGRT is defined 0 and 2)
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN
2022-04-25 11:09 ` Petr Vorel
@ 2022-04-25 11:23 ` Cyril Hrubis
2022-04-27 7:57 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2022-04-25 11:23 UTC (permalink / raw)
To: Petr Vorel; +Cc: Richard Palethorpe, ltp
Hi!
> Ah, looking at the code "if (sig >= __SIGRTMIN && sig < SIGRTMIN)",
> we need both underscore and non-underscore.
This is code to actually skip signals used internally by libc, so
anything between 32 and SIGRTMIN. It's pretty safe to hardcode the first
value to 32 since that is the number of signals allocated by kernel
which is not going to change.
I guess that we can add something as SIGRTMIN_KERN or SIGRTMIN_BASE and
define it to 32 in some LTP header instead of hardcoding 32 into
testcases, which would be way better than misusing glibc internal
__SIGRTMIN.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN
2022-04-25 11:23 ` Cyril Hrubis
@ 2022-04-27 7:57 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-04-27 7:57 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: Richard Palethorpe, ltp
> Hi!
> > Ah, looking at the code "if (sig >= __SIGRTMIN && sig < SIGRTMIN)",
> > we need both underscore and non-underscore.
> This is code to actually skip signals used internally by libc, so
> anything between 32 and SIGRTMIN. It's pretty safe to hardcode the first
> value to 32 since that is the number of signals allocated by kernel
> which is not going to change.
Ah, right!
> I guess that we can add something as SIGRTMIN_KERN or SIGRTMIN_BASE and
> define it to 32 in some LTP header instead of hardcoding 32 into
> testcases, which would be way better than misusing glibc internal
> __SIGRTMIN.
+1
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-27 7:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-25 9:21 [LTP] [PATCH] sighold02: Fix muslc builds by removing __SIGRTMIN Richard Palethorpe via ltp
2022-04-25 9:35 ` Cyril Hrubis
2022-04-25 11:08 ` Petr Vorel
2022-04-25 11:09 ` Petr Vorel
2022-04-25 11:23 ` Cyril Hrubis
2022-04-27 7:57 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox