Add header file lapi/signal.h
PATCH 1/3 Add header file lapi/signal.h
Some libc implementations might differ in the definitions they include. Exempli gratia: MUSL does not define __SIGRTMAX nor __SIGRTMIN.
This header covers those differences for all tests that require those definitions.
--- include/lapi/signal.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/lapi/signal.h
include/lapi/signal.h new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2019 Linaro Limited. All rights reserved. +* Author: Daniel Díaz <[email protected]> +*/ + +#ifndef LAPI_SIGNAL_H +#define LAPI_SIGNAL_H + +#include <signal.h> + +/* +* Some libc implementations might differ in the definitions they include. This +* covers those differences for all tests to successfully build. +*/ + +#ifndef __SIGRTMIN +# define __SIGRTMIN 32 +#endif +#ifndef __SIGRTMAX +# define __SIGRTMAX (_NSIG - 1) +#endif + +#endif
Signature · 1 line
2.17.1
PATCH 2/3 syscalls/sighold02: Include lapi/signal.h for __SIGRT{MIN, MAX}
MUSL does not include __SIGRTMIN nor __SIGRTMAX. The compatibility header can help here.
--- testcases/kernel/syscalls/sighold/sighold02.c | 1 + 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/sighold/sighold02.c +1 -0
@@ -49,6 +49,7 @@#include <sys/wait.h> #include "test.h" #include "safe_macros.h" +#include "lapi/signal.h" /* _XOPEN_SOURCE disables NSIG */ #ifndef NSIG
Signature · 1 line
2.17.1
PATCH 3/3 syscalls/ptrace05: Include lapi/signal.h for __SIGRT{MIN, MAX}
In reply to Daniel DíazMUSL does not include __SIGRTMIN nor __SIGRTMAX. The compatibility header can help here.
--- testcases/kernel/syscalls/ptrace/ptrace05.c | 1 + 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/ptrace/ptrace05.c +1 -0
@@ -38,6 +38,7 @@#include "ptrace.h" #include "test.h" +#include "lapi/signal.h" char *TCID ="ptrace05" ;int TST_TOTAL =0 ;
Signature · 1 line
2.17.1
PATCH 3/3 syscalls/ptrace05: Include lapi/signal.h for __SIGRT{MIN, MAX}
Hi Daniel,
Quoted 2 lines
MUSL does not include
__SIGRTMINnor__SIGRTMAX. The compatibility header can help here.
lib/tst_sig.c and testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c also use __SIGRTMIN. Don't you have a problem to build it?
+ I'd squash adding of these includes into single commit.
Kind regards,
Petr
PATCH 3/3 syscalls/ptrace05: Include lapi/signal.h for __SIGRT{MIN, MAX}
Hello!
Quoted 6 lines · Petr Vorel
Hi Daniel,
Quoted 2 lines
MUSL does not include
__SIGRTMINnor__SIGRTMAX. The compatibility header can help here.
lib/tst_sig.candtestcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.calso use__SIGRTMIN. Don't you have a problem to build it?
Using latest LTP and latest OE-Core (MACHINE = "qemuarm64"; TCLIB = "musl"), no, it built fine. Same for 20190115 -- it built fine. (I'm about to submit the upgrade to that version to OE-core.)
Would you like me to add the #include in those two as well?
Quoted 1 line
+ I'd squash adding of these includes into single commit.
Great! I did that for OE, so let me send that patch instead.
Thanks and greetings!
Daniel DÃaz
[email protected]