Here is a snippet from the pthread_mutex_lock() man page
RETURN VALUE If successful, the pthread_mutex_lock() and pthread_mutex_unlock() functions return zero. Otherwise, an error number is returned to indicate the error.
Following it is a list of possible error codes, EINVAL, EBUSY, etc.
Does the help mean that one of the error codes is returned as the return code
of pthread_mutex_lock() or that pthread_mutex_lock() returns non-zero (meaning what?) and sets errno
to one of the error codes?