6 #include <sys/syscall.h>
8 __extern void __sigreturn(void);
9 __extern int __sigaction(int, const struct sigaction *, struct sigaction *);
10 __extern int __rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t);
12 int sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
16 #if defined(__i386__) || defined(__x86_64__)
17 /* x86-64, and the Fedora i386 kernel, are broken without SA_RESTORER */
20 if ( act && !(act->sa_flags & SA_RESTORER) ) {
24 /* The kernel can't be trusted to have a valid default restorer */
25 sa.sa_flags |= SA_RESTORER;
26 sa.sa_restorer = &__sigreturn;
31 rv = __sigaction(sig, act, oact);
33 rv = __rt_sigaction(sig, act, oact, sizeof(sigset_t));
37 #if defined(__i386__) || defined(__x86_64__)
38 if ( oact && (oact->sa_restorer == &__sigreturn) ) {
39 oact->sa_flags &= ~SA_RESTORER;