This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/15790] pthread_mutexattr_gettype doesn't store the value of the 'type' attribute into *type
- From: "schwab at linux-m68k dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 11 Aug 2014 09:11:33 +0000
- Subject: [Bug nptl/15790] pthread_mutexattr_gettype doesn't store the value of the 'type' attribute into *type
- Auto-submitted: auto-generated
- References: <bug-15790-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=15790
--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
This also means that the value returned by pthread_mutexattr_gettype is not a
valid input to pthread_mutexattr_settype.
#include <stdio.h>
#include <string.h>
#include <pthread.h>
int
main (void)
{
pthread_mutexattr_t attr;
int kind;
int error;
error = pthread_mutexattr_init (&attr);
if (error)
fprintf (stderr, "pthread_mutexattr_init: %s\n", strerror (error));
error = pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_DEFAULT);
if (error)
fprintf (stderr, "pthread_mutexattr_settype (1): %s\n", strerror (error));
error = pthread_mutexattr_gettype (&attr, &kind);
if (error)
fprintf (stderr, "pthread_mutexattr_gettype: %s\n", strerror (error));
error = pthread_mutexattr_settype (&attr, kind);
if (error)
fprintf (stderr, "pthread_mutexattr_settype (2): %s\n", strerror (error));
}
pthread_mutexattr_settype (2): Invalid argument
--
You are receiving this mail because:
You are on the CC list for the bug.