am 45c4ef3c: am b380b7d7: Merge "set errno to ENOENT in getauxval per glibc 2.19"
* commit '45c4ef3cde5529bdaac41ad1f30ca3180361e060': set errno to ENOENT in getauxval per glibc 2.19
This commit is contained in:
commit
d527e65906
@ -31,6 +31,7 @@
|
|||||||
#include <sys/auxv.h>
|
#include <sys/auxv.h>
|
||||||
#include <private/bionic_auxv.h>
|
#include <private/bionic_auxv.h>
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
__LIBC_HIDDEN__ ElfW(auxv_t)* __libc_auxv = NULL;
|
__LIBC_HIDDEN__ ElfW(auxv_t)* __libc_auxv = NULL;
|
||||||
|
|
||||||
@ -40,5 +41,6 @@ extern "C" unsigned long int getauxval(unsigned long int type) {
|
|||||||
return v->a_un.a_val;
|
return v->a_un.a_val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
errno = ENOENT;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
@ -53,7 +54,9 @@ TEST(getauxval, expected_values) {
|
|||||||
|
|
||||||
TEST(getauxval, unexpected_values) {
|
TEST(getauxval, unexpected_values) {
|
||||||
#if defined(GETAUXVAL_CAN_COMPILE)
|
#if defined(GETAUXVAL_CAN_COMPILE)
|
||||||
|
errno = 0;
|
||||||
ASSERT_EQ((unsigned long int) 0, getauxval(0xdeadbeef));
|
ASSERT_EQ((unsigned long int) 0, getauxval(0xdeadbeef));
|
||||||
|
ASSERT_EQ(ENOENT, errno);
|
||||||
#else
|
#else
|
||||||
GTEST_LOG_(INFO) << "This test does nothing.\n";
|
GTEST_LOG_(INFO) << "This test does nothing.\n";
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user