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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/vg_libpthread.c b/vg_libpthread.c
index 1d776d0..88f97cd 100644
--- a/vg_libpthread.c
+++ b/vg_libpthread.c
@@ -254,6 +254,36 @@
}
+
+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