#include "pthread_impl.h" #include int __pthread_mutex_unlock(pthread_mutex_t *); int (mtx_unlock)(mtx_t *mtx) { /* In the best of all worlds this is a tail call. */ int ret = __pthread_mutex_unlock(mtx); /* In case of UB may also return EPERM. */ return ret ? thrd_error : thrd_success; }