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 libc/15790] New: pthread_mutexattr_gettype doesn't store the value of the 'type' attribute into *type


http://sourceware.org/bugzilla/show_bug.cgi?id=15790

            Bug ID: 15790
           Summary: pthread_mutexattr_gettype doesn't store the value of
                    the 'type' attribute into *type
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: critical
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: aponomarenko at rosalab dot ru
                CC: drepper.fsp at gmail dot com

Hi,

The pthread_mutexattr_gettype function doesn't store the value of the 'type'
attribute into *type argument:

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

int main()
{
    pthread_mutexattr_t* attr;
    int res1 = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_NORMAL);

    int type = 0;
    int res2 = pthread_mutexattr_gettype(attr, &type);

    printf("%d, %d, %d\n", res1, res2, type);

    return 0;
}

Output: 0, 0, 512

Expected: 0, 0, 0

Environment: Fedora 18 on i686, linux 3.6.10-4

Spec:
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutexattr_gettype.html

"Upon successful completion, the pthread_mutexattr_gettype() function shall
return zero and store the value of the type attribute of attr into the object
referenced by the type parameter. Otherwise, an error shall be returned to
indicate the error."

See also: http://sourceware.org/ml/libc-alpha/2013-06/msg00891.html

-- 
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]