Commit graph

7 commits

Author SHA1 Message Date
Christopher Ferris
9978a9a82e Move __set_errno to ndk_cruft.cpp.
Change-Id: I5caa1cc161961d2e4629429c0d406875b93cdbd0
2015-10-29 18:11:32 -07:00
Elliott Hughes
7efad83d43 Ensure __set_errno is still visible on LP32.
The use of the .hidden directive to avoid going via the PLT for
__set_errno had the side-effect of actually making __set_errno
hidden (which is odd because assembler directives don't usually
affect symbols defined in a different file --- you can't even
create a weak reference to a symbol that's defined in a different
file).

This change switches the system call stubs over to a new always-hidden
__set_errno_internal and has a visible __set_errno on LP32 just for
binary compatibility with old NDK apps.

Bug: 17423135
Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b
2014-09-08 15:36:21 -07:00
Colin Cross
3d19a8319b bionic: fix __set_errno for arm64 syscalls that return a 64-bit value
bionic/libc/arch-arm64/syscalls/read.S ends with:
    b.hi __set_errno
    ret
END(read)

If __set_errno returns int, it will set w0 to 0xFFFFFFFF, which means
x0 is 0x00000000FFFFFFFF.  When interpreted as a ssize_t that is
INT_MAX, not -1.

Change __set_errno to return long, which will cause x0 to be set instead
of w0.

Change-Id: I9f9ea0f2995928d2ea240eb2ff7758ecdf0ff412
2014-02-18 12:11:38 -08:00
Elliott Hughes
3198850ea1 Unhide __set_errno for backwards compatibility.
This was in <errno.h>, and people called it :-(

Change-Id: I038490be77eb9372b3f31305ec580fa7b09c983e
2013-03-22 19:12:52 -07:00
Elliott Hughes
9aceab5015 Use the kernel's MAX_ERRNO in the syscall stubs.
Bug: http://code.google.com/p/android/issues/detail?id=53104
Change-Id: Iaabf7025b153e96dc5eca231a33a32d4cb7d8116
2013-03-12 17:43:58 -07:00
Elliott Hughes
cb2069bf69 Support large errno values on ARM.
Bug: http://code.google.com/p/android/issues/detail?id=53104
Change-Id: Ic6c40be2dc50f0644a3d8b09ceae59c38f2d5b53
2013-03-12 11:55:45 -07:00
Elliott Hughes
4a9e837840 Reduce the exposure of the __set_errno implementation detail.
Change-Id: I395e1b46a9491e34fc53e71853e932ea90b3d1cc
2012-11-30 12:05:18 -08:00
Renamed from libc/bionic/__set_errno.c (Browse further)