+diff --git a/libc/bionic/__errno.c b/libc/bionic/__errno.c
+index 8f33cce..34664c6 100644
+--- a/libc/bionic/__errno.c
++++ b/libc/bionic/__errno.c
+@@ -28,7 +28,4 @@
+ #include <errno.h>
+ #include <bionic_tls.h>
+ 
+-volatile int*  __errno( void )
+-{
+-  return  &((volatile int*)__get_tls())[TLS_SLOT_ERRNO];
+-}
++
+diff --git a/libc/bionic/__set_errno.c b/libc/bionic/__set_errno.c
+index c72d4f7..529a4ef 100644
+--- a/libc/bionic/__set_errno.c
++++ b/libc/bionic/__set_errno.c
+@@ -28,13 +28,6 @@
+ 
+ #include <errno.h>
+ 
+-
+-int __set_errno(int n)
+-{
+-    errno = n;
+-    return -1;
+-}
+-
+ /*
+  * this function is called from syscall stubs,
+  * (tail-called in the case of 0-4 arg versions)
+diff --git a/libc/bionic/pthread-rwlocks.c b/libc/bionic/pthread-rwlocks.c
+index ca3e95c..1494523 100644
+--- a/libc/bionic/pthread-rwlocks.c
++++ b/libc/bionic/pthread-rwlocks.c
+@@ -69,6 +69,8 @@ static int __get_thread_id(void)
+ 
+ int pthread_rwlockattr_init(pthread_rwlockattr_t *attr)
+ {
++
++     abort();
+     if (!attr)
+         return EINVAL;
+ 
+@@ -77,8 +79,9 @@ int pthread_rwlockattr_init(pthread_rwlockattr_t *attr)
+ }
+ 
+ int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr)
+-{
+-    if (!attr)
++{    
++      abort();
++     if (!attr)
+         return EINVAL;
+ 
+     *attr = -1;
+@@ -87,6 +90,7 @@ int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr)
+ 
+ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int  pshared)
+ {
++   abort();
+     if (!attr)
+         return EINVAL;
+ 
+@@ -102,6 +106,8 @@ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int  pshared)
+ 
+ int pthread_rwlockattr_getpshared(pthread_rwlockattr_t *attr, int *pshared)
+ {
++   abort();
++
+     if (!attr || !pshared)
+         return EINVAL;
+ 
+@@ -111,6 +117,7 @@ int pthread_rwlockattr_getpshared(pthread_rwlockattr_t *attr, int *pshared)
+ 
+ int pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
+ {
++    abort();
+     pthread_mutexattr_t*  lock_attr = NULL;
+     pthread_condattr_t*   cond_attr = NULL;
+     pthread_mutexattr_t   lock_attr0;
+@@ -150,6 +157,10 @@ int pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *at
+ 
+ int pthread_rwlock_destroy(pthread_rwlock_t *rwlock)
+ {
++    abort();
++
++
++
+     int  ret;
+ 
+     if (rwlock == NULL)
+@@ -209,11 +220,14 @@ static void _pthread_rwlock_pulse(pthread_rwlock_t *rwlock)
+ 
+ int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
+ {
++    abort();
+     return pthread_rwlock_timedrdlock(rwlock, NULL);
+ }
+ 
+ int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock)
+ {
++    abort();
++
+     int ret = 0;
+ 
+     if (rwlock == NULL)
+@@ -231,6 +245,7 @@ int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock)
+ 
+ int pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec *abs_timeout)
+ {
++    abort();
+     int thread_id, ret = 0;
+ 
+     if (rwlock == NULL)
+@@ -256,11 +271,14 @@ EXIT:
+ 
+ int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
+ {
++    abort();
++
+     return pthread_rwlock_timedwrlock(rwlock, NULL);
+ }
+ 
+ int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
+ {
++    abort(); 
+     int thread_id, ret = 0;
+ 
+     if (rwlock == NULL)
+@@ -280,6 +298,7 @@ int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
+ 
+ int pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, const struct timespec *abs_timeout)
+ {
++    abort();
+     int thread_id, ret = 0;
+ 
+     if (rwlock == NULL)
+@@ -310,6 +329,8 @@ EXIT:
+ 
+ int pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
+ {
++    abort();
++
+     int  ret = 0;
+ 
+     if (rwlock == NULL)
 diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
-index 6b01830..fe45028 100644
+index 6b01830..490c39f 100644
 --- a/libc/bionic/pthread.c
 +++ b/libc/bionic/pthread.c
 @@ -177,7 +177,8 @@ __get_stack_base(int  *p_stack_size)

 }
 
 
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index 94a81cd..d219ff5 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -55,7 +55,7 @@ __BEGIN_DECLS
 /* Well known TLS slots */
 #define TLS_SLOT_SELF               0
 #define TLS_SLOT_THREAD_ID          1
-#define TLS_SLOT_ERRNO              2
+#define TLS_SLOT_ERRNO              5
 
 #define TLS_SLOT_OPENGL_API         3
 #define TLS_SLOT_OPENGL             4
@@ -65,7 +65,7 @@ __BEGIN_DECLS
  * function will then clear it. Since its use is extremely temporary,
  * we reuse an existing location.
  */

 
 #define TLS_DEFAULT_ALLOC_MAP       0x0000001F
 
diff --git a/libdl/libdl.c b/libdl/libdl.c
index b36af16..ad6d4b4 100644
--- a/libdl/libdl.c
+++ b/libdl/libdl.c
@@ -24,6 +24,8 @@ void *dlsym(void *handle, const char *symbol) { return 0; }
 int dladdr(void *addr, Dl_info *info) { return 0; }
 int dlclose(void *handle) { return 0; }
 
+int *__errno() { return 0; };
+void __set_errno(int f) {};
 #ifdef __arm__
 void *dl_unwind_find_exidx(void *pc, int *pcount) { return 0; }
 #elif defined(__i386__) || defined(__sh__)
