diff options
author | EuAndreh <eu@euandre.org> | 2024-01-04 20:36:02 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-01-05 05:47:09 -0300 |
commit | 8492f115890d56c98c1da24b9fdf26bb1b714c05 (patch) | |
tree | 7d90469d2aff11c2e4c8e99e7b46aa8e8eb43008 /src/thread | |
parent | Fix the build system. (diff) | |
download | grovel-8492f115890d56c98c1da24b9fdf26bb1b714c05.tar.gz grovel-8492f115890d56c98c1da24b9fdf26bb1b714c05.tar.xz |
Setup stub unit test infrastructure
Diffstat (limited to 'src/thread')
126 files changed, 1008 insertions, 0 deletions
diff --git a/src/thread/__lock.c b/src/thread/__lock.c index 60eece49..df60ebcb 100644 --- a/src/thread/__lock.c +++ b/src/thread/__lock.c @@ -60,3 +60,11 @@ void __unlock(volatile int *l) } } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/__syscall_cp.c b/src/thread/__syscall_cp.c index 42a01674..f5c8b53a 100644 --- a/src/thread/__syscall_cp.c +++ b/src/thread/__syscall_cp.c @@ -18,3 +18,11 @@ long (__syscall_cp)(syscall_arg_t nr, { return __syscall_cp_c(nr, u, v, w, x, y, z); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/__timedwait.c b/src/thread/__timedwait.c index 666093be..63f23288 100644 --- a/src/thread/__timedwait.c +++ b/src/thread/__timedwait.c @@ -69,3 +69,11 @@ int __timedwait(volatile int *addr, int val, __pthread_setcancelstate(cs, 0); return r; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/__tls_get_addr.c b/src/thread/__tls_get_addr.c index 19524fe0..56018c4f 100644 --- a/src/thread/__tls_get_addr.c +++ b/src/thread/__tls_get_addr.c @@ -5,3 +5,11 @@ void *__tls_get_addr(tls_mod_off_t *v) pthread_t self = __pthread_self(); return (void *)(self->dtv[v[0]] + v[1]); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/__wait.c b/src/thread/__wait.c index dc33c1a3..c713e3e5 100644 --- a/src/thread/__wait.c +++ b/src/thread/__wait.c @@ -15,3 +15,11 @@ void __wait(volatile int *addr, volatile int *waiters, int val, int priv) } if (waiters) a_dec(waiters); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/call_once.c b/src/thread/call_once.c index 5ed30183..fa5428de 100644 --- a/src/thread/call_once.c +++ b/src/thread/call_once.c @@ -5,3 +5,11 @@ void call_once(once_flag *flag, void (*func)(void)) { __pthread_once(flag, func); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/cnd_broadcast.c b/src/thread/cnd_broadcast.c index e76b5a81..84fcbb08 100644 --- a/src/thread/cnd_broadcast.c +++ b/src/thread/cnd_broadcast.c @@ -7,3 +7,11 @@ int cnd_broadcast(cnd_t *c) * which matches the value thrd_success is defined with. */ return __private_cond_signal((pthread_cond_t *)c, -1); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/cnd_destroy.c b/src/thread/cnd_destroy.c index 453c90be..825103a1 100644 --- a/src/thread/cnd_destroy.c +++ b/src/thread/cnd_destroy.c @@ -4,3 +4,11 @@ void cnd_destroy(cnd_t *c) { /* For private cv this is a no-op */ } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/cnd_init.c b/src/thread/cnd_init.c index 18c50855..0f625626 100644 --- a/src/thread/cnd_init.c +++ b/src/thread/cnd_init.c @@ -5,3 +5,11 @@ int cnd_init(cnd_t *c) *c = (cnd_t){ 0 }; return thrd_success; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/cnd_signal.c b/src/thread/cnd_signal.c index 02cdc6c6..7190d199 100644 --- a/src/thread/cnd_signal.c +++ b/src/thread/cnd_signal.c @@ -7,3 +7,11 @@ int cnd_signal(cnd_t *c) * which matches the value thrd_success is defined with. */ return __private_cond_signal((pthread_cond_t *)c, 1); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/cnd_timedwait.c b/src/thread/cnd_timedwait.c index 2802af52..0d010107 100644 --- a/src/thread/cnd_timedwait.c +++ b/src/thread/cnd_timedwait.c @@ -12,3 +12,11 @@ int cnd_timedwait(cnd_t *restrict c, mtx_t *restrict m, const struct timespec *r case ETIMEDOUT: return thrd_timedout; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/cnd_wait.c b/src/thread/cnd_wait.c index 602796f8..7a6765d7 100644 --- a/src/thread/cnd_wait.c +++ b/src/thread/cnd_wait.c @@ -7,3 +7,11 @@ int cnd_wait(cnd_t *c, mtx_t *m) * for return values. */ return cnd_timedwait(c, m, 0); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/default_attr.c b/src/thread/default_attr.c index dce96409..e4f052e1 100644 --- a/src/thread/default_attr.c +++ b/src/thread/default_attr.c @@ -2,3 +2,11 @@ unsigned __default_stacksize = DEFAULT_STACK_SIZE; unsigned __default_guardsize = DEFAULT_GUARD_SIZE; + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/lock_ptc.c b/src/thread/lock_ptc.c index 7adedab7..03435897 100644 --- a/src/thread/lock_ptc.c +++ b/src/thread/lock_ptc.c @@ -16,3 +16,11 @@ void __release_ptc() { pthread_rwlock_unlock(&lock); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/mtx_destroy.c b/src/thread/mtx_destroy.c index 40a08999..dca5d707 100644 --- a/src/thread/mtx_destroy.c +++ b/src/thread/mtx_destroy.c @@ -3,3 +3,11 @@ void mtx_destroy(mtx_t *mtx) { } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/mtx_init.c b/src/thread/mtx_init.c index 4826f76b..346d9dee 100644 --- a/src/thread/mtx_init.c +++ b/src/thread/mtx_init.c @@ -8,3 +8,11 @@ int mtx_init(mtx_t *m, int type) }; return thrd_success; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/mtx_lock.c b/src/thread/mtx_lock.c index 5c2415c1..e2ed1cac 100644 --- a/src/thread/mtx_lock.c +++ b/src/thread/mtx_lock.c @@ -10,3 +10,11 @@ int mtx_lock(mtx_t *m) * for return values. */ return mtx_timedlock(m, 0); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/mtx_timedlock.c b/src/thread/mtx_timedlock.c index d22c8cf4..84fb8a7f 100644 --- a/src/thread/mtx_timedlock.c +++ b/src/thread/mtx_timedlock.c @@ -11,3 +11,11 @@ int mtx_timedlock(mtx_t *restrict m, const struct timespec *restrict ts) case ETIMEDOUT: return thrd_timedout; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/mtx_trylock.c b/src/thread/mtx_trylock.c index 40a8b8c2..384d2ce8 100644 --- a/src/thread/mtx_trylock.c +++ b/src/thread/mtx_trylock.c @@ -13,3 +13,11 @@ int mtx_trylock(mtx_t *m) case EBUSY: return thrd_busy; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/mtx_unlock.c b/src/thread/mtx_unlock.c index 2e5c8cf6..a8e99d57 100644 --- a/src/thread/mtx_unlock.c +++ b/src/thread/mtx_unlock.c @@ -8,3 +8,11 @@ int mtx_unlock(mtx_t *mtx) * assume it does not return an error and simply tail call. */ return __pthread_mutex_unlock((pthread_mutex_t *)mtx); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_atfork.c b/src/thread/pthread_atfork.c index 26d32543..4c013c6b 100644 --- a/src/thread/pthread_atfork.c +++ b/src/thread/pthread_atfork.c @@ -53,3 +53,11 @@ int pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(vo UNLOCK(lock); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_destroy.c b/src/thread/pthread_attr_destroy.c index b5845dd0..0370a4ab 100644 --- a/src/thread/pthread_attr_destroy.c +++ b/src/thread/pthread_attr_destroy.c @@ -4,3 +4,11 @@ int pthread_attr_destroy(pthread_attr_t *a) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_get.c b/src/thread/pthread_attr_get.c index f12ff442..2de77dd0 100644 --- a/src/thread/pthread_attr_get.c +++ b/src/thread/pthread_attr_get.c @@ -96,3 +96,11 @@ int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict a, int *r *pshared = a->__attr[0]; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_init.c b/src/thread/pthread_attr_init.c index 463a8d20..79082098 100644 --- a/src/thread/pthread_attr_init.c +++ b/src/thread/pthread_attr_init.c @@ -9,3 +9,11 @@ int pthread_attr_init(pthread_attr_t *a) __release_ptc(); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setdetachstate.c b/src/thread/pthread_attr_setdetachstate.c index 1b712783..30c5627d 100644 --- a/src/thread/pthread_attr_setdetachstate.c +++ b/src/thread/pthread_attr_setdetachstate.c @@ -6,3 +6,11 @@ int pthread_attr_setdetachstate(pthread_attr_t *a, int state) a->_a_detach = state; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setguardsize.c b/src/thread/pthread_attr_setguardsize.c index 1c5c60ac..579aad75 100644 --- a/src/thread/pthread_attr_setguardsize.c +++ b/src/thread/pthread_attr_setguardsize.c @@ -6,3 +6,11 @@ int pthread_attr_setguardsize(pthread_attr_t *a, size_t size) a->_a_guardsize = size; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setinheritsched.c b/src/thread/pthread_attr_setinheritsched.c index ca264be7..318ffbdc 100644 --- a/src/thread/pthread_attr_setinheritsched.c +++ b/src/thread/pthread_attr_setinheritsched.c @@ -7,3 +7,11 @@ int pthread_attr_setinheritsched(pthread_attr_t *a, int inherit) a->_a_sched = inherit; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setschedparam.c b/src/thread/pthread_attr_setschedparam.c index d4c1204f..33d2625d 100644 --- a/src/thread/pthread_attr_setschedparam.c +++ b/src/thread/pthread_attr_setschedparam.c @@ -5,3 +5,11 @@ int pthread_attr_setschedparam(pthread_attr_t *restrict a, const struct sched_pa a->_a_prio = param->sched_priority; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setschedpolicy.c b/src/thread/pthread_attr_setschedpolicy.c index bb71f393..56ed057a 100644 --- a/src/thread/pthread_attr_setschedpolicy.c +++ b/src/thread/pthread_attr_setschedpolicy.c @@ -5,3 +5,11 @@ int pthread_attr_setschedpolicy(pthread_attr_t *a, int policy) a->_a_policy = policy; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setscope.c b/src/thread/pthread_attr_setscope.c index 46b520c0..c7f57ab4 100644 --- a/src/thread/pthread_attr_setscope.c +++ b/src/thread/pthread_attr_setscope.c @@ -11,3 +11,11 @@ int pthread_attr_setscope(pthread_attr_t *a, int scope) return EINVAL; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setstack.c b/src/thread/pthread_attr_setstack.c index 1eddcbd6..1411e66e 100644 --- a/src/thread/pthread_attr_setstack.c +++ b/src/thread/pthread_attr_setstack.c @@ -7,3 +7,11 @@ int pthread_attr_setstack(pthread_attr_t *a, void *addr, size_t size) a->_a_stacksize = size; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_attr_setstacksize.c b/src/thread/pthread_attr_setstacksize.c index 9c6a8806..32386124 100644 --- a/src/thread/pthread_attr_setstacksize.c +++ b/src/thread/pthread_attr_setstacksize.c @@ -7,3 +7,11 @@ int pthread_attr_setstacksize(pthread_attr_t *a, size_t size) a->_a_stacksize = size; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_barrier_destroy.c b/src/thread/pthread_barrier_destroy.c index 4ce0b2e1..27c04464 100644 --- a/src/thread/pthread_barrier_destroy.c +++ b/src/thread/pthread_barrier_destroy.c @@ -13,3 +13,11 @@ int pthread_barrier_destroy(pthread_barrier_t *b) } return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_barrier_init.c b/src/thread/pthread_barrier_init.c index 4c3cb28d..49bdd70c 100644 --- a/src/thread/pthread_barrier_init.c +++ b/src/thread/pthread_barrier_init.c @@ -6,3 +6,11 @@ int pthread_barrier_init(pthread_barrier_t *restrict b, const pthread_barrieratt *b = (pthread_barrier_t){ ._b_limit = count-1 | (a?a->__attr:0) }; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_barrier_wait.c b/src/thread/pthread_barrier_wait.c index cc2a8bbf..9561bfcf 100644 --- a/src/thread/pthread_barrier_wait.c +++ b/src/thread/pthread_barrier_wait.c @@ -109,3 +109,11 @@ int pthread_barrier_wait(pthread_barrier_t *b) return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_barrierattr_destroy.c b/src/thread/pthread_barrierattr_destroy.c index adec738f..13fcb7fb 100644 --- a/src/thread/pthread_barrierattr_destroy.c +++ b/src/thread/pthread_barrierattr_destroy.c @@ -4,3 +4,11 @@ int pthread_barrierattr_destroy(pthread_barrierattr_t *a) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_barrierattr_init.c b/src/thread/pthread_barrierattr_init.c index fa742bb7..4cba9502 100644 --- a/src/thread/pthread_barrierattr_init.c +++ b/src/thread/pthread_barrierattr_init.c @@ -5,3 +5,11 @@ int pthread_barrierattr_init(pthread_barrierattr_t *a) *a = (pthread_barrierattr_t){0}; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_barrierattr_setpshared.c b/src/thread/pthread_barrierattr_setpshared.c index c2d2929d..8835406d 100644 --- a/src/thread/pthread_barrierattr_setpshared.c +++ b/src/thread/pthread_barrierattr_setpshared.c @@ -6,3 +6,11 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared) a->__attr = pshared ? INT_MIN : 0; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c index 139a6fc8..89219e58 100644 --- a/src/thread/pthread_cancel.c +++ b/src/thread/pthread_cancel.c @@ -104,3 +104,11 @@ int pthread_cancel(pthread_t t) } return pthread_kill(t, SIGCANCEL); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cleanup_push.c b/src/thread/pthread_cleanup_push.c index 9b21764b..f0afdd04 100644 --- a/src/thread/pthread_cleanup_push.c +++ b/src/thread/pthread_cleanup_push.c @@ -18,3 +18,11 @@ void _pthread_cleanup_pop(struct __ptcb *cb, int run) __do_cleanup_pop(cb); if (run) cb->__f(cb->__x); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c index 6bfab78f..daee8c4d 100644 --- a/src/thread/pthread_cond_broadcast.c +++ b/src/thread/pthread_cond_broadcast.c @@ -8,3 +8,11 @@ int pthread_cond_broadcast(pthread_cond_t *c) __wake(&c->_c_seq, -1, 0); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cond_destroy.c b/src/thread/pthread_cond_destroy.c index 8c555160..31b2a4d3 100644 --- a/src/thread/pthread_cond_destroy.c +++ b/src/thread/pthread_cond_destroy.c @@ -12,3 +12,11 @@ int pthread_cond_destroy(pthread_cond_t *c) } return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cond_init.c b/src/thread/pthread_cond_init.c index 8c484ddc..eb7500ff 100644 --- a/src/thread/pthread_cond_init.c +++ b/src/thread/pthread_cond_init.c @@ -9,3 +9,11 @@ int pthread_cond_init(pthread_cond_t *restrict c, const pthread_condattr_t *rest } return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cond_signal.c b/src/thread/pthread_cond_signal.c index 575ad54b..a9a93e73 100644 --- a/src/thread/pthread_cond_signal.c +++ b/src/thread/pthread_cond_signal.c @@ -8,3 +8,11 @@ int pthread_cond_signal(pthread_cond_t *c) __wake(&c->_c_seq, 1, 0); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c index 6b761455..38cf9a21 100644 --- a/src/thread/pthread_cond_timedwait.c +++ b/src/thread/pthread_cond_timedwait.c @@ -211,3 +211,11 @@ int __private_cond_signal(pthread_cond_t *c, int n) } weak_alias(__pthread_cond_timedwait, pthread_cond_timedwait); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_cond_wait.c b/src/thread/pthread_cond_wait.c index 8735bf14..4e5917f6 100644 --- a/src/thread/pthread_cond_wait.c +++ b/src/thread/pthread_cond_wait.c @@ -4,3 +4,11 @@ int pthread_cond_wait(pthread_cond_t *restrict c, pthread_mutex_t *restrict m) { return pthread_cond_timedwait(c, m, 0); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_condattr_destroy.c b/src/thread/pthread_condattr_destroy.c index c54ec412..50e245c1 100644 --- a/src/thread/pthread_condattr_destroy.c +++ b/src/thread/pthread_condattr_destroy.c @@ -4,3 +4,11 @@ int pthread_condattr_destroy(pthread_condattr_t *a) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_condattr_init.c b/src/thread/pthread_condattr_init.c index a41741b4..ea3c2d08 100644 --- a/src/thread/pthread_condattr_init.c +++ b/src/thread/pthread_condattr_init.c @@ -5,3 +5,11 @@ int pthread_condattr_init(pthread_condattr_t *a) *a = (pthread_condattr_t){0}; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_condattr_setclock.c b/src/thread/pthread_condattr_setclock.c index 71125941..87c68f2d 100644 --- a/src/thread/pthread_condattr_setclock.c +++ b/src/thread/pthread_condattr_setclock.c @@ -7,3 +7,11 @@ int pthread_condattr_setclock(pthread_condattr_t *a, clockid_t clk) a->__attr |= clk; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_condattr_setpshared.c b/src/thread/pthread_condattr_setpshared.c index 51453e04..35fb085e 100644 --- a/src/thread/pthread_condattr_setpshared.c +++ b/src/thread/pthread_condattr_setpshared.c @@ -7,3 +7,11 @@ int pthread_condattr_setpshared(pthread_condattr_t *a, int pshared) a->__attr |= (unsigned)pshared<<31; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 087f6206..169ef1cf 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -395,3 +395,11 @@ fail: weak_alias(__pthread_exit, pthread_exit); weak_alias(__pthread_create, pthread_create); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c index d73a500e..2c2fcb47 100644 --- a/src/thread/pthread_detach.c +++ b/src/thread/pthread_detach.c @@ -16,3 +16,11 @@ static int __pthread_detach(pthread_t t) weak_alias(__pthread_detach, pthread_detach); weak_alias(__pthread_detach, thrd_detach); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_equal.c b/src/thread/pthread_equal.c index dbb73655..d1507b8a 100644 --- a/src/thread/pthread_equal.c +++ b/src/thread/pthread_equal.c @@ -8,3 +8,11 @@ static int __pthread_equal(pthread_t a, pthread_t b) weak_alias(__pthread_equal, pthread_equal); weak_alias(__pthread_equal, thrd_equal); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_getattr_np.c b/src/thread/pthread_getattr_np.c index 2881831f..93f14e6f 100644 --- a/src/thread/pthread_getattr_np.c +++ b/src/thread/pthread_getattr_np.c @@ -22,3 +22,11 @@ int pthread_getattr_np(pthread_t t, pthread_attr_t *a) } return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_getconcurrency.c b/src/thread/pthread_getconcurrency.c index 269429a8..ed2ddc11 100644 --- a/src/thread/pthread_getconcurrency.c +++ b/src/thread/pthread_getconcurrency.c @@ -4,3 +4,11 @@ int pthread_getconcurrency() { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_getcpuclockid.c b/src/thread/pthread_getcpuclockid.c index 9df14fb6..d404cb46 100644 --- a/src/thread/pthread_getcpuclockid.c +++ b/src/thread/pthread_getcpuclockid.c @@ -5,3 +5,11 @@ int pthread_getcpuclockid(pthread_t t, clockid_t *clockid) *clockid = (-t->tid-1)*8U + 6; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_getname_np.c b/src/thread/pthread_getname_np.c index 85504e45..d50a3c0b 100644 --- a/src/thread/pthread_getname_np.c +++ b/src/thread/pthread_getname_np.c @@ -23,3 +23,11 @@ int pthread_getname_np(pthread_t thread, char *name, size_t len) pthread_setcancelstate(cs, 0); return status; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_getschedparam.c b/src/thread/pthread_getschedparam.c index c098befb..227aece7 100644 --- a/src/thread/pthread_getschedparam.c +++ b/src/thread/pthread_getschedparam.c @@ -19,3 +19,11 @@ int pthread_getschedparam(pthread_t t, int *restrict policy, struct sched_param __restore_sigs(&set); return r; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_getspecific.c b/src/thread/pthread_getspecific.c index d9342a56..1a4e2d14 100644 --- a/src/thread/pthread_getspecific.c +++ b/src/thread/pthread_getspecific.c @@ -9,3 +9,11 @@ static void *__pthread_getspecific(pthread_key_t k) weak_alias(__pthread_getspecific, pthread_getspecific); weak_alias(__pthread_getspecific, tss_get); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c index 17dae85d..c3535e4b 100644 --- a/src/thread/pthread_join.c +++ b/src/thread/pthread_join.c @@ -38,3 +38,11 @@ static int __pthread_tryjoin_np(pthread_t t, void **res) weak_alias(__pthread_tryjoin_np, pthread_tryjoin_np); weak_alias(__pthread_timedjoin_np, pthread_timedjoin_np); weak_alias(__pthread_join, pthread_join); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c index 39770c7a..e44b2ed1 100644 --- a/src/thread/pthread_key_create.c +++ b/src/thread/pthread_key_create.c @@ -97,3 +97,11 @@ void __pthread_tsd_run_dtors() weak_alias(__pthread_key_create, pthread_key_create); weak_alias(__pthread_key_delete, pthread_key_delete); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 79ddb209..ef75480e 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -16,3 +16,11 @@ int pthread_kill(pthread_t t, int sig) __restore_sigs(&set); return r; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_consistent.c b/src/thread/pthread_mutex_consistent.c index 27c74e5b..9c7177e0 100644 --- a/src/thread/pthread_mutex_consistent.c +++ b/src/thread/pthread_mutex_consistent.c @@ -12,3 +12,11 @@ int pthread_mutex_consistent(pthread_mutex_t *m) a_and(&m->_m_lock, ~0x40000000); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_destroy.c b/src/thread/pthread_mutex_destroy.c index 8d1bf77b..57b50e46 100644 --- a/src/thread/pthread_mutex_destroy.c +++ b/src/thread/pthread_mutex_destroy.c @@ -8,3 +8,11 @@ int pthread_mutex_destroy(pthread_mutex_t *mutex) if (mutex->_m_type > 128) __vm_wait(); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_getprioceiling.c b/src/thread/pthread_mutex_getprioceiling.c index 8c75a661..648a8d21 100644 --- a/src/thread/pthread_mutex_getprioceiling.c +++ b/src/thread/pthread_mutex_getprioceiling.c @@ -4,3 +4,11 @@ int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict m, int *restric { return EINVAL; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_init.c b/src/thread/pthread_mutex_init.c index acf45a74..04278665 100644 --- a/src/thread/pthread_mutex_init.c +++ b/src/thread/pthread_mutex_init.c @@ -6,3 +6,11 @@ int pthread_mutex_init(pthread_mutex_t *restrict m, const pthread_mutexattr_t *r if (a) m->_m_type = a->__attr; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_lock.c b/src/thread/pthread_mutex_lock.c index 638d4b86..8c9ecf1c 100644 --- a/src/thread/pthread_mutex_lock.c +++ b/src/thread/pthread_mutex_lock.c @@ -10,3 +10,11 @@ int __pthread_mutex_lock(pthread_mutex_t *m) } weak_alias(__pthread_mutex_lock, pthread_mutex_lock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_setprioceiling.c b/src/thread/pthread_mutex_setprioceiling.c index 681f07c8..7ef4eaf6 100644 --- a/src/thread/pthread_mutex_setprioceiling.c +++ b/src/thread/pthread_mutex_setprioceiling.c @@ -4,3 +4,11 @@ int pthread_mutex_setprioceiling(pthread_mutex_t *restrict m, int ceiling, int * { return EINVAL; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_timedlock.c b/src/thread/pthread_mutex_timedlock.c index 9279fc54..449d9b18 100644 --- a/src/thread/pthread_mutex_timedlock.c +++ b/src/thread/pthread_mutex_timedlock.c @@ -90,3 +90,11 @@ int __pthread_mutex_timedlock(pthread_mutex_t *restrict m, const struct timespec } weak_alias(__pthread_mutex_timedlock, pthread_mutex_timedlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c index a24e7c58..c9a2e9f6 100644 --- a/src/thread/pthread_mutex_trylock.c +++ b/src/thread/pthread_mutex_trylock.c @@ -72,3 +72,11 @@ int __pthread_mutex_trylock(pthread_mutex_t *m) } weak_alias(__pthread_mutex_trylock, pthread_mutex_trylock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutex_unlock.c b/src/thread/pthread_mutex_unlock.c index b66423e6..8d574ab4 100644 --- a/src/thread/pthread_mutex_unlock.c +++ b/src/thread/pthread_mutex_unlock.c @@ -50,3 +50,11 @@ int __pthread_mutex_unlock(pthread_mutex_t *m) } weak_alias(__pthread_mutex_unlock, pthread_mutex_unlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutexattr_destroy.c b/src/thread/pthread_mutexattr_destroy.c index 9fd69747..036ad6eb 100644 --- a/src/thread/pthread_mutexattr_destroy.c +++ b/src/thread/pthread_mutexattr_destroy.c @@ -4,3 +4,11 @@ int pthread_mutexattr_destroy(pthread_mutexattr_t *a) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutexattr_init.c b/src/thread/pthread_mutexattr_init.c index 0b72c1ba..032ca144 100644 --- a/src/thread/pthread_mutexattr_init.c +++ b/src/thread/pthread_mutexattr_init.c @@ -5,3 +5,11 @@ int pthread_mutexattr_init(pthread_mutexattr_t *a) *a = (pthread_mutexattr_t){0}; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutexattr_setprotocol.c b/src/thread/pthread_mutexattr_setprotocol.c index 8b80c1ce..ecfa4d32 100644 --- a/src/thread/pthread_mutexattr_setprotocol.c +++ b/src/thread/pthread_mutexattr_setprotocol.c @@ -26,3 +26,11 @@ int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a, int protocol) return EINVAL; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutexattr_setpshared.c b/src/thread/pthread_mutexattr_setpshared.c index 100f6ff2..c2a09b48 100644 --- a/src/thread/pthread_mutexattr_setpshared.c +++ b/src/thread/pthread_mutexattr_setpshared.c @@ -7,3 +7,11 @@ int pthread_mutexattr_setpshared(pthread_mutexattr_t *a, int pshared) a->__attr |= pshared<<7; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutexattr_setrobust.c b/src/thread/pthread_mutexattr_setrobust.c index 30a9ac3b..8f835ff1 100644 --- a/src/thread/pthread_mutexattr_setrobust.c +++ b/src/thread/pthread_mutexattr_setrobust.c @@ -21,3 +21,11 @@ int pthread_mutexattr_setrobust(pthread_mutexattr_t *a, int robust) a->__attr &= ~4; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_mutexattr_settype.c b/src/thread/pthread_mutexattr_settype.c index cd7a80e3..91b1e22b 100644 --- a/src/thread/pthread_mutexattr_settype.c +++ b/src/thread/pthread_mutexattr_settype.c @@ -6,3 +6,11 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *a, int type) a->__attr = (a->__attr & ~3) | type; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_once.c b/src/thread/pthread_once.c index 8e8d40ae..37d0f4bc 100644 --- a/src/thread/pthread_once.c +++ b/src/thread/pthread_once.c @@ -48,3 +48,11 @@ int __pthread_once(pthread_once_t *control, void (*init)(void)) } weak_alias(__pthread_once, pthread_once); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_destroy.c b/src/thread/pthread_rwlock_destroy.c index 49ecfbd0..bb1358a3 100644 --- a/src/thread/pthread_rwlock_destroy.c +++ b/src/thread/pthread_rwlock_destroy.c @@ -4,3 +4,11 @@ int pthread_rwlock_destroy(pthread_rwlock_t *rw) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_init.c b/src/thread/pthread_rwlock_init.c index a2c0b478..c5504805 100644 --- a/src/thread/pthread_rwlock_init.c +++ b/src/thread/pthread_rwlock_init.c @@ -6,3 +6,11 @@ int pthread_rwlock_init(pthread_rwlock_t *restrict rw, const pthread_rwlockattr_ if (a) rw->_rw_shared = a->__attr[0]*128; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_rdlock.c b/src/thread/pthread_rwlock_rdlock.c index 8546c07d..9ecf5995 100644 --- a/src/thread/pthread_rwlock_rdlock.c +++ b/src/thread/pthread_rwlock_rdlock.c @@ -6,3 +6,11 @@ int __pthread_rwlock_rdlock(pthread_rwlock_t *rw) } weak_alias(__pthread_rwlock_rdlock, pthread_rwlock_rdlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_timedrdlock.c b/src/thread/pthread_rwlock_timedrdlock.c index 8cdd8ecf..62548901 100644 --- a/src/thread/pthread_rwlock_timedrdlock.c +++ b/src/thread/pthread_rwlock_timedrdlock.c @@ -23,3 +23,11 @@ int __pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rw, const struct tim } weak_alias(__pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_timedwrlock.c b/src/thread/pthread_rwlock_timedwrlock.c index d77706e6..ccae4eed 100644 --- a/src/thread/pthread_rwlock_timedwrlock.c +++ b/src/thread/pthread_rwlock_timedwrlock.c @@ -23,3 +23,11 @@ int __pthread_rwlock_timedwrlock(pthread_rwlock_t *restrict rw, const struct tim } weak_alias(__pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_tryrdlock.c b/src/thread/pthread_rwlock_tryrdlock.c index c13bc9cc..95f52439 100644 --- a/src/thread/pthread_rwlock_tryrdlock.c +++ b/src/thread/pthread_rwlock_tryrdlock.c @@ -13,3 +13,11 @@ int __pthread_rwlock_tryrdlock(pthread_rwlock_t *rw) } weak_alias(__pthread_rwlock_tryrdlock, pthread_rwlock_tryrdlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_trywrlock.c b/src/thread/pthread_rwlock_trywrlock.c index 64d9d312..773c3ddf 100644 --- a/src/thread/pthread_rwlock_trywrlock.c +++ b/src/thread/pthread_rwlock_trywrlock.c @@ -7,3 +7,11 @@ int __pthread_rwlock_trywrlock(pthread_rwlock_t *rw) } weak_alias(__pthread_rwlock_trywrlock, pthread_rwlock_trywrlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_unlock.c b/src/thread/pthread_rwlock_unlock.c index 9ae27ad2..a06323ca 100644 --- a/src/thread/pthread_rwlock_unlock.c +++ b/src/thread/pthread_rwlock_unlock.c @@ -18,3 +18,11 @@ int __pthread_rwlock_unlock(pthread_rwlock_t *rw) } weak_alias(__pthread_rwlock_unlock, pthread_rwlock_unlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlock_wrlock.c b/src/thread/pthread_rwlock_wrlock.c index 46a3b3a5..d2103d85 100644 --- a/src/thread/pthread_rwlock_wrlock.c +++ b/src/thread/pthread_rwlock_wrlock.c @@ -6,3 +6,11 @@ int __pthread_rwlock_wrlock(pthread_rwlock_t *rw) } weak_alias(__pthread_rwlock_wrlock, pthread_rwlock_wrlock); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlockattr_destroy.c b/src/thread/pthread_rwlockattr_destroy.c index fc8d611a..15ccbec0 100644 --- a/src/thread/pthread_rwlockattr_destroy.c +++ b/src/thread/pthread_rwlockattr_destroy.c @@ -4,3 +4,11 @@ int pthread_rwlockattr_destroy(pthread_rwlockattr_t *a) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlockattr_init.c b/src/thread/pthread_rwlockattr_init.c index e7420694..2ab1ac3c 100644 --- a/src/thread/pthread_rwlockattr_init.c +++ b/src/thread/pthread_rwlockattr_init.c @@ -5,3 +5,11 @@ int pthread_rwlockattr_init(pthread_rwlockattr_t *a) *a = (pthread_rwlockattr_t){0}; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_rwlockattr_setpshared.c b/src/thread/pthread_rwlockattr_setpshared.c index e7061973..3c9d11d8 100644 --- a/src/thread/pthread_rwlockattr_setpshared.c +++ b/src/thread/pthread_rwlockattr_setpshared.c @@ -6,3 +6,11 @@ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int pshared) a->__attr[0] = pshared; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_self.c b/src/thread/pthread_self.c index bd3bf95b..55b640a2 100644 --- a/src/thread/pthread_self.c +++ b/src/thread/pthread_self.c @@ -8,3 +8,11 @@ static pthread_t __pthread_self_internal() weak_alias(__pthread_self_internal, pthread_self); weak_alias(__pthread_self_internal, thrd_current); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setattr_default_np.c b/src/thread/pthread_setattr_default_np.c index 58486220..91502ce9 100644 --- a/src/thread/pthread_setattr_default_np.c +++ b/src/thread/pthread_setattr_default_np.c @@ -35,3 +35,11 @@ int pthread_getattr_default_np(pthread_attr_t *attrp) __release_ptc(); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setcancelstate.c b/src/thread/pthread_setcancelstate.c index 5ab8c338..28e96ad1 100644 --- a/src/thread/pthread_setcancelstate.c +++ b/src/thread/pthread_setcancelstate.c @@ -10,3 +10,11 @@ int __pthread_setcancelstate(int new, int *old) } weak_alias(__pthread_setcancelstate, pthread_setcancelstate); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setcanceltype.c b/src/thread/pthread_setcanceltype.c index bf0a3f38..8b665ac2 100644 --- a/src/thread/pthread_setcanceltype.c +++ b/src/thread/pthread_setcanceltype.c @@ -9,3 +9,11 @@ int pthread_setcanceltype(int new, int *old) if (new) pthread_testcancel(); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setconcurrency.c b/src/thread/pthread_setconcurrency.c index 091abf98..8b9a40e3 100644 --- a/src/thread/pthread_setconcurrency.c +++ b/src/thread/pthread_setconcurrency.c @@ -7,3 +7,11 @@ int pthread_setconcurrency(int val) if (val > 0) return EAGAIN; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setname_np.c b/src/thread/pthread_setname_np.c index fc2d2306..91697523 100644 --- a/src/thread/pthread_setname_np.c +++ b/src/thread/pthread_setname_np.c @@ -24,3 +24,11 @@ int pthread_setname_np(pthread_t thread, const char *name) pthread_setcancelstate(cs, 0); return status; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setschedparam.c b/src/thread/pthread_setschedparam.c index 76d4d45a..4a920d12 100644 --- a/src/thread/pthread_setschedparam.c +++ b/src/thread/pthread_setschedparam.c @@ -12,3 +12,11 @@ int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *par __restore_sigs(&set); return r; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c index fc2e13dd..ca4efbbd 100644 --- a/src/thread/pthread_setschedprio.c +++ b/src/thread/pthread_setschedprio.c @@ -12,3 +12,11 @@ int pthread_setschedprio(pthread_t t, int prio) __restore_sigs(&set); return r; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_setspecific.c b/src/thread/pthread_setspecific.c index 55e46a89..828802bb 100644 --- a/src/thread/pthread_setspecific.c +++ b/src/thread/pthread_setspecific.c @@ -10,3 +10,11 @@ int pthread_setspecific(pthread_key_t k, const void *x) } return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_sigmask.c b/src/thread/pthread_sigmask.c index f188782a..8d5b83c5 100644 --- a/src/thread/pthread_sigmask.c +++ b/src/thread/pthread_sigmask.c @@ -17,3 +17,11 @@ int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict ol } return ret; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_spin_destroy.c b/src/thread/pthread_spin_destroy.c index e65a820c..19a90b89 100644 --- a/src/thread/pthread_spin_destroy.c +++ b/src/thread/pthread_spin_destroy.c @@ -4,3 +4,11 @@ int pthread_spin_destroy(pthread_spinlock_t *s) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_spin_init.c b/src/thread/pthread_spin_init.c index 681881cf..ce4e4182 100644 --- a/src/thread/pthread_spin_init.c +++ b/src/thread/pthread_spin_init.c @@ -4,3 +4,11 @@ int pthread_spin_init(pthread_spinlock_t *s, int shared) { return *s = 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_spin_lock.c b/src/thread/pthread_spin_lock.c index ded2b653..c77173cb 100644 --- a/src/thread/pthread_spin_lock.c +++ b/src/thread/pthread_spin_lock.c @@ -6,3 +6,11 @@ int pthread_spin_lock(pthread_spinlock_t *s) while (*(volatile int *)s || a_cas(s, 0, EBUSY)) a_spin(); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_spin_trylock.c b/src/thread/pthread_spin_trylock.c index 5284fdac..45fc1ff5 100644 --- a/src/thread/pthread_spin_trylock.c +++ b/src/thread/pthread_spin_trylock.c @@ -5,3 +5,11 @@ int pthread_spin_trylock(pthread_spinlock_t *s) { return a_cas(s, 0, EBUSY); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_spin_unlock.c b/src/thread/pthread_spin_unlock.c index 724d9e0d..1603a977 100644 --- a/src/thread/pthread_spin_unlock.c +++ b/src/thread/pthread_spin_unlock.c @@ -5,3 +5,11 @@ int pthread_spin_unlock(pthread_spinlock_t *s) a_store(s, 0); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/pthread_testcancel.c b/src/thread/pthread_testcancel.c index d772449d..6b2e18e8 100644 --- a/src/thread/pthread_testcancel.c +++ b/src/thread/pthread_testcancel.c @@ -12,3 +12,11 @@ void __pthread_testcancel() } weak_alias(__pthread_testcancel, pthread_testcancel); + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_destroy.c b/src/thread/sem_destroy.c index f4aced5d..747ce836 100644 --- a/src/thread/sem_destroy.c +++ b/src/thread/sem_destroy.c @@ -4,3 +4,11 @@ int sem_destroy(sem_t *sem) { return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_getvalue.c b/src/thread/sem_getvalue.c index c0b7762d..a05d9022 100644 --- a/src/thread/sem_getvalue.c +++ b/src/thread/sem_getvalue.c @@ -7,3 +7,11 @@ int sem_getvalue(sem_t *restrict sem, int *restrict valp) *valp = val & SEM_VALUE_MAX; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_init.c b/src/thread/sem_init.c index 55092434..7381e684 100644 --- a/src/thread/sem_init.c +++ b/src/thread/sem_init.c @@ -13,3 +13,11 @@ int sem_init(sem_t *sem, int pshared, unsigned value) sem->__val[2] = pshared ? 0 : 128; return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_open.c b/src/thread/sem_open.c index 0ad29de9..ed5475f6 100644 --- a/src/thread/sem_open.c +++ b/src/thread/sem_open.c @@ -180,3 +180,11 @@ int sem_close(sem_t *sem) munmap(sem, sizeof *sem); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_post.c b/src/thread/sem_post.c index 5c2517f2..a9d8cf55 100644 --- a/src/thread/sem_post.c +++ b/src/thread/sem_post.c @@ -19,3 +19,11 @@ int sem_post(sem_t *sem) if (val<0) __wake(sem->__val, waiters>1 ? 1 : -1, priv); return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_timedwait.c b/src/thread/sem_timedwait.c index aa67376c..e3bfdf09 100644 --- a/src/thread/sem_timedwait.c +++ b/src/thread/sem_timedwait.c @@ -31,3 +31,11 @@ int sem_timedwait(sem_t *restrict sem, const struct timespec *restrict at) } return 0; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_trywait.c b/src/thread/sem_trywait.c index beb435da..5d46700e 100644 --- a/src/thread/sem_trywait.c +++ b/src/thread/sem_trywait.c @@ -11,3 +11,11 @@ int sem_trywait(sem_t *sem) errno = EAGAIN; return -1; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_unlink.c b/src/thread/sem_unlink.c index c06134bd..b837da9f 100644 --- a/src/thread/sem_unlink.c +++ b/src/thread/sem_unlink.c @@ -5,3 +5,11 @@ int sem_unlink(const char *name) { return shm_unlink(name); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/sem_wait.c b/src/thread/sem_wait.c index 264194f9..1bfd8847 100644 --- a/src/thread/sem_wait.c +++ b/src/thread/sem_wait.c @@ -4,3 +4,11 @@ int sem_wait(sem_t *sem) { return sem_timedwait(sem, 0); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/synccall.c b/src/thread/synccall.c index 38597254..4019fce5 100644 --- a/src/thread/synccall.c +++ b/src/thread/synccall.c @@ -120,3 +120,11 @@ single_threaded: __tl_unlock(); __restore_sigs(&oldmask); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/thrd_create.c b/src/thread/thrd_create.c index 76a683db..31b7bfb8 100644 --- a/src/thread/thrd_create.c +++ b/src/thread/thrd_create.c @@ -10,3 +10,11 @@ int thrd_create(thrd_t *thr, thrd_start_t func, void *arg) default: return thrd_error; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/thrd_exit.c b/src/thread/thrd_exit.c index 9b291ae3..c532f1a8 100644 --- a/src/thread/thrd_exit.c +++ b/src/thread/thrd_exit.c @@ -6,3 +6,11 @@ _Noreturn void thrd_exit(int result) { __pthread_exit((void*)(intptr_t)result); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/thrd_join.c b/src/thread/thrd_join.c index 0d5fd302..9d3ac030 100644 --- a/src/thread/thrd_join.c +++ b/src/thread/thrd_join.c @@ -9,3 +9,11 @@ int thrd_join(thrd_t t, int *res) if (res) *res = (int)(intptr_t)pthread_res; return thrd_success; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/thrd_sleep.c b/src/thread/thrd_sleep.c index 97de5345..18b09a3a 100644 --- a/src/thread/thrd_sleep.c +++ b/src/thread/thrd_sleep.c @@ -12,3 +12,11 @@ int thrd_sleep(const struct timespec *req, struct timespec *rem) default: return -2; } } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/thrd_yield.c b/src/thread/thrd_yield.c index f7ad1321..5aadf1c5 100644 --- a/src/thread/thrd_yield.c +++ b/src/thread/thrd_yield.c @@ -5,3 +5,11 @@ void thrd_yield() { __syscall(SYS_sched_yield); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/tls.c b/src/thread/tls.c index e69de29b..980a0611 100644 --- a/src/thread/tls.c +++ b/src/thread/tls.c @@ -0,0 +1,8 @@ + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/tss_create.c b/src/thread/tss_create.c index 6d6ef96b..e8c2aa92 100644 --- a/src/thread/tss_create.c +++ b/src/thread/tss_create.c @@ -8,3 +8,11 @@ int tss_create(tss_t *tss, tss_dtor_t dtor) * unless thrd_error equals EAGAIN. */ return __pthread_key_create(tss, dtor) ? thrd_error : thrd_success; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/tss_delete.c b/src/thread/tss_delete.c index 6f51b07e..c8550b2e 100644 --- a/src/thread/tss_delete.c +++ b/src/thread/tss_delete.c @@ -5,3 +5,11 @@ void tss_delete(tss_t key) { __pthread_key_delete(key); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/tss_set.c b/src/thread/tss_set.c index 70c4fb72..ae9d44bc 100644 --- a/src/thread/tss_set.c +++ b/src/thread/tss_set.c @@ -11,3 +11,11 @@ int tss_set(tss_t k, void *x) } return thrd_success; } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif diff --git a/src/thread/vmlock.c b/src/thread/vmlock.c index fa0a8e3c..b207ae90 100644 --- a/src/thread/vmlock.c +++ b/src/thread/vmlock.c @@ -21,3 +21,11 @@ void __vm_unlock() if (a_fetch_add(vmlock, -1)==1 && vmlock[1]) __wake(vmlock, -1, 1); } + + +#ifdef TEST +int +main(void) { + return 0; +} +#endif |