summaryrefslogtreecommitdiffstats
path: root/libc/include/machine
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-11-21 00:18:07 -0800
committerDan Albert <danalbert@google.com>2014-11-21 10:26:09 -0800
commit75ef63d6cf83787233d1c45489c4ec03b0a67d16 (patch)
treeaf1358c723e21ebfbd48a4dfd2abc3f262cb309d /libc/include/machine
parentf6640348876cd1d4d43cc95cf63306fedb83d8b9 (diff)
downloadbionic-75ef63d6cf83787233d1c45489c4ec03b0a67d16.zip
bionic-75ef63d6cf83787233d1c45489c4ec03b0a67d16.tar.gz
bionic-75ef63d6cf83787233d1c45489c4ec03b0a67d16.tar.bz2
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
Diffstat (limited to 'libc/include/machine')
-rw-r--r--libc/include/machine/pthread_types.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/libc/include/machine/pthread_types.h b/libc/include/machine/pthread_types.h
new file mode 100644
index 0000000..900541c
--- /dev/null
+++ b/libc/include/machine/pthread_types.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _MACHINE_PTHREAD_TYPES_H_
+#define _MACHINE_PTHREAD_TYPES_H_
+
+#include <sys/types.h>
+
+typedef long pthread_t;
+
+typedef struct {
+ uint32_t flags;
+ void* stack_base;
+ size_t stack_size;
+ size_t guard_size;
+ int32_t sched_policy;
+ int32_t sched_priority;
+#ifdef __LP64__
+ char __reserved[16];
+#endif
+} pthread_attr_t;
+
+#endif /* _MACHINE_PTHREAD_TYPES_H_ */