summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/__wake.c1
-rw-r--r--src/thread/pthread_attr_init.c3
-rw-r--r--src/thread/pthread_barrierattr_init.c2
-rw-r--r--src/thread/pthread_cond_init.c2
-rw-r--r--src/thread/pthread_condattr_init.c2
-rw-r--r--src/thread/pthread_create.c1
-rw-r--r--src/thread/pthread_join.c1
-rw-r--r--src/thread/pthread_mutex_init.c2
-rw-r--r--src/thread/pthread_mutexattr_init.c2
-rw-r--r--src/thread/pthread_rwlock_init.c2
-rw-r--r--src/thread/pthread_rwlockattr_init.c2
-rw-r--r--src/thread/synccall.c1
12 files changed, 13 insertions, 8 deletions
diff --git a/src/thread/__wake.c b/src/thread/__wake.c
index 8fd0599c..d8bf70f7 100644
--- a/src/thread/__wake.c
+++ b/src/thread/__wake.c
@@ -1,4 +1,5 @@
#include "pthread_impl.h"
+#include <limits.h>
void __wake(volatile int *addr, int cnt, int priv)
{
diff --git a/src/thread/pthread_attr_init.c b/src/thread/pthread_attr_init.c
index d91bf157..66934889 100644
--- a/src/thread/pthread_attr_init.c
+++ b/src/thread/pthread_attr_init.c
@@ -1,7 +1,8 @@
#include "pthread_impl.h"
+#include <string.h>
int pthread_attr_init(pthread_attr_t *a)
{
- memset(a, 0, sizeof *a);
+ *a = (pthread_attr_t){0};
return 0;
}
diff --git a/src/thread/pthread_barrierattr_init.c b/src/thread/pthread_barrierattr_init.c
index f2698272..fa742bb7 100644
--- a/src/thread/pthread_barrierattr_init.c
+++ b/src/thread/pthread_barrierattr_init.c
@@ -2,6 +2,6 @@
int pthread_barrierattr_init(pthread_barrierattr_t *a)
{
- memset(a, 0, sizeof *a);
+ *a = (pthread_barrierattr_t){0};
return 0;
}
diff --git a/src/thread/pthread_cond_init.c b/src/thread/pthread_cond_init.c
index 2eac30f1..71489bca 100644
--- a/src/thread/pthread_cond_init.c
+++ b/src/thread/pthread_cond_init.c
@@ -2,7 +2,7 @@
int pthread_cond_init(pthread_cond_t *restrict c, const pthread_condattr_t *restrict a)
{
- memset(c, 0, sizeof *c);
+ *c = (pthread_cond_t){0};
if (a) {
c->_c_clock = *a & 0x7fffffff;
if (*a>>31) c->_c_mutex = (void *)-1;
diff --git a/src/thread/pthread_condattr_init.c b/src/thread/pthread_condattr_init.c
index 6d09ac1e..a41741b4 100644
--- a/src/thread/pthread_condattr_init.c
+++ b/src/thread/pthread_condattr_init.c
@@ -2,6 +2,6 @@
int pthread_condattr_init(pthread_condattr_t *a)
{
- memset(a, 0, sizeof *a);
+ *a = (pthread_condattr_t){0};
return 0;
}
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index e67616e7..a7aadb51 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -1,5 +1,6 @@
#include "pthread_impl.h"
#include "stdio_impl.h"
+#include <sys/mman.h>
static void dummy_0()
{
diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c
index 86191f25..719c91ca 100644
--- a/src/thread/pthread_join.c
+++ b/src/thread/pthread_join.c
@@ -1,4 +1,5 @@
#include "pthread_impl.h"
+#include <sys/mman.h>
static void dummy(void *p)
{
diff --git a/src/thread/pthread_mutex_init.c b/src/thread/pthread_mutex_init.c
index fb689271..a7ba39ba 100644
--- a/src/thread/pthread_mutex_init.c
+++ b/src/thread/pthread_mutex_init.c
@@ -2,7 +2,7 @@
int pthread_mutex_init(pthread_mutex_t *restrict m, const pthread_mutexattr_t *restrict a)
{
- memset(m, 0, sizeof *m);
+ *m = (pthread_mutex_t){0};
if (a) m->_m_type = *a & 7;
return 0;
}
diff --git a/src/thread/pthread_mutexattr_init.c b/src/thread/pthread_mutexattr_init.c
index ea631069..0b72c1ba 100644
--- a/src/thread/pthread_mutexattr_init.c
+++ b/src/thread/pthread_mutexattr_init.c
@@ -2,6 +2,6 @@
int pthread_mutexattr_init(pthread_mutexattr_t *a)
{
- memset(a, 0, sizeof *a);
+ *a = (pthread_mutexattr_t){0};
return 0;
}
diff --git a/src/thread/pthread_rwlock_init.c b/src/thread/pthread_rwlock_init.c
index 29003bc6..82df52e2 100644
--- a/src/thread/pthread_rwlock_init.c
+++ b/src/thread/pthread_rwlock_init.c
@@ -2,7 +2,7 @@
int pthread_rwlock_init(pthread_rwlock_t *restrict rw, const pthread_rwlockattr_t *restrict a)
{
- memset(rw, 0, sizeof *rw);
+ *rw = (pthread_rwlock_t){0};
if (a) {
}
return 0;
diff --git a/src/thread/pthread_rwlockattr_init.c b/src/thread/pthread_rwlockattr_init.c
index e0893d67..e7420694 100644
--- a/src/thread/pthread_rwlockattr_init.c
+++ b/src/thread/pthread_rwlockattr_init.c
@@ -2,6 +2,6 @@
int pthread_rwlockattr_init(pthread_rwlockattr_t *a)
{
- memset(a, 0, sizeof *a);
+ *a = (pthread_rwlockattr_t){0};
return 0;
}
diff --git a/src/thread/synccall.c b/src/thread/synccall.c
index 2b7eac25..dc59863f 100644
--- a/src/thread/synccall.c
+++ b/src/thread/synccall.c
@@ -1,5 +1,6 @@
#include "pthread_impl.h"
#include <semaphore.h>
+#include <string.h>
static struct chain {
struct chain *next;