Fix NSIG.

Our sigset_t definition hasn't been tied to our NSIG definition since we
switched to uapi headers, so we can now fix it without breaking the LP32 ABI.
The kernel uapi headers define and use _NSIG, so we need to have our scripts
rename the kernel's definitions out of the way, then we can define _NSIG
and NSIG in terms of the kernel's off-by-one value.

Bug: 12938442
Change-Id: Ic7c86fd5be5ad1d822f7b2b1d88c8a0d70a1ac0f
diff --git a/libc/include/signal.h b/libc/include/signal.h
index 0159bf2..c01b33a 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -51,13 +51,14 @@
 
 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
+/* The arm and x86 kernel header files don't define _NSIG. */
+#ifndef _KERNEL__NSIG
+#define _KERNEL__NSIG 64
 #endif
-#ifndef NSIG
-#  define NSIG _NSIG
-#endif
+
+/* Userspace's NSIG is the kernel's _NSIG + 1. */
+#define _NSIG (_KERNEL__NSIG + 1)
+#define NSIG _NSIG
 
 extern const char* const sys_siglist[];
 extern const char* const sys_signame[];