klibc-bot for Ben Hutchings
2023-Feb-12 22:48 UTC
[klibc] [klibc:master] signal: Make RT signals mandatory
Commit-ID: 6a3789f80c027899f7a7c39be0efe3db3f28e9d9 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=6a3789f80c027899f7a7c39be0efe3db3f28e9d9 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: Sun, 12 Feb 2023 18:53:53 +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 | 24 +----------------------- usr/klibc/pselect.c | 6 +----- usr/klibc/sigaction.c | 8 -------- usr/klibc/sigpending.c | 4 ---- usr/klibc/sigprocmask.c | 4 ---- usr/klibc/sigsuspend.c | 21 --------------------- 20 files changed, 2 insertions(+), 109 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..c5920159 100644 --- a/usr/klibc/SYSCALLS.def +++ b/usr/klibc/SYSCALLS.def @@ -176,9 +176,7 @@ int dup3(int, int, int); int ioctl(int, int, void *); int flock(int, int); <?> int _newselect,select::select(int, fd_set *, fd_set *, fd_set *, struct timeval *); -#if defined(__NR_pselect) && !_KLIBC_USE_RT_SIG -int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); -#elif defined(__NR_pselect7) +#if defined(__NR_pselect7) int pselect7::__pselect7(int, fd_set *, fd_set *, fd_set *, struct timespec *, const sigset_t *, size_t); #elif defined(__NR_pselect6) int pselect6::__pselect6(int, fd_set *, fd_set *, fd_set *, struct timespec *, const struct __pselect6 *); @@ -201,11 +199,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 +207,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/pselect.c b/usr/klibc/pselect.c index 1bb6852d..f118c19b 100644 --- a/usr/klibc/pselect.c +++ b/usr/klibc/pselect.c @@ -5,11 +5,7 @@ #include <sys/select.h> #include <sys/syscall.h> -#if defined(__NR_pselect) && !_KLIBC_USE_RT_SIG - -/* Don't need to do anything here; use syscall stub directly */ - -#elif defined(__NR_pselect7) +#if defined(__NR_pselect7) __extern int __pselect7(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *, size_t); diff --git a/usr/klibc/sigaction.c b/usr/klibc/sigaction.c index a8181a41..94817508 100644 --- a/usr/klibc/sigaction.c +++ b/usr/klibc/sigaction.c @@ -15,11 +15,7 @@ typedef struct sigaction *act_type; typedef const struct sigaction *act_type; #endif -#if _KLIBC_USE_RT_SIG __extern int __rt_sigaction(int, act_type, struct sigaction *, size_t); -#else -__extern int __sigaction(int, act_type, struct sigaction *); -#endif int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { @@ -46,7 +42,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 +50,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