Displaying 1 result from an estimated 1 matches for "pthread_mutex_type_max".
2008 Mar 20
1
pthread_mutexattr_settype non-conformance to man-page and POSIX
...VAL]           Invalid value for attr, or invalid value for type.
"""
This does not happen (at least not in libthr):
"""
int
_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
        int     ret;
        if (attr == NULL || *attr == NULL || type >= PTHREAD_MUTEX_TYPE_MAX) {
                errno = EINVAL;
                ret = -1;
        } else {
                (*attr)->m_type = type;
                ret = 0;
        }
        return(ret);
}
"""
The error code EINVAL is stored to errno, and -1 is returned, which is wrong 
at least according to...