Skip to contentSkip to conversation

Define __SIGRTMIN and __SIGRTMAX for MUSL

PATCH New Daniel Díaz 2 participants 2 messages Feb 21, 2019 – Feb 26, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Define __SIGRTMIN and __SIGRTMAX for MUSL

Some libc implementations might differ in the definitions they include. Exempli gratia: MUSL does not define __SIGRTMAX nor __SIGRTMIN.

These two tests fail to build because of the missing definitions:
testcases/kernel/syscalls/ptrace/ptrace05.c testcases/kernel/syscalls/sighold/sighold02.c

Out of precaution, these two also include this header:
lib/tst_sig.c testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c

---
 include/lapi/signal.h                         | 24 +++++++++++++++++++
 lib/tst_sig.c                                 |  1 +
 testcases/kernel/syscalls/ptrace/ptrace05.c   |  1 +
 .../syscalls/rt_sigsuspend/rt_sigsuspend01.c  |  1 +
 testcases/kernel/syscalls/sighold/sighold02.c |  1 +
 5 files changed, 28 insertions(+)
 create mode 100644 include/lapi/signal.h
include/lapi/signal.h new file +24 -0
new file mode 100644
index 000000000..d22965a94
@@ -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
lib/tst_sig.c +1 -0
index 36565e13d..6d77aeafd 100644
@@ -72,6 +72,7 @@
 #include <signal.h>
 #include <unistd.h>
 #include "test.h"
+#include "lapi/signal.h"
 
 #define MAXMESG 150		/* size of mesg string sent to tst_res */
 
testcases/kernel/syscalls/ptrace/ptrace05.c +1 -0
index 420330029..54cfa4d7b 100644
@@ -38,6 +38,7 @@
 #include "ptrace.h"
 
 #include "test.h"
+#include "lapi/signal.h"
 
 char *TCID = "ptrace05";
 int TST_TOTAL = 0;
testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c +1 -0
index f17a9aae6..e577cf227 100644
@@ -18,6 +18,7 @@
 #include "tst_test.h"
 #include "lapi/syscalls.h"
 #include "lapi/safe_rt_signal.h"
+#include "lapi/signal.h"
 
 static void sig_handler(int sig)
 {
testcases/kernel/syscalls/sighold/sighold02.c +1 -0
index d1d4b0b06..b763142df 100644
@@ -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
#1 lore raw

PATCH 1/1 Define __SIGRTMIN and __SIGRTMAX for MUSL

Hi Daniel,

Quoted 4 lines

Some libc implementations might differ in the definitions they include. Exempli gratia: MUSL does not define __SIGRTMAX nor __SIGRTMIN.

Quoted 8 lines

These two tests fail to build because of the missing definitions:
testcases/kernel/syscalls/ptrace/ptrace05.c testcases/kernel/syscalls/sighold/sighold02.c

Out of precaution, these two also include this header:
lib/tst_sig.c testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c

Thanks, merged!

Kind regards,
Petr