aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/__set_errno.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-03-12 14:57:30 -0700
committerElliott Hughes <enh@google.com>2013-03-12 17:43:58 -0700
commit9aceab50155b17741faded1fb22e2daa51a07fb1 (patch)
treed1a976cb41c6aa807c6b07f0e858f92ea5763b4f /libc/bionic/__set_errno.cpp
parent94a34010c1f989032c0a4dc7a7a68d069ca23b1e (diff)
downloadandroid_bionic-9aceab50155b17741faded1fb22e2daa51a07fb1.tar.gz
android_bionic-9aceab50155b17741faded1fb22e2daa51a07fb1.tar.bz2
android_bionic-9aceab50155b17741faded1fb22e2daa51a07fb1.zip
Use the kernel's MAX_ERRNO in the syscall stubs.
Bug: http://code.google.com/p/android/issues/detail?id=53104 Change-Id: Iaabf7025b153e96dc5eca231a33a32d4cb7d8116
Diffstat (limited to 'libc/bionic/__set_errno.cpp')
-rw-r--r--libc/bionic/__set_errno.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/libc/bionic/__set_errno.cpp b/libc/bionic/__set_errno.cpp
index c69ca8707..4e72093b7 100644
--- a/libc/bionic/__set_errno.cpp
+++ b/libc/bionic/__set_errno.cpp
@@ -27,25 +27,11 @@
*/
#include <errno.h>
-#include <linux/err.h>
-#define unlikely(x) __builtin_expect((x), false) // Used but not defined by <linux/err.h>.
-
-// These functions are called from our assembler syscall stubs.
+// This function is called from our assembler syscall stubs.
// C/C++ code should just assign 'errno' instead.
-// TODO: should be __LIBC_HIDDEN__, but already exported by NDK :-(
-// TODO: this isn't used on ARM.
-extern "C" int __set_errno(int n) {
+extern "C" __LIBC_HIDDEN__ int __set_errno(int n) {
errno = n;
return -1;
}
-
-// TODO: this is only used on ARM, but is exported by NDK on all platforms :-(
-extern "C" __LIBC_HIDDEN__ int __set_syscall_errno(unsigned long n) {
- if (IS_ERR_VALUE(n)) {
- errno = -n;
- return -1;
- }
- return n;
-}