This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/16631] New: pthread_mutex_getprioceiling return EINVAL when mutex protocol attribute is PTHREAD_PRIO_INHERIT


https://sourceware.org/bugzilla/show_bug.cgi?id=16631

            Bug ID: 16631
           Summary: pthread_mutex_getprioceiling return EINVAL when mutex
                    protocol attribute is PTHREAD_PRIO_INHERIT
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: mallachiev at ispras dot ru
                CC: drepper.fsp at gmail dot com

POSIX say that pthread_mutex_getprioceiling shall fail if "The protocol
attribute of mutex is PTHREAD_PRIO_NONE" with error "EINVAL".

But this simple code return EINVAL if the protocol attribute is
PTHREAD_PRIO_INHERIT.

#include <pthread.h>
#include <stdio.h>

int main()
{
    int prio, res;
    pthread_mutex_t mutex;
    pthread_mutexattr_t attr;

    pthread_mutexattr_init(&attr);
    pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);

    pthread_mutex_init(&mutex, &attr);

    res = pthread_mutex_getprioceiling(&mutex, &prio);
    printf("(INHERIT) getprioceiling res=%d prio=%d\n", res, prio);
}

I looked at file nptl/pthread_mutex_getprioceiling.c and it return EIVAL if
protocol is not PTHREAD_MUTEX_PRIO_PROTECT

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]