Add a stub pthread header.
authorwhitequark <whitequark@whitequark.org>
Sun, 26 Jul 2015 09:54:40 +0000 (12:54 +0300)
committerwhitequark <whitequark@whitequark.org>
Sun, 26 Jul 2015 09:54:40 +0000 (12:54 +0300)
The header implements only the pthread rwlock interface, which
never actually locks.

This is necessary to build libunwind.

software/include/base/pthread.h [new file with mode: 0644]

diff --git a/software/include/base/pthread.h b/software/include/base/pthread.h
new file mode 100644 (file)
index 0000000..b78aa1e
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __PTHREAD_H
+#define __PTHREAD_H
+
+typedef int pthread_rwlock_t;
+
+#define PTHREAD_RWLOCK_INITIALIZER 0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inline int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
+  { return 0; }
+inline int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock)
+  { return 0; }
+inline int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
+  { return 0; }
+inline int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
+  { return 0; }
+int pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
+  { return 0; }
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PTHREAD_H */