POSIX says `sigaction::sa_flags` is `int`.

Bug: N/A
Test: builds
Change-Id: I8f682a6a075b0c27917d79414f013f928c75394d
diff --git a/libc/include/signal.h b/libc/include/signal.h
index ece2916..d9c9ee2 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -37,17 +37,13 @@
 #include <bits/timespec.h>
 #include <limits.h>
 
-#if defined(__LP64__) || defined(__mips__)
-/* For 64-bit (and mips), the kernel's struct sigaction doesn't match the POSIX one,
- * so we need to expose our own and translate behind the scenes. */
-#  define sigaction __kernel_sigaction
-#  include <linux/signal.h>
-#  undef sigaction
-#else
-/* For 32-bit, we're stuck with the definitions we already shipped,
+/* For 64-bit (and mips), the kernel's struct sigaction doesn't match the
+ * POSIX one, so we need to expose our own and translate behind the scenes.
+ * For 32-bit, we're stuck with the definitions we already shipped,
  * even though they contain a sigset_t that's too small. */
-#  include <linux/signal.h>
-#endif
+#define sigaction __kernel_sigaction
+#include <linux/signal.h>
+#undef sigaction
 
 #include <sys/ucontext.h>
 #define __BIONIC_HAVE_UCONTEXT_T
@@ -87,7 +83,7 @@
 #if defined(__LP64__)
 
 struct sigaction {
-  unsigned int sa_flags;
+  int sa_flags;
   union {
     sighandler_t sa_handler;
     void (*sa_sigaction)(int, struct siginfo*, void*);
@@ -99,7 +95,7 @@
 #elif defined(__mips__)
 
 struct sigaction {
-  unsigned int sa_flags;
+  int sa_flags;
   union {
     sighandler_t sa_handler;
     void (*sa_sigaction) (int, struct siginfo*, void*);
@@ -107,6 +103,18 @@
   sigset_t sa_mask;
 };
 
+#else
+
+struct sigaction {
+  union {
+    sighandler_t _sa_handler;
+    void (*_sa_sigaction)(int, struct siginfo*, void*);
+  } _u;
+  sigset_t sa_mask;
+  int sa_flags;
+  void (*sa_restorer)(void);
+};
+
 #endif
 
 int sigaction(int __signal, const struct sigaction* __new_action, struct sigaction* __old_action);
diff --git a/tests/headers/posix/signal_h.c b/tests/headers/posix/signal_h.c
index dbfacb1..661b55e 100644
--- a/tests/headers/posix/signal_h.c
+++ b/tests/headers/posix/signal_h.c
@@ -103,15 +103,7 @@
   TYPE(struct sigaction);
   STRUCT_MEMBER_FUNCTION_POINTER(struct sigaction, void (*f)(int), sa_handler);
   STRUCT_MEMBER(struct sigaction, sigset_t, sa_mask);
-#if defined(__BIONIC__)
-#if defined(__LP64__)
-  STRUCT_MEMBER(struct sigaction, unsigned int, sa_flags); // TODO: easily fixed!
-#else
-  STRUCT_MEMBER(struct sigaction, unsigned long, sa_flags);
-#endif
-#else
   STRUCT_MEMBER(struct sigaction, int, sa_flags);
-#endif
   STRUCT_MEMBER_FUNCTION_POINTER(struct sigaction, void (*f)(int, siginfo_t*, void*), sa_sigaction);
 
   i = SIG_BLOCK;