klibc-bot for Ben Hutchings
2023-Jan-14 22:03 UTC
[klibc] [klibc:time64] signal: Make RT signals mandatory
Commit-ID: 978b6cc085b52a419a66cc8f34a3416398d5516e Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=978b6cc085b52a419a66cc8f34a3416398d5516e Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 14 Jan 2023 04:13:03 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 14 Jan 2023 18:09:20 +0100 [klibc] signal: Make RT signals mandatory This is necessary preparation for using 64-bit time system calls. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/arch/alpha/klibc/archconfig.h | 1 - usr/include/arch/arm/klibc/archconfig.h | 3 --- usr/include/arch/arm64/klibc/archconfig.h | 2 -- usr/include/arch/i386/klibc/archconfig.h | 2 -- usr/include/arch/m68k/klibc/archconfig.h | 1 - usr/include/arch/mips/klibc/archconfig.h | 3 --- usr/include/arch/mips64/klibc/archconfig.h | 3 --- usr/include/arch/ppc/klibc/archconfig.h | 2 -- usr/include/arch/ppc64/klibc/archconfig.h | 2 -- usr/include/arch/s390/klibc/archconfig.h | 1 - usr/include/arch/sh/klibc/archconfig.h | 3 --- usr/include/arch/sparc/klibc/archconfig.h | 1 - usr/include/arch/sparc64/klibc/archconfig.h | 1 - usr/include/klibc/sysconfig.h | 19 ------------------- usr/klibc/SYSCALLS.def | 20 -------------------- usr/klibc/sigaction.c | 4 ---- usr/klibc/sigpending.c | 4 ---- usr/klibc/sigprocmask.c | 4 ---- usr/klibc/sigsuspend.c | 21 --------------------- 19 files changed, 97 deletions(-) diff --git a/usr/include/arch/alpha/klibc/archconfig.h b/usr/include/arch/alpha/klibc/archconfig.h index 9d28db12..66042119 100644 --- a/usr/include/arch/alpha/klibc/archconfig.h +++ b/usr/include/arch/alpha/klibc/archconfig.h @@ -9,7 +9,6 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -#define _KLIBC_USE_RT_SIG 1 /* We provide our own restorer that call rt_sigreturn() */ #define _KLIBC_NEEDS_SA_SIGINFO 1 #define _KLIBC_STATFS_F_TYPE_64 0 diff --git a/usr/include/arch/arm/klibc/archconfig.h b/usr/include/arch/arm/klibc/archconfig.h index cfe847a8..36e9ab56 100644 --- a/usr/include/arch/arm/klibc/archconfig.h +++ b/usr/include/arch/arm/klibc/archconfig.h @@ -15,7 +15,4 @@ # define _KLIBC_ARM_USE_BX 1 #endif -/* Use rt_* signals */ -#define _KLIBC_USE_RT_SIG 1 - #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/arm64/klibc/archconfig.h b/usr/include/arch/arm64/klibc/archconfig.h index 5e2004bd..d094c28d 100644 --- a/usr/include/arch/arm64/klibc/archconfig.h +++ b/usr/include/arch/arm64/klibc/archconfig.h @@ -9,8 +9,6 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -/* Use rt_* signals */ -#define _KLIBC_USE_RT_SIG 1 #define _KLIBC_NO_MMU 0 #define _KLIBC_REAL_VFORK 1 diff --git a/usr/include/arch/i386/klibc/archconfig.h b/usr/include/arch/i386/klibc/archconfig.h index 3e52a6b6..7d4d5cda 100644 --- a/usr/include/arch/i386/klibc/archconfig.h +++ b/usr/include/arch/i386/klibc/archconfig.h @@ -9,8 +9,6 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -#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/m68k/klibc/archconfig.h b/usr/include/arch/m68k/klibc/archconfig.h index 6213277b..10ef62e6 100644 --- a/usr/include/arch/m68k/klibc/archconfig.h +++ b/usr/include/arch/m68k/klibc/archconfig.h @@ -11,6 +11,5 @@ /* 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/mips/klibc/archconfig.h b/usr/include/arch/mips/klibc/archconfig.h index 9c21efc1..ff0afb54 100644 --- a/usr/include/arch/mips/klibc/archconfig.h +++ b/usr/include/arch/mips/klibc/archconfig.h @@ -18,7 +18,4 @@ /* MIPS has nonstandard socket definitions */ #define _KLIBC_HAS_ARCHSOCKET_H 1 -/* We can use RT signals on MIPS */ -#define _KLIBC_USE_RT_SIG 1 - #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/mips64/klibc/archconfig.h b/usr/include/arch/mips64/klibc/archconfig.h index df3cf1c0..fa314823 100644 --- a/usr/include/arch/mips64/klibc/archconfig.h +++ b/usr/include/arch/mips64/klibc/archconfig.h @@ -14,9 +14,6 @@ #define _KLIBC_STATFS_F_TYPE_64 1 -/* We can use RT signals on MIPS */ -#define _KLIBC_USE_RT_SIG 1 - /* MIPS has architecture-specific code for vfork() */ #define _KLIBC_REAL_VFORK 1 diff --git a/usr/include/arch/ppc/klibc/archconfig.h b/usr/include/arch/ppc/klibc/archconfig.h index 61c3657d..584af214 100644 --- a/usr/include/arch/ppc/klibc/archconfig.h +++ b/usr/include/arch/ppc/klibc/archconfig.h @@ -9,6 +9,4 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -#define _KLIBC_USE_RT_SIG 1 - #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/ppc64/klibc/archconfig.h b/usr/include/arch/ppc64/klibc/archconfig.h index 27c56305..61b61f41 100644 --- a/usr/include/arch/ppc64/klibc/archconfig.h +++ b/usr/include/arch/ppc64/klibc/archconfig.h @@ -7,6 +7,4 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -#define _KLIBC_USE_RT_SIG 1 - #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/s390/klibc/archconfig.h b/usr/include/arch/s390/klibc/archconfig.h index 52d324c9..b08bbb3f 100644 --- a/usr/include/arch/s390/klibc/archconfig.h +++ b/usr/include/arch/s390/klibc/archconfig.h @@ -16,6 +16,5 @@ #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/sh/klibc/archconfig.h b/usr/include/arch/sh/klibc/archconfig.h index 923c5635..1f1f4a7b 100644 --- a/usr/include/arch/sh/klibc/archconfig.h +++ b/usr/include/arch/sh/klibc/archconfig.h @@ -9,7 +9,4 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -/* Use rt_* signals */ -#define _KLIBC_USE_RT_SIG 1 - #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/sparc/klibc/archconfig.h b/usr/include/arch/sparc/klibc/archconfig.h index 651b213d..bdc8b1e4 100644 --- a/usr/include/arch/sparc/klibc/archconfig.h +++ b/usr/include/arch/sparc/klibc/archconfig.h @@ -9,7 +9,6 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -#define _KLIBC_USE_RT_SIG 1 /* Use rt_* signals */ #define _KLIBC_SYS_SOCKETCALL 1 /* Use sys_socketcall unconditionally */ /* So that we can avoid stack trampolines */ diff --git a/usr/include/arch/sparc64/klibc/archconfig.h b/usr/include/arch/sparc64/klibc/archconfig.h index 794d15b7..df5c8064 100644 --- a/usr/include/arch/sparc64/klibc/archconfig.h +++ b/usr/include/arch/sparc64/klibc/archconfig.h @@ -9,7 +9,6 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -#define _KLIBC_USE_RT_SIG 1 /* Use rt_* signals */ #define _KLIBC_NEEDS_SA_RESTORER 1 /* Need a restorer function */ #define _KLIBC_SYS_SOCKETCALL 1 /* Use sys_socketcall unconditionally */ diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h index d658ad30..5d16f612 100644 --- a/usr/include/klibc/sysconfig.h +++ b/usr/include/klibc/sysconfig.h @@ -130,25 +130,6 @@ #endif -/* - * _KLIBC_USE_RT_SIG: - * - * Indicates that this architecture should use the rt_sig*() - * family of system calls, even if the older system calls are - * provided. This requires that <asm/signal.h> is correct for - * using with the rt_sig*() system calls. This is the default if - * the older system calls are undefined in <asm/unistd.h>. - * - */ -#ifndef _KLIBC_USE_RT_SIG -# ifdef __NR_sigaction -# define _KLIBC_USE_RT_SIG 0 -# else -# define _KLIBC_USE_RT_SIG 1 -# endif -#endif - - /* * _KLIBC_NEEDS_SA_RESTORER: * diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def index 7a67b01f..0664d453 100644 --- a/usr/klibc/SYSCALLS.def +++ b/usr/klibc/SYSCALLS.def @@ -201,11 +201,7 @@ ssize_t sendfile64,sendfile::sendfile(int, int, off_t *, size_t, off_t); /* * Signal operations - * - * We really should get rid of the non-rt_* of these, but that takes - * sanitizing <signal.h> for all architectures, sigh. See <klibc/config.h>. */ -#if _KLIBC_USE_RT_SIG <!sparc,sparc64,alpha,ia64> int rt_sigaction::__rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t); <sparc,sparc64> int rt_sigaction::____rt_sigaction(int, const struct sigaction *, struct sigaction *, void *, size_t); <alpha> int rt_sigaction::____rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t, void *); @@ -213,22 +209,6 @@ ssize_t sendfile64,sendfile::sendfile(int, int, off_t *, size_t, off_t); int rt_sigsuspend::__rt_sigsuspend(const sigset_t *, size_t); int rt_sigpending::__rt_sigpending(sigset_t *, size_t); int rt_sigprocmask::__rt_sigprocmask(int, const sigset_t *, sigset_t *, size_t); -#else -int sigaction::__sigaction(int, const struct sigaction *, struct sigaction *); -int sigpending(sigset_t *); -int sigprocmask(int, const sigset_t *, sigset_t *); -/* - * There is no single calling convention for the old sigsuspend. - * If your architecture is not listed here, building klibc shall - * rather fail than use a broken calling convention. - * You better switch to RT signals on those architectures: - * blackfin h8300 microblaze mips. - * - * The arguments other than the sigset_t are assumed ignored. - */ -<sh,sparc,alpha,ppc,sparc64> int sigsuspend::__sigsuspend_s(sigset_t); -<arm,frv,i386,m68k,mn10300,s390,s390x> int sigsuspend::__sigsuspend_xxs(int, int, sigset_t); -#endif <s390,s390x,sparc,sparc64> void rt_sigreturn::__sigreturn(); int kill(pid_t, int); <?> unsigned int alarm(unsigned int); diff --git a/usr/klibc/sigaction.c b/usr/klibc/sigaction.c index a8181a41..6ceb96ac 100644 --- a/usr/klibc/sigaction.c +++ b/usr/klibc/sigaction.c @@ -46,7 +46,6 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) act = &sa; } -#if _KLIBC_USE_RT_SIG /* Check that we have the right signal API definitions */ (void)sizeof(char[_NSIG >= 64 ? 1 : -1]); (void)sizeof(char[sizeof(sigset_t) * 8 >= _NSIG ? 1 : -1]); @@ -55,9 +54,6 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) ? 1 : -1]); rv = __rt_sigaction(sig, (act_type)act, oact, sizeof(sigset_t)); -#else - rv = __sigaction(sig, (act_type)act, oact); -#endif #if _KLIBC_NEEDS_SA_RESTORER if (oact && (oact->sa_restorer == &__sigreturn)) { diff --git a/usr/klibc/sigpending.c b/usr/klibc/sigpending.c index 26fd3e99..b6c50b89 100644 --- a/usr/klibc/sigpending.c +++ b/usr/klibc/sigpending.c @@ -6,13 +6,9 @@ #include <sys/syscall.h> #include <klibc/sysconfig.h> -#if _KLIBC_USE_RT_SIG - __extern int __rt_sigpending(sigset_t *, size_t); int sigpending(sigset_t * set) { return __rt_sigpending(set, sizeof(sigset_t)); } - -#endif diff --git a/usr/klibc/sigprocmask.c b/usr/klibc/sigprocmask.c index ea12c130..5a5f4ae8 100644 --- a/usr/klibc/sigprocmask.c +++ b/usr/klibc/sigprocmask.c @@ -6,13 +6,9 @@ #include <sys/syscall.h> #include <klibc/sysconfig.h> -#if _KLIBC_USE_RT_SIG - __extern int __rt_sigprocmask(int, const sigset_t *, sigset_t *, size_t); int sigprocmask(int how, const sigset_t * set, sigset_t * oset) { return __rt_sigprocmask(how, set, oset, sizeof(sigset_t)); } - -#endif diff --git a/usr/klibc/sigsuspend.c b/usr/klibc/sigsuspend.c index 26a521a9..120a00ae 100644 --- a/usr/klibc/sigsuspend.c +++ b/usr/klibc/sigsuspend.c @@ -7,30 +7,9 @@ #include <klibc/sysconfig.h> #include <klibc/havesyscall.h> -#if _KLIBC_USE_RT_SIG - __extern int __rt_sigsuspend(const sigset_t *, size_t); int sigsuspend(const sigset_t * mask) { return __rt_sigsuspend(mask, sizeof *mask); } - -#else - -extern int __sigsuspend_s(sigset_t); -extern int __sigsuspend_xxs(int, int, sigset_t); - -int -sigsuspend(const sigset_t *maskp) -{ -#ifdef _KLIBC_HAVE_SYSCALL___sigsuspend_s - return __sigsuspend_s(*maskp); -#elif defined(_KLIBC_HAVE_SYSCALL___sigsuspend_xxs) - return __sigsuspend_xxs(0, 0, *maskp); -#else -# error "Unknown sigsuspend implementation" -#endif -} - -#endif