summaryrefslogtreecommitdiff
authorTanguy Pruvot <tanguy.pruvot@gmail.com>2014-11-09 08:10:51 (GMT)
committer Tanguy Pruvot <tanguy.pruvot@gmail.com>2014-11-09 08:13:46 (GMT)
commit60283c6026060e3793a32439c78553feb7eb93f3 (patch)
tree5ae02e9956efad0f33014663dbf15999ce74203a
parent0d6f1493013fc6f2bef823c8d238ae16235a9568 (diff)
downloadbusybox-60283c6026060e3793a32439c78553feb7eb93f3.zip
busybox-60283c6026060e3793a32439c78553feb7eb93f3.tar.gz
busybox-60283c6026060e3793a32439c78553feb7eb93f3.tar.bz2
Android: fix for 32/64 __set_errno libc change
this export in libc is only present for 32 bit targets for compatibility issues with the published NDK Change-Id: I3ddab7d7f3c409cf7732ca23f23d3080fd6861a3
Diffstat
-rw-r--r--android/libc/__set_errno.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/android/libc/__set_errno.c b/android/libc/__set_errno.c
index e952363..ed832e9 100644
--- a/android/libc/__set_errno.c
+++ b/android/libc/__set_errno.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,11 @@
#include <errno.h>
+#ifdef __LP64__
+
+/* __set_errno was mistakenly exposed in <errno.h> in the 32-bit NDK.
+ * but is no more present for 64-bit targets!
+ */
long __set_errno(int n)
{
@@ -35,22 +40,4 @@ long __set_errno(int n)
return -1;
}
-/*
- * this function is called from syscall stubs,
- * (tail-called in the case of 0-4 arg versions)
- */
-
-__LIBC_HIDDEN__
-long __set_syscall_errno(int n)
-{
- /* some syscalls, mmap() for example, have valid return
- ** values that are "negative". Since errno values are not
- ** greater than 131 on Linux, we will just consider
- ** anything significantly out of range as not-an-error
- */
- if(n > -256) {
- return __set_errno(-n);
- } else {
- return n;
- }
-}
+#endif