]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
test_mkfds: disable ppoll multiplexer if sigset_t is not defined
authorMasatake YAMATO <yamato@redhat.com>
Tue, 4 Mar 2025 11:05:29 +0000 (20:05 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Tue, 4 Mar 2025 11:05:29 +0000 (20:05 +0900)
Fixes #3432

The ppoll multiplexer requires RAW sigset_t type generally defined in
asm/linux.h. However, the parisc arch of the kernel older than
487fa28fa8b60417642ac58e8beda6e2509d18f9 didn't export the type to
the user space.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
configure.ac
meson.build
tests/helpers/test_mkfds.c
tests/helpers/test_mkfds_ppoll.c

index 43fbce31701b2419032e0c08d7365e1af180d236..e8826caff8564c1dc9f8914b4178332b5204a7e6 100644 (file)
@@ -987,6 +987,15 @@ AC_CHECK_TYPES([sighandler_t], [], [], [[
 #include <signal.h>
 ]])
 
+# checking sigset_t defined in the kernel header in
+# asm/signal.h. tests/helpers/test_mkfds_ppoll.c expects the RAW sigset_t
+# is defined in the header file.
+# However, a slightly older arch/parisc doesn't export the type.
+# See https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=487fa28fa8b60417642ac58e8beda6e2509d18f9
+AC_CHECK_TYPES([sigset_t], [], [], [[
+#include <asm/signal.h>
+]])
+
 AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
 #include <sched.h>
 ]])
index db5f0cddba8dfe1debc9a78c10735a4fb4ac37e9..311c0a114d037d1522f82712b69453cbc477ac33 100644 (file)
@@ -515,6 +515,10 @@ conf.set('HAVE_ENVIRON_DECL', have ? 1 : false)
 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
 
+# checking sigset_t defined in the kernel header
+have = cc.has_header_symbol('asm/signal.h', 'sigset_t', args : '-D_GNU_SOURCE')
+conf.set('HAVE_SIGSET_T', have ? 1 : false)
+
 have = cc.has_function('strsignal')
 conf.set10('HAVE_STRSIGNAL_DECL', have)
 
index 2a9bc5c49dd91aa88ec2d9afd363d8774848ee8d..a14b8d012d9b118d0a0340813a7350138aa1449b 100644 (file)
@@ -4536,12 +4536,14 @@ static struct multiplexer multiplexers [] = {
                .fn = wait_event_poll,
        },
 #endif
+#ifdef HAVE_SIGSET_T
 #ifdef __NR_ppoll
        {
                .name = "ppoll",
                .fn = wait_event_ppoll,
        },
 #endif
+#endif /* HAVE_SIGSET_T */
 };
 
 static struct multiplexer *lookup_multiplexer(const char *name)
index 900b39adc92222a9513034a9da3be258b8e11c42..fd102261606bdbd01496984150a3f37380c4963f 100644 (file)
@@ -35,6 +35,8 @@
  * This file is for defining the poll multiplexer only with <asm/poll.h>.
  *
  */
+#ifdef HAVE_SIGSET_T           /* defined in config.h */
+
 #include "test_mkfds.h"
 
 #include <string.h>            /* memset */
@@ -77,3 +79,5 @@ DEFUN_WAIT_EVENT_POLL(ppoll,
                      clear_sigset(&sigset);,
                      syscall(__NR_ppoll, pfds, n, NULL, &sigset, sizeof(sigset)))
 #endif
+
+#endif /* HAVE_SIGSET_T */