klibc-bot for Ben Hutchings
2023-Jan-26 16:12 UTC
[klibc] [klibc:time64] i386, m68k, s390: signal: Switch to RT signal API
Commit-ID: 992775aba0304933f9e9654d6bbb5118ae95f657 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=992775aba0304933f9e9654d6bbb5118ae95f657 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 14 Jan 2023 04:09:21 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sun, 15 Jan 2023 21:28:01 +0100 [klibc] i386,m68k,s390: signal: Switch to RT signal API These are the last 3 architectures not using the RT signal system calls and structures. Change them over so that we won't need to keep support the old API. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/arch/i386/klibc/archconfig.h | 3 +-- usr/include/arch/i386/klibc/archsignal.h | 15 ++++++++++----- usr/include/arch/m68k/klibc/archconfig.h | 1 + usr/include/arch/m68k/klibc/archsignal.h | 15 ++++++++++----- usr/include/arch/s390/klibc/archconfig.h | 1 + usr/include/arch/s390/klibc/archsignal.h | 9 +++++++-- 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/usr/include/arch/i386/klibc/archconfig.h b/usr/include/arch/i386/klibc/archconfig.h index f070f5bb..3e52a6b6 100644 --- a/usr/include/arch/i386/klibc/archconfig.h +++ b/usr/include/arch/i386/klibc/archconfig.h @@ -9,8 +9,7 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -/* The i386 <asm/signal.h> is still not clean enough for this... */ -#define _KLIBC_USE_RT_SIG 0 +#define _KLIBC_USE_RT_SIG 1 /* We have klibc/archinit.h and __libc_archinit() */ #define _KLIBC_HAS_ARCHINIT 1 diff --git a/usr/include/arch/i386/klibc/archsignal.h b/usr/include/arch/i386/klibc/archsignal.h index 82395b2c..5b3379a2 100644 --- a/usr/include/arch/i386/klibc/archsignal.h +++ b/usr/include/arch/i386/klibc/archsignal.h @@ -7,8 +7,13 @@ #ifndef _KLIBC_ARCHSIGNAL_H #define _KLIBC_ARCHSIGNAL_H -#define NSIG 32 -typedef unsigned long sigset_t; +#define _NSIG 64 +#define _NSIG_BPW 32 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW) + +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} sigset_t; #define SIGHUP 1 #define SIGINT 2 @@ -59,9 +64,9 @@ struct sigaction { __sighandler_t _sa_handler; void (*_sa_sigaction)(int, struct siginfo *, void *); } _u; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); + unsigned int sa_flags; + __sigrestore_t sa_restorer; + sigset_t sa_mask; /* mask last for extensibility */ }; #define sa_handler _u._sa_handler diff --git a/usr/include/arch/m68k/klibc/archconfig.h b/usr/include/arch/m68k/klibc/archconfig.h index 10ef62e6..6213277b 100644 --- a/usr/include/arch/m68k/klibc/archconfig.h +++ b/usr/include/arch/m68k/klibc/archconfig.h @@ -11,5 +11,6 @@ /* On m68k, sys_mmap2 uses the current page size as the shift factor */ #define _KLIBC_MMAP2_SHIFT __getpageshift() +#define _KLIBC_USE_RT_SIG 1 #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/m68k/klibc/archsignal.h b/usr/include/arch/m68k/klibc/archsignal.h index 59b1ac87..64613466 100644 --- a/usr/include/arch/m68k/klibc/archsignal.h +++ b/usr/include/arch/m68k/klibc/archsignal.h @@ -8,8 +8,13 @@ #ifndef _KLIBC_ARCHSIGNAL_H #define _KLIBC_ARCHSIGNAL_H -#define NSIG 32 -typedef unsigned long sigset_t; +#define _NSIG 64 +#define _NSIG_BPW 32 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW) + +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} sigset_t; #define SIGHUP 1 #define SIGINT 2 @@ -58,9 +63,9 @@ struct sigaction { __sighandler_t _sa_handler; void (*_sa_sigaction)(int, struct siginfo *, void *); } _u; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); + unsigned int sa_flags; + __sigrestore_t sa_restorer; + sigset_t sa_mask; /* mask last for extensibility */ }; #define sa_handler _u._sa_handler diff --git a/usr/include/arch/s390/klibc/archconfig.h b/usr/include/arch/s390/klibc/archconfig.h index b08bbb3f..52d324c9 100644 --- a/usr/include/arch/s390/klibc/archconfig.h +++ b/usr/include/arch/s390/klibc/archconfig.h @@ -16,5 +16,6 @@ #define _KLIBC_NEEDS_SA_RESTORER 1 /* Our restorer will call rt_sigreturn() */ #define _KLIBC_NEEDS_SA_SIGINFO 1 +#define _KLIBC_USE_RT_SIG 1 #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/s390/klibc/archsignal.h b/usr/include/arch/s390/klibc/archsignal.h index a79b166b..31993a48 100644 --- a/usr/include/arch/s390/klibc/archsignal.h +++ b/usr/include/arch/s390/klibc/archsignal.h @@ -8,8 +8,13 @@ #ifndef _KLIBC_ARCHSIGNAL_H #define _KLIBC_ARCHSIGNAL_H -#define NSIG 32 -typedef unsigned long sigset_t; +#define _NSIG 64 +#define _NSIG_BPW __BITS_PER_LONG +#define _NSIG_WORDS (_NSIG / _NSIG_BPW) + +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} sigset_t; #define SIGHUP 1 #define SIGINT 2