strace/tests/sigreturn.c
Dmitry V. Levin 59f63d3106 Use SIGRTMIN from kernel headers
* configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>.
* signal.c: Use ASM_SIGRTMIN instead of constants provided by libc.
* tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value.
Use lower RT_* numbers to support pre-3.18 hppa kernels.
* tests/sigreturn.test: Update regexp.
2015-03-05 05:42:30 +00:00

33 lines
621 B
C

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <signal.h>
#ifdef ASM_SIGRTMIN
# define RT_0 ASM_SIGRTMIN
#else
/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */
# define RT_0 32
#endif
static void handler(int sig)
{
}
int main(void) {
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGUSR2);
sigaddset(&set, SIGCHLD);
sigaddset(&set, RT_0 + 2);
sigaddset(&set, RT_0 + 3);
sigaddset(&set, RT_0 + 4);
sigaddset(&set, RT_0 + 26);
sigaddset(&set, RT_0 + 27);
sigprocmask(SIG_SETMASK, &set, NULL);
signal(SIGUSR1, handler);
raise(SIGUSR1);
return 0;
}