From: Julian Seward Date: Sun, 14 Apr 2002 13:13:05 +0000 (+0000) Subject: Add dummy stubs for pthread_key_create, pthread_key_delete, X-Git-Tag: svn/VALGRIND_1_0_3~380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d8300dd1739e60b9c9715477963070ef20c3311;p=thirdparty%2Fvalgrind.git Add dummy stubs for pthread_key_create, pthread_key_delete, pthread_setspecific, pthread_getspecific. They don't do anything right now and may well crash programs which use them. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@66 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index 1d776d0265..88f97cda7a 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -254,6 +254,36 @@ int pthread_cancel(pthread_t thread) } + +int pthread_key_create(pthread_key_t *key, + void (*destr_function) (void *)) +{ + char* str = "IGNORED pthread_key_create\n"; + write(2, str, strlen(str)); + return 0; +} + +int pthread_key_delete(pthread_key_t key) +{ + char* str = "IGNORED pthread_key_delete\n"; + write(2, str, strlen(str)); + return 0; +} + +int pthread_setspecific(pthread_key_t key, const void *pointer) +{ + char* str = "IGNORED pthread_setspecific\n"; + write(2, str, strlen(str)); + return 0; +} + +void * pthread_getspecific(pthread_key_t key) +{ + char* str = "IGNORED pthread_setspecific\n"; + write(2, str, strlen(str)); + return NULL; +} + /* --------------------------------------------------------------------- These are here (I think) because they are deemed cancellation points by POSIX. For the moment we'll simply pass the call along diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index 1d776d0265..88f97cda7a 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -254,6 +254,36 @@ int pthread_cancel(pthread_t thread) } + +int pthread_key_create(pthread_key_t *key, + void (*destr_function) (void *)) +{ + char* str = "IGNORED pthread_key_create\n"; + write(2, str, strlen(str)); + return 0; +} + +int pthread_key_delete(pthread_key_t key) +{ + char* str = "IGNORED pthread_key_delete\n"; + write(2, str, strlen(str)); + return 0; +} + +int pthread_setspecific(pthread_key_t key, const void *pointer) +{ + char* str = "IGNORED pthread_setspecific\n"; + write(2, str, strlen(str)); + return 0; +} + +void * pthread_getspecific(pthread_key_t key) +{ + char* str = "IGNORED pthread_setspecific\n"; + write(2, str, strlen(str)); + return NULL; +} + /* --------------------------------------------------------------------- These are here (I think) because they are deemed cancellation points by POSIX. For the moment we'll simply pass the call along diff --git a/vg_libpthread.c b/vg_libpthread.c index 1d776d0265..88f97cda7a 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -254,6 +254,36 @@ int pthread_cancel(pthread_t thread) } + +int pthread_key_create(pthread_key_t *key, + void (*destr_function) (void *)) +{ + char* str = "IGNORED pthread_key_create\n"; + write(2, str, strlen(str)); + return 0; +} + +int pthread_key_delete(pthread_key_t key) +{ + char* str = "IGNORED pthread_key_delete\n"; + write(2, str, strlen(str)); + return 0; +} + +int pthread_setspecific(pthread_key_t key, const void *pointer) +{ + char* str = "IGNORED pthread_setspecific\n"; + write(2, str, strlen(str)); + return 0; +} + +void * pthread_getspecific(pthread_key_t key) +{ + char* str = "IGNORED pthread_setspecific\n"; + write(2, str, strlen(str)); + return NULL; +} + /* --------------------------------------------------------------------- These are here (I think) because they are deemed cancellation points by POSIX. For the moment we'll simply pass the call along