--- /dev/null
+From 919ebbd97b3992b5e66153b19982f28cb9bf734e Mon Sep 17 00:00:00 2001
+From: Costin Lupu <costin.lup@gmail.com>
+Date: Sat, 9 Mar 2019 19:22:23 +0200
+Subject: [PATCH 1/5] tests bugfix Set type size of result used in pthread_join
+ calls to word size
+
+
+diff --git a/tests/barrier3.c b/tests/barrier3.c
+index 1f16a79..45fc1cf 100644
+--- a/tests/barrier3.c
++++ b/tests/barrier3.c
+@@ -47,7 +47,7 @@
+ #include "test.h"
+
+ static pthread_barrier_t barrier = NULL;
+-static int result = 1;
++static long result = 1;
+ \r
+ static void * func(void * arg)
+ {
+diff --git a/tests/barrier5.c b/tests/barrier5.c
+index 17e0fd5..4055c51 100644
+--- a/tests/barrier5.c
++++ b/tests/barrier5.c
+@@ -94,8 +94,8 @@ func(void * barrierHeight)
+ int pthread_test_barrier5()
+ {
+ int i, j;
+- int result;
+- int serialThreadsTotal;
++ long result;
++ long serialThreadsTotal;
+ pthread_t t[NUMTHREADS + 1];
+
+ mx = PTHREAD_MUTEX_INITIALIZER;
+diff --git a/tests/cancel2.c b/tests/cancel2.c
+index 0c2b143..3635933 100644
+--- a/tests/cancel2.c
++++ b/tests/cancel2.c
+@@ -215,7 +215,7 @@ int pthread_test_cancel2()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(t[i], (void **) &result) == 0);
+ fail = (result != (int) PTHREAD_CANCELED);
+diff --git a/tests/cancel3.c b/tests/cancel3.c
+index c59ff58..f9f563b 100644
+--- a/tests/cancel3.c
++++ b/tests/cancel3.c
+@@ -180,7 +180,7 @@ int pthread_test_cancel3()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ /*
+ * The thread does not contain any cancelation points, so
+diff --git a/tests/cancel4.c b/tests/cancel4.c
+index cc0e5b1..3853cd8 100644
+--- a/tests/cancel4.c
++++ b/tests/cancel4.c
+@@ -179,7 +179,7 @@ int pthread_test_cancel4()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ /*
+ * The thread does not contain any cancelation points, so
+diff --git a/tests/cancel5.c b/tests/cancel5.c
+index 7ed0eb7..d50bf3f 100644
+--- a/tests/cancel5.c
++++ b/tests/cancel5.c
+@@ -176,7 +176,7 @@ int pthread_test_cancel5()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ /*
+ * The thread does not contain any cancelation points, so
+diff --git a/tests/cancel6a.c b/tests/cancel6a.c
+index 309c7a5..e6d44bf 100644
+--- a/tests/cancel6a.c
++++ b/tests/cancel6a.c
+@@ -169,7 +169,7 @@ int pthread_test_cancel6a()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ /*
+ * The thread does not contain any cancelation points, so
+diff --git a/tests/cancel6d.c b/tests/cancel6d.c
+index e448915..27f68f9 100644
+--- a/tests/cancel6d.c
++++ b/tests/cancel6d.c
+@@ -171,7 +171,7 @@ int pthread_test_cancel6d()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(t[i], (void **) &result) == 0);
+
+diff --git a/tests/cleanup0.c b/tests/cleanup0.c
+index 069f98d..a641989 100644
+--- a/tests/cleanup0.c
++++ b/tests/cleanup0.c
+@@ -191,7 +191,7 @@ int pthread_test_cleanup0()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(t[i], (void **) &result) == 0);
+
+diff --git a/tests/cleanup1.c b/tests/cleanup1.c
+index 8653fd4..68bc6ab 100644
+--- a/tests/cleanup1.c
++++ b/tests/cleanup1.c
+@@ -206,7 +206,7 @@ int pthread_test_cleanup1()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(t[i], (void **) &result) == 0);
+
+diff --git a/tests/cleanup2.c b/tests/cleanup2.c
+index b4a2513..5df8346 100644
+--- a/tests/cleanup2.c
++++ b/tests/cleanup2.c
+@@ -181,7 +181,7 @@ int pthread_test_cleanup2()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(t[i], (void **) &result) == 0);
+
+diff --git a/tests/cleanup3.c b/tests/cleanup3.c
+index 045b848..1b83d71 100644
+--- a/tests/cleanup3.c
++++ b/tests/cleanup3.c
+@@ -192,7 +192,7 @@ int pthread_test_cleanup3()
+ for (i = 1; i <= NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(t[i], (void **) &result) == 0);
+
+diff --git a/tests/condvar1_2.c b/tests/condvar1_2.c
+index 670478d..26f63f7 100644
+--- a/tests/condvar1_2.c
++++ b/tests/condvar1_2.c
+@@ -95,7 +95,7 @@ static pthread_cond_t cv[NUM_CV];
+ int pthread_test_condvar1_2()
+ {
+ int i, j, k;
+- int result = -1;
++ long result = -1;
+ pthread_t t;
+
+ for (k = 0; k < NUM_LOOPS; k++)
+diff --git a/tests/condvar2_1.c b/tests/condvar2_1.c
+index 39f6787..003ae87 100644
+--- a/tests/condvar2_1.c
++++ b/tests/condvar2_1.c
+@@ -114,7 +114,7 @@ int pthread_test_condvar2_1()
+ {
+ int i;
+ pthread_t t[NUMTHREADS + 1];
+- int result = 0;
++ long result = 0;
+ struct _timeb currSysTime;
+ const unsigned int NANOSEC_PER_MILLISEC = 1000000;
+
+diff --git a/tests/condvar3_1.c b/tests/condvar3_1.c
+index 8725aec..aedcba9 100644
+--- a/tests/condvar3_1.c
++++ b/tests/condvar3_1.c
+@@ -146,7 +146,7 @@ int pthread_test_condvar3_1()
+ {
+ int i;
+ pthread_t t[NUMTHREADS + 1];
+- int result = 0;
++ long result = 0;
+
+ timedout = 0;
+ signaled = 0;
+diff --git a/tests/condvar3_2.c b/tests/condvar3_2.c
+index 91ade40..1fd181e 100644
+--- a/tests/condvar3_2.c
++++ b/tests/condvar3_2.c
+@@ -140,7 +140,7 @@ int pthread_test_condvar3_2()
+ {
+ int i;
+ pthread_t t[NUMTHREADS + 1];
+- int result = 0;
++ long result = 0;
+ struct _timeb currSysTime;
+ const unsigned int NANOSEC_PER_MILLISEC = 1000000;
+
+diff --git a/tests/delay2.c b/tests/delay2.c
+index 5eebb41..66edef7 100644
+--- a/tests/delay2.c
++++ b/tests/delay2.c
+@@ -67,7 +67,7 @@ func(void * arg)
+ int pthread_test_delay2()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+
+ mx = PTHREAD_MUTEX_INITIALIZER;
+
+diff --git a/tests/exception1.c b/tests/exception1.c
+index a73ccd4..409fd22 100644
+--- a/tests/exception1.c
++++ b/tests/exception1.c
+@@ -186,7 +186,7 @@ pthread_test_exception1()
+ for (i = 0; i < NUMTHREADS; i++)
+ {
+ int fail = 0;
+- int result = 0;
++ long result = 0;
+
+ /* Canceled thread */
+ assert(pthread_join(ct[i], (void **) &result) == 0);
+diff --git a/tests/inherit1.c b/tests/inherit1.c
+index d7c1000..2fbd25a 100644
+--- a/tests/inherit1.c
++++ b/tests/inherit1.c
+@@ -100,7 +100,7 @@ int pthread_test_inherit1()
+ pthread_t t;
+ pthread_t mainThread = pthread_self();
+ pthread_attr_t attr;
+- int result = 0;
++ long result = 0;
+ struct sched_param param;
+ struct sched_param mainParam;
+ int prio;
+diff --git a/tests/join0.c b/tests/join0.c
+index 0a06337..b0c1aca 100644
+--- a/tests/join0.c
++++ b/tests/join0.c
+@@ -61,7 +61,7 @@ func(void * arg)
+ int pthread_test_join0()
+ {
+ pthread_t id;
+- int result;
++ long result;
+
+ /* Create a single thread and wait for it to exit. */
+ assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
+diff --git a/tests/join1.c b/tests/join1.c
+index 4b55d6b..0dd9ad4 100644
+--- a/tests/join1.c
++++ b/tests/join1.c
+@@ -61,7 +61,7 @@ int pthread_test_join1()
+ {
+ pthread_t id[4];
+ int i;
+- int result;
++ long result;
+
+ /* Create a few threads and then exit. */
+ for (i = 0; i < 4; i++)
+diff --git a/tests/join2.c b/tests/join2.c
+index a2e1dc3..63ff174 100644
+--- a/tests/join2.c
++++ b/tests/join2.c
+@@ -55,7 +55,7 @@ int pthread_test_join2()
+ {
+ pthread_t id[4];
+ int i;
+- int result;
++ long result;
+
+ /* Create a few threads and then exit. */
+ for (i = 0; i < 4; i++)
+diff --git a/tests/join3.c b/tests/join3.c
+index 7f0d226..947aaff 100644
+--- a/tests/join3.c
++++ b/tests/join3.c
+@@ -55,7 +55,7 @@ int pthread_test_join3()
+ {
+ pthread_t id[4];
+ int i;
+- int result;
++ long result;
+
+ /* Create a few threads and then exit. */
+ for (i = 0; i < 4; i++)
+diff --git a/tests/mutex6e.c b/tests/mutex6e.c
+index 5a74a5e..4bbbfd4 100644
+--- a/tests/mutex6e.c
++++ b/tests/mutex6e.c
+@@ -83,7 +83,7 @@ int
+ pthread_test_mutex6e()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+ int mxType = -1;
+
+ lockCount = 0;
+diff --git a/tests/mutex6es.c b/tests/mutex6es.c
+index a4f98af..4a381e6 100644
+--- a/tests/mutex6es.c
++++ b/tests/mutex6es.c
+@@ -82,7 +82,7 @@ int
+ pthread_test_mutex6es()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+
+ lockCount = 0;
+
+diff --git a/tests/mutex6r.c b/tests/mutex6r.c
+index 9733471..2c7316e 100644
+--- a/tests/mutex6r.c
++++ b/tests/mutex6r.c
+@@ -82,7 +82,7 @@ int
+ pthread_test_mutex6r()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+ int mxType = -1;
+
+ lockCount = 0;
+diff --git a/tests/mutex6rs.c b/tests/mutex6rs.c
+index 3b5639e..ad7f9a5 100644
+--- a/tests/mutex6rs.c
++++ b/tests/mutex6rs.c
+@@ -81,7 +81,7 @@ int
+ pthread_test_mutex6rs()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+
+ lockCount = 0;
+ mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+diff --git a/tests/mutex7e.c b/tests/mutex7e.c
+index 572841e..1b36235 100644
+--- a/tests/mutex7e.c
++++ b/tests/mutex7e.c
+@@ -83,7 +83,7 @@ int
+ pthread_test_mutex7e()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+ int mxType = -1;
+
+ lockCount = 0;
+diff --git a/tests/mutex7r.c b/tests/mutex7r.c
+index ab2a070..09e9701 100644
+--- a/tests/mutex7r.c
++++ b/tests/mutex7r.c
+@@ -82,7 +82,7 @@ int
+ pthread_test_mutex7r()
+ {
+ pthread_t t;
+- int result = 0;
++ long result = 0;
+ int mxType = -1;
+
+ lockCount = 0;
+diff --git a/tests/rwlock6.c b/tests/rwlock6.c
+index 2ab1595..572c91a 100644
+--- a/tests/rwlock6.c
++++ b/tests/rwlock6.c
+@@ -82,9 +82,9 @@ int pthread_test_rwlock6()
+ pthread_t wrt1;
+ pthread_t wrt2;
+ pthread_t rdt;
+- int wr1Result = 0;
+- int wr2Result = 0;
+- int rdResult = 0;
++ long wr1Result = 0;
++ long wr2Result = 0;
++ long rdResult = 0;
+
+ rwlock1 = PTHREAD_RWLOCK_INITIALIZER;
+
+diff --git a/tests/rwlock6_t.c b/tests/rwlock6_t.c
+index cf92828..6b34dde 100644
+--- a/tests/rwlock6_t.c
++++ b/tests/rwlock6_t.c
+@@ -102,10 +102,10 @@ int pthread_test_rwlock6t()
+ pthread_t wrt2;
+ pthread_t rdt1;
+ pthread_t rdt2;
+- int wr1Result = 0;
+- int wr2Result = 0;
+- int rd1Result = 0;
+- int rd2Result = 0;
++ long wr1Result = 0;
++ long wr2Result = 0;
++ long rd1Result = 0;
++ long rd2Result = 0;
+
+ rwlock1 = PTHREAD_RWLOCK_INITIALIZER;
+
+diff --git a/tests/rwlock6_t2.c b/tests/rwlock6_t2.c
+index 916c4c5..4f24d7d 100644
+--- a/tests/rwlock6_t2.c
++++ b/tests/rwlock6_t2.c
+@@ -94,9 +94,9 @@ int pthread_test_rwlock6t2()
+ pthread_t wrt1;
+ pthread_t wrt2;
+ pthread_t rdt;
+- int wr1Result = 0;
+- int wr2Result = 0;
+- int rdResult = 0;
++ long wr1Result = 0;
++ long wr2Result = 0;
++ long rdResult = 0;
+ struct _timeb currSysTime;
+ const long long NANOSEC_PER_MILLISEC = 1000000;
+
+diff --git a/tests/semaphore1.c b/tests/semaphore1.c
+index 3dd85ee..5baa8a4 100644
+--- a/tests/semaphore1.c
++++ b/tests/semaphore1.c
+@@ -111,7 +111,7 @@ int pthread_test_semaphore1(void)
+ {
+ pthread_t t;
+ sem_t s;
+- int result;
++ long result;
+
+ assert(pthread_create(&t, NULL, thr, NULL) == 0);
+ assert(pthread_join(t, (void **)&result) == 0);
+diff --git a/tests/semaphore4.c b/tests/semaphore4.c
+index 7530424..e1bc8f8 100644
+--- a/tests/semaphore4.c
++++ b/tests/semaphore4.c
+@@ -134,7 +134,7 @@ int pthread_test_semaphore4(void)
+
+ assert(pthread_cancel(t[5]) == 0);
+ {
+- int result;
++ long result;
+ assert(pthread_join(t[5], (void **) &result) == 0);
+ }
+ assert(sem_getvalue(&s, &value) == 0);
+diff --git a/tests/tsd1.c b/tests/tsd1.c
+index 4c5308b..929c929 100644
+--- a/tests/tsd1.c
++++ b/tests/tsd1.c
+@@ -197,7 +197,7 @@ int pthread_test_tsd1()
+ */
+ for (i = 1; i < NUM_THREADS; i++)
+ {
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(thread[i], (void **) &result) == 0);
+ }
+diff --git a/tests/tsd2.c b/tests/tsd2.c
+index a9558ab..d36df9f 100644
+--- a/tests/tsd2.c
++++ b/tests/tsd2.c
+@@ -195,7 +195,7 @@ int pthread_test_tsd2()
+ */
+ for (i = 1; i < NUM_THREADS; i++)
+ {
+- int result = 0;
++ long result = 0;
+
+ assert(pthread_join(thread[i], (void **) &result) == 0);
+ }
+--
+2.11.0
+