Commit graph

9 commits

Author SHA1 Message Date
Steven Moreland
4ef83d6919 Revert "strerror: incl enum name"
Revert submission 1833622-usable-strerror

Reason for revert: b/202330586
Bug: 202330586
Reverted Changes:
I4d8f617a0:Track strerror(3) change.
I8ea86220c:strerror: incl enum name
I407bd9f4d:strerror: incl enum name

Change-Id: I81ed563221a77827084711eadd7fb739aeba52a1
2021-10-07 00:19:18 +00:00
Steven Moreland
c3060de20f strerror: incl enum name
strerror is nice, but usually I don't care about the text, I care about
the uppercase enum

Bug: N/A
Test: ./tests/run-on-host.sh glibc (existing failures -> b/201305529)
Test: atest bionic-unit-tests-static
Test: atest malloc_debug_unit_tests

Change-Id: I407bd9f4dfa918fff66a0da7df8d7239f789c7b8
2021-10-05 11:12:30 -07:00
Colin Cross
4c5595c968 Replace local MUSL define with global ANDROID_HOST_MUSL
Bug: 190084016
Test: m USE_HOST_MUSL=true bionic-unit-tests-glibc
Change-Id: I56b23576cb24912112d2ae56d8ecc2e3716982fe
2021-08-16 16:44:24 -07:00
Colin Cross
7da20341e9 Build bionic unit tests for musl
Modify bionic unit tests that are built for glibc so that they also
build against musl.  They don't all pass though:

With glibc:
 2 SLOW TESTS
 4 TIMEOUT TESTS
313 FAILED TESTS
  YOU HAVE 2 DISABLED TESTS

With musl:
11 SLOW TESTS
11 TIMEOUT TESTS
363 FAILED TESTS
  YOU HAVE 2 DISABLED TESTS

Bug: 190084016
Test: m bionic-unit-tests-glibc with musl
Test: atest bionic-unit-tests-static
Test: atest --host bionic-unit-tests-glibc with glibc
Change-Id: I79b6eab04fed3cc4392450df5eef2579412edfe1
2021-08-12 11:13:11 -07:00
Colin Cross
4408b8abb0 Enable posix strerror_r test in glibc
Work around the incompatibility between libc++ and !_GNU_SOURCE
by defining a wrapper function around the posix strerror_r in
a file that does not include any libc++ or gtest headers.

Test: bionic-unit-tests-glibc
Change-Id: I6b097079777b5dcd802e295cc566964fe1c01382
2021-07-30 09:39:58 -07:00
Colin Cross
695af0da30 POSIX strerror_r returns an error number, not -1
The posix spec says strerror_r returns a positive error number,  not
-1 and set errno.

Test: bionic-unit-tests-static
Change-Id: I6a12d50d046f9caac299bf3bff63e6c9496c1b6f
2021-07-30 09:39:21 -07:00
Elliott Hughes
3ba55f8022 Rationalize visibility.
If it's C or POSIX, it's in. If it's BSD or GNU, it's guarded by __USE_BSD
or __USE_GNU.

Bug: https://code.google.com/p/android/issues/detail?id=194631
Change-Id: Ife51a21c2b37b060db56780d29c929805b199cb6
2016-06-09 17:40:19 -07:00
Elliott Hughes
fb50057138 Fix glibc 2.15 build.
glibc 2.15 has prlimit64, has an unsetenv that's declared nonnull,
and hasn't fixed the problems we were having trying to use the
POSIX strerror_r in C++ code.

Change-Id: I834356a385e5ae55500bd86781691b6c1c9c8300
2014-11-12 19:31:21 -08:00
Elliott Hughes
416d7ddaff Add GNU-compatible strerror_r.
We already had the POSIX strerror_r, but some third-party code defines
_GNU_SOURCE and expects to get the GNU strerror_r instead.

This exposed a bug in the libc internal logging functions where unlike
their standard brethren they wouldn't return the number of bytes they'd
have liked to have written.

Bug: 16243479
Change-Id: I1745752ccbdc569646d34f5071f6df2be066d5f4
2014-08-28 16:37:09 -07:00