Add more pthread wrappers in a failed attempt to get Opera 6.0TP2
to run.  Now it creates some threads but segfaults.  Also add
wrapper for syscall __NR_mremap; it is way wrong, but finding
a decent description of what mremap() really does is nearly
impossible.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@89 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/vg_libpthread.c b/vg_libpthread.c
index 08abf32..ab39745 100644
--- a/vg_libpthread.c
+++ b/vg_libpthread.c
@@ -32,7 +32,7 @@
    ------------------------------------------------------------------ */
 
 /* Set to 1 to see IGNORED debugging messages. */
-static int show_IGNORED = 0;
+static int show_IGNORED = 1;
 
 
 /* ---------------------------------------------------------------------
@@ -108,6 +108,19 @@
    Pass pthread_ calls to Valgrind's request mechanism.
    ------------------------------------------------------------------ */
 
+int pthread_attr_init(pthread_attr_t *attr)
+{
+   ignored("pthread_attr_init");
+   return 0;
+}
+
+int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
+{
+   ignored("pthread_attr_setdetachstate");
+   return 0;
+}
+
+
 int
 pthread_create (pthread_t *__restrict __thread,
                 __const pthread_attr_t *__restrict __attr,
@@ -188,8 +201,14 @@
 
 int pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
 {
-  ignored("pthread_mutexattr_destroy");
-  return 0;
+   ignored("pthread_mutexattr_destroy");
+   return 0;
+}
+
+int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
+{
+   ignored("pthread_mutexattr_settype");
+   return 0;
 }
 
 int pthread_mutex_lock(pthread_mutex_t *mutex)
@@ -437,6 +456,20 @@
   return __libc_lseek(fildes, offset, whence);
 }
 
+extern  
+void __libc_longjmp(jmp_buf env, int val) __attribute((noreturn));
+void longjmp(jmp_buf env, int val)
+{
+   __libc_longjmp(env, val);
+}
+
+extern
+int __libc_send(int s, const void *msg, size_t len, int flags);
+int send(int s, const void *msg, size_t len, int flags)
+{
+   return __libc_send(s, msg, len, flags);
+}
+
 /*--------------------------------------------------*/
 
 /* I've no idea what these are, but they get called quite a lot.