diff options
Diffstat (limited to 'libc/include/signal.h')
-rw-r--r-- | libc/include/signal.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libc/include/signal.h b/libc/include/signal.h index 0159bf2..f1849c5 100644 --- a/libc/include/signal.h +++ b/libc/include/signal.h @@ -34,6 +34,7 @@ #include <limits.h> /* For LONG_BIT */ #include <string.h> /* For memset() */ #include <sys/types.h> +#include <asm/sigcontext.h> #if defined(__LP64__) || defined(__mips__) /* For 64-bit (and mips), the kernel's struct sigaction doesn't match the POSIX one, @@ -51,20 +52,29 @@ __BEGIN_DECLS typedef int sig_atomic_t; -/* TODO: 64-bit: we should probably #undef the uapi NSIG and add a unit test that NSIG == _NSIG && NSIG >= 64. */ -#ifndef _NSIG -# define _NSIG 64 -#endif -#ifndef NSIG -# define NSIG _NSIG +/* The arm and x86 kernel header files don't define _NSIG. */ +#ifndef _KERNEL__NSIG +#define _KERNEL__NSIG 64 #endif +/* Userspace's NSIG is the kernel's _NSIG + 1. */ +#define _NSIG (_KERNEL__NSIG + 1) +#define NSIG _NSIG + +/* We take a few real-time signals for ourselves. May as well use the same names as glibc. */ +#define SIGRTMIN (__libc_current_sigrtmin()) +#define SIGRTMAX (__libc_current_sigrtmax()) +extern int __libc_current_sigrtmin(void); +extern int __libc_current_sigrtmax(void); + extern const char* const sys_siglist[]; -extern const char* const sys_signame[]; +extern const char* const sys_signame[]; /* BSD compatibility. */ typedef __sighandler_t sig_t; /* BSD compatibility. */ typedef __sighandler_t sighandler_t; /* glibc compatibility. */ +#define si_timerid si_tid /* glibc compatibility. */ + #if defined(__LP64__) struct sigaction { @@ -93,8 +103,6 @@ struct sigaction { extern int sigaction(int, const struct sigaction*, struct sigaction*); extern sighandler_t signal(int, sighandler_t); -extern sighandler_t bsd_signal(int, sighandler_t); -extern sighandler_t sysv_signal(int, sighandler_t); extern int siginterrupt(int, int); |