From 9aceab50155b17741faded1fb22e2daa51a07fb1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 12 Mar 2013 14:57:30 -0700 Subject: Use the kernel's MAX_ERRNO in the syscall stubs. Bug: http://code.google.com/p/android/issues/detail?id=53104 Change-Id: Iaabf7025b153e96dc5eca231a33a32d4cb7d8116 --- libc/bionic/__set_errno.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'libc/bionic/__set_errno.cpp') 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 -#include -#define unlikely(x) __builtin_expect((x), false) // Used but not defined by . - -// 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; -} -- cgit v1.2.3