From: Julian Seward Date: Sat, 13 Jul 2002 12:58:44 +0000 (+0000) Subject: Copy pthread_rwlockattr_setpshared verbatim from LinuxThreads. X-Git-Tag: svn/VALGRIND_1_0_3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66d6958565c349de49839bc98876f87f1a41e8cc;p=thirdparty%2Fvalgrind.git Copy pthread_rwlockattr_setpshared verbatim from LinuxThreads. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@498 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index c3a11b2f35..2ccf8069e3 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -2745,6 +2745,22 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *attr) return 0; } +/* Copied directly from LinuxThreads. */ +int +pthread_rwlockattr_setpshared (pthread_rwlockattr_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; + + attr->__pshared = pshared; + + return 0; +} + /* --------------------------------------------------------------------- B'stard. diff --git a/coregrind/arch/x86-linux/vg_libpthread_unimp.c b/coregrind/arch/x86-linux/vg_libpthread_unimp.c index 6f8f75d236..f413887f27 100644 --- a/coregrind/arch/x86-linux/vg_libpthread_unimp.c +++ b/coregrind/arch/x86-linux/vg_libpthread_unimp.c @@ -144,7 +144,7 @@ void pthread_rwlockattr_getkind_np ( void ) { unimp("pthread_rwlockattr_getkind void pthread_rwlockattr_getpshared ( void ) { unimp("pthread_rwlockattr_getpshared"); } //void pthread_rwlockattr_init ( void ) { unimp("pthread_rwlockattr_init"); } void pthread_rwlockattr_setkind_np ( void ) { unimp("pthread_rwlockattr_setkind_np"); } -void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); } +//void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); } //void pthread_self ( void ) { unimp("pthread_self"); } //void pthread_setcancelstate ( void ) { unimp("pthread_setcancelstate"); } //void pthread_setcanceltype ( void ) { unimp("pthread_setcanceltype"); } diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index c3a11b2f35..2ccf8069e3 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -2745,6 +2745,22 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *attr) return 0; } +/* Copied directly from LinuxThreads. */ +int +pthread_rwlockattr_setpshared (pthread_rwlockattr_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; + + attr->__pshared = pshared; + + return 0; +} + /* --------------------------------------------------------------------- B'stard. diff --git a/coregrind/vg_libpthread_unimp.c b/coregrind/vg_libpthread_unimp.c index 6f8f75d236..f413887f27 100644 --- a/coregrind/vg_libpthread_unimp.c +++ b/coregrind/vg_libpthread_unimp.c @@ -144,7 +144,7 @@ void pthread_rwlockattr_getkind_np ( void ) { unimp("pthread_rwlockattr_getkind void pthread_rwlockattr_getpshared ( void ) { unimp("pthread_rwlockattr_getpshared"); } //void pthread_rwlockattr_init ( void ) { unimp("pthread_rwlockattr_init"); } void pthread_rwlockattr_setkind_np ( void ) { unimp("pthread_rwlockattr_setkind_np"); } -void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); } +//void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); } //void pthread_self ( void ) { unimp("pthread_self"); } //void pthread_setcancelstate ( void ) { unimp("pthread_setcancelstate"); } //void pthread_setcanceltype ( void ) { unimp("pthread_setcanceltype"); } diff --git a/vg_libpthread.c b/vg_libpthread.c index c3a11b2f35..2ccf8069e3 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -2745,6 +2745,22 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *attr) return 0; } +/* Copied directly from LinuxThreads. */ +int +pthread_rwlockattr_setpshared (pthread_rwlockattr_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; + + attr->__pshared = pshared; + + return 0; +} + /* --------------------------------------------------------------------- B'stard. diff --git a/vg_libpthread_unimp.c b/vg_libpthread_unimp.c index 6f8f75d236..f413887f27 100644 --- a/vg_libpthread_unimp.c +++ b/vg_libpthread_unimp.c @@ -144,7 +144,7 @@ void pthread_rwlockattr_getkind_np ( void ) { unimp("pthread_rwlockattr_getkind void pthread_rwlockattr_getpshared ( void ) { unimp("pthread_rwlockattr_getpshared"); } //void pthread_rwlockattr_init ( void ) { unimp("pthread_rwlockattr_init"); } void pthread_rwlockattr_setkind_np ( void ) { unimp("pthread_rwlockattr_setkind_np"); } -void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); } +//void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); } //void pthread_self ( void ) { unimp("pthread_self"); } //void pthread_setcancelstate ( void ) { unimp("pthread_setcancelstate"); } //void pthread_setcanceltype ( void ) { unimp("pthread_setcanceltype"); }