Implement pthread_mutexattr_setpshared (Nick did this).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1724 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c
index 8e4cb36..098c7f7 100644
--- a/coregrind/arch/x86-linux/vg_libpthread.c
+++ b/coregrind/arch/x86-linux/vg_libpthread.c
@@ -906,6 +906,18 @@
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 c502112..bac1778 100644
--- a/coregrind/arch/x86-linux/vg_libpthread_unimp.c
+++ b/coregrind/arch/x86-linux/vg_libpthread_unimp.c
@@ -251,8 +251,8 @@
{ 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 8e4cb36..098c7f7 100644
--- a/coregrind/vg_libpthread.c
+++ b/coregrind/vg_libpthread.c
@@ -906,6 +906,18 @@
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 c502112..bac1778 100644
--- a/coregrind/vg_libpthread_unimp.c
+++ b/coregrind/vg_libpthread_unimp.c
@@ -251,8 +251,8 @@
{ 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 )