From: Tom Hughes Date: Wed, 13 Oct 2004 18:29:54 +0000 (+0000) Subject: Implement pthread_mutexattr_gettype. X-Git-Tag: svn/VALGRIND_3_0_0~1534 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aa943f1297265086d015cdbabd7b2d346b2f865;p=thirdparty%2Fvalgrind.git Implement pthread_mutexattr_gettype. CCMAIL: 91199-done@bugs.kde.org git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2759 --- diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index 6bab98802b..b8f8e7eb4f 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -1276,6 +1276,16 @@ int __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) } } +int __pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type) +{ + vg_pthread_mutexattr_t* vg_attr; + CONVERT(mutexattr, attr, vg_attr); + + *type = vg_attr->__vg_mutexkind; + + return 0; +} + int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr) { return 0; @@ -3351,6 +3361,7 @@ strong_alias(__pthread_mutex_trylock, pthread_mutex_trylock) strong_alias(__pthread_mutex_unlock, pthread_mutex_unlock) strong_alias(__pthread_mutexattr_init, pthread_mutexattr_init) weak_alias(__pthread_mutexattr_settype, pthread_mutexattr_settype) + weak_alias(__pthread_mutexattr_gettype, pthread_mutexattr_gettype) weak_alias(__pthread_mutexattr_setpshared, pthread_mutexattr_setpshared) strong_alias(__pthread_mutex_init, pthread_mutex_init) strong_alias(__pthread_mutexattr_destroy, pthread_mutexattr_destroy) diff --git a/coregrind/vg_libpthread_unimp.c b/coregrind/vg_libpthread_unimp.c index 805563063e..58c953ace0 100644 --- a/coregrind/vg_libpthread_unimp.c +++ b/coregrind/vg_libpthread_unimp.c @@ -225,8 +225,8 @@ __attribute__((weak)) void pthread_mutexattr_getkind_np ( void ) { vgPlain_unimp("pthread_mutexattr_getkind_np"); } __attribute__((weak)) void pthread_mutexattr_getpshared ( void ) { vgPlain_unimp("pthread_mutexattr_getpshared"); } -__attribute__((weak)) void pthread_mutexattr_gettype ( void ) - { vgPlain_unimp("pthread_mutexattr_gettype"); } +//__attribute__((weak)) void pthread_mutexattr_gettype ( void ) +// { vgPlain_unimp("pthread_mutexattr_gettype"); } __attribute__((weak)) void pthread_mutexattr_setkind_np ( void ) { vgPlain_unimp("pthread_mutexattr_setkind_np"); } //__attribute__((weak)) void pthread_mutexattr_setpshared ( void )