Missing pthread_mutexattr_t related constants

Bug #1099189 reported by prasad
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GLibC
New
Undecided
Unassigned
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

The compilation of following simple program fails

harshada@harshada-sangale:~/programs/c$ cat pthread_mutex.c
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>

int main()
{
        pthread_mutex_t m;
        pthread_mutexattr_t attr;

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

        pthread_mutex_init(&m, &attr);
        return 0;
}

$ gcc -o pthread_mutex pthread_mutex.c -lpthread
pthread_mutex.c: In function ‘main’:
pthread_mutex.c:12:33: error: ‘atrr’ undeclared (first use in this function)
pthread_mutex.c:12:33: note: each undeclared identifier is reported
only once for each function it appears in
pthread_mutex.c:12:39: error: ‘PTHREAD_PRIO_INHERIT’ undeclared (first
use in this function)

 affects ubuntu

Revision history for this message
prasad (prasadjoshi124) wrote :

I should have pasted this code

$ cat pthread_mutex.c
#include <pthread.h>

int main()
{
 pthread_mutex_t m;
 pthread_mutexattr_t attr;

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

 pthread_mutex_init(&m, &attr);
 return 0;
}

$ gcc -o pthread_mutex pthread_mutex.c -lpthread
pthread_mutex.c: In function ‘main’:
pthread_mutex.c:9:39: error: ‘PTHREAD_PRIO_INHERIT’ undeclared (first use in this function)
pthread_mutex.c:9:39: note: each undeclared identifier is reported only once for each function it appears in

Changed in ubuntu:
status: New → Invalid
prasad (prasadjoshi124)
summary: - Fwd: Missing pthread_mutexattr_t and related constants/APIs
+ Missing pthread_mutexattr_t related constants
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.