Move some pthread functions to signal.h.
POSIX specifies that pthread_kill(3) and pthread_sigmask(3) are
supposed to live in signal.h rather than pthread.h.
Since signal.h now needs pthread_t and pthread_attr_t, I've moved
those defintions into include/machine/pthread_types.h to keep the
namespace clean. I also sorted some includes. The combination of these
two things seems to have exploded into a cascade of missing includes,
so this patch also cleans up all those.
Change-Id: Icfa92a39432fe83f542a797e5a113289d7e4ad0c
diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp
index 681e038..90aa7b8 100644
--- a/libc/bionic/locale.cpp
+++ b/libc/bionic/locale.cpp
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <errno.h>
#include <locale.h>
#include <pthread.h>
#include <stdlib.h>
diff --git a/libc/bionic/mntent.cpp b/libc/bionic/mntent.cpp
index f5a8eaa..4afacda 100644
--- a/libc/bionic/mntent.cpp
+++ b/libc/bionic/mntent.cpp
@@ -27,6 +27,7 @@
*/
#include <mntent.h>
+#include <string.h>
#include "private/ThreadLocalBuffer.h"
diff --git a/libc/bionic/pthread_atfork.cpp b/libc/bionic/pthread_atfork.cpp
index b845f7d..82e2b59 100644
--- a/libc/bionic/pthread_atfork.cpp
+++ b/libc/bionic/pthread_atfork.cpp
@@ -28,6 +28,7 @@
#include <errno.h>
#include <pthread.h>
+#include <stdlib.h>
struct atfork_t {
atfork_t* next;
diff --git a/libc/bionic/pthread_internals.cpp b/libc/bionic/pthread_internals.cpp
index 19c00d4..2270d96 100644
--- a/libc/bionic/pthread_internals.cpp
+++ b/libc/bionic/pthread_internals.cpp
@@ -28,6 +28,8 @@
#include "pthread_internal.h"
+#include <stdlib.h>
+
#include "private/bionic_futex.h"
#include "private/bionic_tls.h"
#include "private/ScopedPthreadMutexLocker.h"
diff --git a/libc/bionic/pthread_key.cpp b/libc/bionic/pthread_key.cpp
index 27eab27..b47ef22 100644
--- a/libc/bionic/pthread_key.cpp
+++ b/libc/bionic/pthread_key.cpp
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <errno.h>
#include <pthread.h>
#include "private/bionic_tls.h"
diff --git a/libc/bionic/raise.cpp b/libc/bionic/raise.cpp
index f69d90b..0dd0ad7 100644
--- a/libc/bionic/raise.cpp
+++ b/libc/bionic/raise.cpp
@@ -27,6 +27,7 @@
*/
#include <pthread.h>
+#include <signal.h>
int raise(int sig) {
int rc = pthread_kill(pthread_self(), sig);