diff options
author | Elliott Hughes <enh@google.com> | 2013-03-13 00:44:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-03-13 00:44:33 +0000 |
commit | ec706c24acb4d1db6a583a57b76adfb9250d39eb (patch) | |
tree | fcb512131936b2b686571bc53f2b6a3b06fca45f /libc/bionic/__set_errno.cpp | |
parent | 980508b0ead3ee01e99e93635c57eb76d1aba62d (diff) | |
parent | 9aceab50155b17741faded1fb22e2daa51a07fb1 (diff) | |
download | android_bionic-ec706c24acb4d1db6a583a57b76adfb9250d39eb.tar.gz android_bionic-ec706c24acb4d1db6a583a57b76adfb9250d39eb.tar.bz2 android_bionic-ec706c24acb4d1db6a583a57b76adfb9250d39eb.zip |
Merge "Use the kernel's MAX_ERRNO in the syscall stubs."
Diffstat (limited to 'libc/bionic/__set_errno.cpp')
-rw-r--r-- | libc/bionic/__set_errno.cpp | 18 |
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; -} |