From: Julian Seward Date: Sun, 6 Jul 2003 01:23:11 +0000 (+0000) Subject: Implement pthread_mutexattr_setpshared (Nick did this). X-Git-Tag: svn/VALGRIND_2_0_0~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cceee45f872b1f33d9e523b289d2ff2bf047addc;p=thirdparty%2Fvalgrind.git Implement pthread_mutexattr_setpshared (Nick did this). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1724 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index 8e4cb36978..098c7f7a75 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -906,6 +906,18 @@ int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr) return 0; } +int pthread_mutexattr_setpshared ( pthread_mutexattr_t* attr, int pshared) +{ + if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED) + return EINVAL; + + /* For now it is not possible to shared a conditional variable. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) + return ENOSYS; + + return 0; +} + /* --------------------------------------------------- MUTEXes diff --git a/coregrind/arch/x86-linux/vg_libpthread_unimp.c b/coregrind/arch/x86-linux/vg_libpthread_unimp.c index c502112f8e..bac177892f 100644 --- a/coregrind/arch/x86-linux/vg_libpthread_unimp.c +++ b/coregrind/arch/x86-linux/vg_libpthread_unimp.c @@ -251,8 +251,8 @@ __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 ) - { vgPlain_unimp("pthread_mutexattr_setpshared"); } +//__attribute__((weak)) void pthread_mutexattr_setpshared ( void ) +// { vgPlain_unimp("pthread_mutexattr_setpshared"); } //__attribute__((weak)) void pthread_setconcurrency ( void ) // { vgPlain_unimp("pthread_setconcurrency"); } __attribute__((weak)) void pthread_spin_destroy ( void ) diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index 8e4cb36978..098c7f7a75 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -906,6 +906,18 @@ int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr) return 0; } +int pthread_mutexattr_setpshared ( pthread_mutexattr_t* attr, int pshared) +{ + if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED) + return EINVAL; + + /* For now it is not possible to shared a conditional variable. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) + return ENOSYS; + + return 0; +} + /* --------------------------------------------------- MUTEXes diff --git a/coregrind/vg_libpthread_unimp.c b/coregrind/vg_libpthread_unimp.c index c502112f8e..bac177892f 100644 --- a/coregrind/vg_libpthread_unimp.c +++ b/coregrind/vg_libpthread_unimp.c @@ -251,8 +251,8 @@ __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 ) - { vgPlain_unimp("pthread_mutexattr_setpshared"); } +//__attribute__((weak)) void pthread_mutexattr_setpshared ( void ) +// { vgPlain_unimp("pthread_mutexattr_setpshared"); } //__attribute__((weak)) void pthread_setconcurrency ( void ) // { vgPlain_unimp("pthread_setconcurrency"); } __attribute__((weak)) void pthread_spin_destroy ( void )