- return rt_sigaction(sig, act, oact, sizeof(sigset_t));
-}
+ int rv;
+
+#if defined(__i386__) || defined(__x86_64__)
+ /* x86-64, and the Fedora i386 kernel, are broken without SA_RESTORER */
+ struct sigaction sa;
+
+ if ( act && !(act->sa_flags & SA_RESTORER) ) {
+ sa = *act;
+ act = &sa;
+
+ /* The kernel can't be trusted to have a valid default restorer */
+ sa.sa_flags |= SA_RESTORER;
+ sa.sa_restorer = &__sigreturn;
+ }
+#endif