History log of /bionic/tests/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2993aaa261d69aae0fce3de8c5533ee956d71907 24-Nov-2016 Brian Carlstrom <bdc@google.com> Fix x86_64 build which uses g++ and hits -Werror=unused-but-set-variable

Bug: 32640542
Bug: 33078014
Change-Id: Id9d3b4e69ac909078b2ac5b81acf161debcefae3
ys_prctl_test.cpp
1dc3ae163e6190508e5b32f256622daa1146bc6b 08-Nov-2016 Christopher Ferris <cferris@google.com> Fix error case to print newlines properly.

Bug: 32640542

Test: Built and ran on a failing device.

(cherry picked from commit 4dd2785f056f885e6dc9a022b867f511c2e83c3c)

Change-Id: I81a578af7608c741819062bd54aa8e348a621b83
ys_prctl_test.cpp
f1e44785e57c10d3f125ad3ef759c7e09fbb92a3 04-Nov-2016 Christopher Ferris <cferris@google.com> Make prctl test check maps.

It turns out that sometimes this kernel bug can be present but not
trigger a crash. Modify the test to check for overlapping maps instead.

Bug: 32640542

Test: Verified that this fails on a device without the kernel patch
Test: (both bionic-unit-tests32 and CtsBionicTestCases32). Verified
Test: this passes on an angler.

(cherry picked from commit f1649d92f7869331ea1c4db7f2bb189489af03e6)

Change-Id: Ia3fae3ee3d01f33d8414c1796fc3e942d5b56ec8
ys_prctl_test.cpp
b2b0460c5b2ba48eb2fa4aedf6ae4ef61c0c70bf 07-Oct-2016 Tianjie Xu <xunchang@google.com> Fix a linking error in bionic/tests am: 3656958a16
am: 0893380bed

Change-Id: I462b022e42676ec6ceba39ece3933dc4cc6237d0
0893380bed55d4b7098c85376099580a58ac8334 07-Oct-2016 Tianjie Xu <xunchang@google.com> Fix a linking error in bionic/tests
am: 3656958a16

Change-Id: I5636ecc4e0a5ff4e1ee0a6cd0f1d182d444e63f9
3656958a16590d07d1e25587734e000beb437740 07-Oct-2016 Tianjie Xu <xunchang@google.com> Fix a linking error in bionic/tests

Fix the following linking error by adding liblog in the makefile:
"system/core/libziparchive/zip_archive.cc:277: error: undefined reference to
'__android_log_error_write'"

The error happens because libziparchive has dependency on liblog. This
error affects the downstream branches of nyc-dev.

Bug: 31251826
Test: mma -j32
Change-Id: Ia42909bbbd150ae0ca9f6aa6b14372f2e0aedccf
ndroid.mk
23af6af7c205f0aff0829c08a088b2dd79e9ffe0 14-Jul-2016 Dimitry Ivanov <dimitry@google.com> Fix dlext.ns_smoke test

Check for updated error_message

Bug: http://b/31097098
Test: adb shell bionic-unit-tests32/64 --gtest_filter=dlext.ns*
(cherry picked from commit 3a6c6b3254b2033a9a0246013a2c8b486800624b)

Change-Id: I0f0dd59a6deba016d37d0ccc80113b62db86c1c2
lext_test.cpp
766275e7f697c30164678e1fed55b2a2fcbf8546 12-Jul-2016 Alex Vakulenko <avakulenko@google.com> Fix pty.bug_28979140 test in Bionic

The test relies on the fact/assumes that CPU 0 is available to the
test process. This is not necessarily the case. Instead of allocating
CPU 0 to the main thread, find the first available CPU and use that
instead.

BUG=b/29991929
TEST=All Bionic unit tests pass

Change-Id: I36b311cdba57112d663d652757fd5114183fc780
ty_test.cpp
8bbcc61b54cf8ce95c4bbae7db7883442b7d1fd9 15-Jul-2016 Elliott Hughes <enh@google.com> Add a test for a known kernel bug.

Bug: http://b/27265969

(cherry picked from commit 4a253496b86522ec732a89f19d4ca534d71d53f2)

Change-Id: Ibf0b6457b02e89b90bc86c9367e14021c606356b
ys_mman_test.cpp
f35c6bc70fcf9907c28eb169a294a42dcae52f93 10-Jun-2016 Yabin Cui <yabinc@google.com> Add test for a pty kernel bug.

Bug: 28979140
Change-Id: Iad79fcb7a3c5b068f625c7902785cc6e696fe9a1
ty_test.cpp
7e53843f7b4c061920d1742c8e70a50509d83a53 21-May-2016 Christopher Ferris <cferris@google.com> Change use of /data to /data/local/tmp.

The unistd fsync/fdatasync were changed to use /data from /.
Unfortunately, this directory is unreadable unless you are root, so
change this path to /data/local/tmp.

Bug: 28885777
Change-Id: Ia88da7a05c8f1b05fbd45ef2e8c55ba0c3368164
nistd_test.cpp
e9cb77f082c224f31c4c4d04a613594f459a94b8 19-May-2016 Shuhei Takahashi <nya@google.com> Merge "Run fsync tests on mutable filesystem." into marshmallow-cts-dev am: de1f02c028 am: 0fab155cf8 am: b46bb761d5 am: 1e44a6e1ed
am: 97ecf98be3

* commit '97ecf98be3efaf196b19fc98e14dbbbc0e58c373':
Run fsync tests on mutable filesystem.

Change-Id: Id8b620cdc55da0bd2f473a176eac0fb921369d32
b46bb761d50e2b0cfe8ae597e202a7e05b0eaa5a 19-May-2016 Daniel Xie <dxie@google.com> Merge "Run fsync tests on mutable filesystem." into marshmallow-cts-dev am: de1f02c028
am: 0fab155cf8

* commit '0fab155cf861ee12e8b01b6339ef56524d56ebe1':
Run fsync tests on mutable filesystem.

Change-Id: Iadcaa7329c8ace2a898860dce99ae1a9cf5f2757
041cf17cdd900f807d8d39d04802e9f31f2ffd74 18-May-2016 Dimitry Ivanov <dimitry@google.com> Merge "Fix dlopen of main executable by absolute path" into nyc-dev
49cfc899a3708fae9175e44c0c02cd479fda8b36 13-May-2016 Dimitry Ivanov <dimitry@google.com> linker: Allow caller to specify parent namespace

This change enables apps to share libraries opened
with RTLD_GLOBAL between different classloader namespaces.

The new parameter to create_namespace allows native_loader
to instruct the linker to share libraries belonging to
global group from a specified namespace instead of
using the caller_ns.

Bug: http://b/28560538
Bug: https://code.google.com/p/android/issues/detail?id=208458
Change-Id: I5d0c62730bbed19cdeb16c7559c74aa262a2475f
(cherry picked from commit fc2da53440383fe1026e0eb287d643b577c2707d)
lext_private.h
lext_test.cpp
dcaef3710df817db5652a1f3ab4646f43f5cd3ee 17-May-2016 Dimitry Ivanov <dimitry@google.com> Fix dlopen of main executable by absolute path

This CL adds initialization of inode for the main executable
which enables linker to resolve the correct soinfo when
application calls dlopen with absolute path to the
main executable.

Bug: http://b/28420266
Change-Id: I102e07bde454bd44c6e46075e3faeeb5092830d8
(cherry picked from commit 2ba1cf39ae6087249a839ec7b3793d4d4fa75438)
lext_test.cpp
lfcn_test.cpp
test_main.cpp
tils.h
19b669b00325bcbab4679c4e57c5d8d95f54decb 10-May-2016 Dimitry Ivanov <dimitry@google.com> Remove linker-namespace functions from the header

They are intended for platform use only and we shouldn't have them
in the public header file.

Bug: http://b/28174921
Change-Id: Ib9b3d0fa9442cfa2e784a693ad567d1444d774e5
(cherry picked from commit 41fd29532b52bb66e3e1f4620053713fd0299f6e)
lext_private.h
lext_test.cpp
cfa3262ce46fdec81cb011ec78273df68c325c9c 11-May-2016 Shuhei Takahashi <nya@google.com> Run fsync tests on mutable filesystem.

The purpose of those tests is to ensure fsync succeeds for
directories. However, they try to call fsync for / (the root
filesystem) that is usually mounted read-only, which does not
make sense because the whole point of fsync is to flush
uncommitted changes to the filesystem.

In fact, some well-known read-only filesystems (e.g. squashfs)
does not support fsync, so these tests fail if we use such
filesystems as the root filesystem.

This patch changes the tests to call fsync against /data
instead. /data is a user data partition and should be always
mounted read-write.

Bug: 28681455
Change-Id: I9314dad6f8d54c66401714af0f66e782ebd8e319
nistd_test.cpp
47a1e9342517c34e5f283c6b7caf7d3bdc6e3ecc 03-May-2016 Pavel Labath <labath@google.com> Revert "Add a test exercising ptrace watchpoint functionality"

This test appears to be failing on shamu devices. Revert until we figure out what's the problem.

This reverts commit 88ce78d93a465c1c635901d26542d5ec07b6b6ee.

Bug: 28514348
Change-Id: I0d91ca5eb59eb3ccb5d48b02b245e0f1bcffb5bb
ndroid.mk
ys_ptrace_test.cpp
88ce78d93a465c1c635901d26542d5ec07b6b6ee 21-Apr-2016 Pavel Labath <labath@google.com> Add a test exercising ptrace watchpoint functionality

This adds a test which verifies that watchpoints work on devices
which support them. It is motivated by issues experienced by Nexus
5 devices, where watchpoints work only sporadically.

These tests spawn a process, trace it, and verify it hits a
watchpoint of various sizes while executing on all available CPUs
(to help catch a recent bug, where some debugging functionality
was not available on non-boot CPUs). All x86(_64) targets are
expected to support this functionality. In case of arm(64),
watchpoints are expected to work on devices where the relevant
syscall indicates watchpoint presence. In case of mips, this test
is skipped as I could not verify that the test would work
correctly due to lack of hardware, and this test is intrinsically
hardware-dependend.

cherry picked from commit 1faca6c95bc3e2c9456b9dc5362915be2a188340

Bug: 28395519
Change-Id: Ie5cbb16b9eef51f322c02ed8dce712c21cad94cf
ndroid.mk
ys_ptrace_test.cpp
0551c1d47bad202ce6dd90757067bc0fd217497a 11-Apr-2016 Dimitry Ivanov <dimitry@google.com> Remove dangling links in secondary namespaces

linker didn't remove link to the soinfo from shared
namespaces on soinfo_unload, because it didn't keep
record of all namespaces the library is added to.

This change adds test for this and also fixes the
problem by introducing list of secondary namespaces
to soinfo, which is used to remove soinfo in
soinfo::remove_all_links().

Bug: http://b/28115950
Change-Id: Ifbf6e54f92fa6e88f86b6a8dd6dc22d4553afd22
(cherry picked from commit aca299ac4721809d6fc61e25c505bb59acd23fbc)
lext_test.cpp
6f90c1ac59eb4e7811b7b0e408615049c935c0a9 01-Apr-2016 Elliott Hughes <enh@google.com> Fix the stack-protector test for x86/x86-64.

Built for fugu this was working fine, but built for generic x86/x86-64
the compiler was (a) optimizing out all the stack writes and (b) inserting
enough padding on x86-64 for the canary to be safely out of the way.

While here, let's tighten up this test so we test that it's sufficient to
only overwrite the buffer by one byte...

Bug: http://b/27815668
Change-Id: I80a646de4b30fd5c78df20fdaa7e3eb163585caf
tack_protector_test_helper.cpp
78a3d39aa997acd92fa838568287507c75e4a8a5 30-Mar-2016 Yabin Cui <yabinc@google.com> Merge "CloseArchive() to free memory when OpenArchive fails." into nyc-dev
b3ee859bbd6ce5ff9ed252bb00ff0b6c452d0373 22-Mar-2016 Yabin Cui <yabinc@google.com> CloseArchive() to free memory when OpenArchive fails.

Bug: 26962895
Change-Id: I42418eee320ddae857b42572690316c53f638e85
(cherry picked from commit 722072d65abb1b9fa709f5c7ae8afd98ef5ab7af)
ibs/bionic_tests_zipalign.cpp
26e33ec1b9ce42accc0bea9ae9fdc9bf9b4d2d5d 30-Mar-2016 Yabin Cui <yabinc@google.com> Merge "Fix test getauxval.arm_has_AT_HWCAP2." into nyc-dev
95e789a30732ba9d51dc01a50b2e973e6330295f 29-Mar-2016 Josh Gao <jmgao@google.com> Delete lies from x86_64 setjmp implementation.

Previously, the implementation of setjmp on x86_64 claimed that
sigprocmask would write to two longs' worth of bytes.

Bug: http://b/27856501
Change-Id: I9f32b40ac773a0cd91a976aace5bfba6e67fb0f8
(cherry picked from commit c244fcb8a3396f94976a56379cce144c4451c3d4)
ignal_test.cpp
dbf6f82e8703f7cf72ffe5cedb4a37a0dfb78e7c 30-Mar-2016 Yabin Cui <yabinc@google.com> Fix test getauxval.arm_has_AT_HWCAP2.

Bug: 27874785
Change-Id: Ibb39087c5353a0cca7783d39498b370e478fe91c
(cherry picked from commit 78f5eb0498e0bae7f64f749b252aee7e56621b34)
etauxval_test.cpp
79e92282240e9e09568f3138b5f8caa6b85cb1c6 29-Mar-2016 Dimitry Ivanov <dimitry@google.com> Merge "linker: hide the pointer to soinfo" into nyc-dev
ae74e8750b9dae51b24a22fdb4b0e0a2d84f37b9 24-Mar-2016 Dimitry Ivanov <dimitry@google.com> linker: hide the pointer to soinfo

Handle no longer is a pointer to soinfo of
a corresponding library. This is done to
prevent access to linker internal fields.

Bug: http://b/25593965
Change-Id: I62bff0d0e5b2dc842e6bf0babb30fcc4c000be24
(cherry picked from commit d88e1f350111b3dfd71c6492321f0503cb5540db)
lext_test.cpp
5ca2bddae3c468cd37f028cdc2d5a5f5d98b3545 28-Mar-2016 Elliott Hughes <enh@google.com> Don't bother insisting on AT_HWCAP2 for 32-bit devices.

Bug: http://b/27874785

(cherry picked from commit 900a4dc5a8fcabcc85eb17a0d1ee2295cae7b180)

Change-Id: Ia8c3543c51861030b33f8a4e0c0b88d7cca6e11e
etauxval_test.cpp
0eed2827ed707f22c6901f70a167b005a2ade262 22-Mar-2016 Yabin Cui <yabinc@google.com> Fix pthread.pthread_barrier_smoke test.

pthread_barrier_smoke test uses WaitUntilThreadSleep() to wait until
BarrierTestHelper threads sleep in pthread_barrier_wait(). But this
is flaky as there a two futex_wait places in pthread_barrier_wait.
This patch modifies this test to avoid using WaitUntilThreadSleep().

Bug: 27780937
Bug: 27811377
Change-Id: I4c36b82cce9345d5088f8854b289dc5bf7a08e8c
(cherry picked from commit 81d2797e33d6f95c0b79e20ae8a04f2a4f3841cc)
thread_test.cpp
2c7fdeb61cca97fb40df006354a6f5c81361faee 25-Mar-2016 Elliott Hughes <enh@google.com> Fix the AT_HWCAP2 test.

"I have none of these capabilities" is a legitimate response, and
distinct from "I don't know what my capabilities are". It's the latter
I meant to test for.

Bug: http://b/27810985

(cherry picked from commit d4c91124906b6d73a2be336bbd305cd2678e04b2)

Change-Id: I4093948039a658e926e9b5e28d19b1344c70bd0e
etauxval_test.cpp
ec9b56ee2e3ddd5b475e9804f42f65e8b71486bd 08-Mar-2016 Yabin Cui <yabinc@google.com> Adjust test to let it pass on libhoudini.

When using libhoudini to run arm code on x86 platforms, we can't
assume the main thread allocates local variables at the stack
declared by kernel.

(cherry picked from commit 61e4d461e5c1c5108fdfe2a9f1edec6717e7461e)

Bug: http://b/27815309
Change-Id: Ic714a8e633a0bb6e85b38ee0e01e3439d0a0cea5
thread_test.cpp
a65a3ad837618c5bf5c0b798bf9217a509ab5c61 19-Mar-2016 Elliott Hughes <enh@google.com> Add a CTS test to ensure AT_HWCAP2 is reported.

This is important for performance of 32-bit ARM crypto code in apps.

Bug: http://b/27750752

(cherry picked from commit ebb4895c68f08bad682f90e66b041f1585d7bafa)

Change-Id: Iec69fe57b93da0480ef3bbd4c9e7882c8aa55011
etauxval_test.cpp
f6756b50b11e15876ee49e01a64110e39f7e6e76 15-Mar-2016 Josh Gao <jmgao@google.com> Silence false positive warnings on GCC.

We still use GCC to build the bionic unit tests into CTS, and it emits a
false positive -Wmissing-field-initializers warning for the C++11 aggregate
initialization syntax `Foo foo = {}`.

Bug: http://b/27656293
Change-Id: I016d8dae6d6cd28afe4bc19250c2a8fba908f8e6
(cherry picked from commit d7878529b80295625df610bd32dadf11d507e8c0)
ignal_test.cpp
107935c5587f9c7c6cf475a5d63f1aa2e3f4d35e 10-Mar-2016 Josh Gao <jmgao@google.com> Merge "debuggerd: rethrow the full signal we receive, always." into nyc-dev
06abceff0f9434d5a5150527bf6bdbad13f897e0 09-Mar-2016 Josh Gao <jmgao@google.com> debuggerd: rethrow the full signal we receive, always.

The previous code assumed that returning would be sufficient to rethrow
signals like SIGSEGV. This is not true, for example, in the case where a
SIGSEGV is sent via kill(2). We were previously only sending the signal
to ourselves in some cases, because using kill(2) would lose information
in the siginfo_t argument. Use rt_tgsigqueueinfo(2) instead to preserve
its contents.

Bug: http://b/27367422
Change-Id: I1be822818d5905461979c7e12dc4e9c25049273b
(cherry picked from commit 61cf3f3e033d2d7d13b06e0ae009ff12db787860)
ignal_test.cpp
12393862e55b9ab28dd29ae16fbdf498371726a7 04-Mar-2016 Elliott Hughes <enh@google.com> Improve and fix the stack-protector tests.

Bug: http://b/26888853

(cherry picked from commit fc69a8ad5f0d9b63de48e3858fb4811ede7ac64e)

Change-Id: Ibc431076000b9a8db46f68f858480045b03b6e79
ndroid.mk
tack_protector_test.cpp
tack_protector_test_helper.cpp
fe88d4270b6ab5358b8e28decc848c496f67988c 12-Jun-2015 jzha136 <jingwei.zhang@intel.com> Add x86 optimization of rint functions and tests

Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>

(cherry picked from commit f3ea093ebbfd9bd348ac16a46c96b637e3696c82)

Bug: http://b/27533895
Change-Id: I5703f4e2189bb1d12d8864757d72a327f17a74f9
ath_data/llrint_intel_data.h
ath_data/llrintf_intel_data.h
ath_data/lrint_intel_data.h
ath_data/lrintf_intel_data.h
ath_data_test.h
ath_test.cpp
54f1339d1c745d9d30f0200c332dc76661e75214 03-Mar-2016 Josh Gao <jmgao@google.com> Add a checksum to jmp_buf on ARM.

Make it easier to diagnose applications mucking with the contents of
jmp_buf by checksumming its contents.

Bug: http://b/27417786
Change-Id: I9989e2ea3979a36ae0bc4c9e1bacafddbacc731b
(cherry picked from commit a4c69137c693c45fce4010ba61d69d7147f5dd9a)
etjmp_test.cpp
350bdad61cc6551db649fcaeb8642f4a1d6b139a 01-Mar-2016 Dimitry Ivanov <dimitry@google.com> linker: print "not accessible" error message to the log

Print properties of the namespace on "library is not accessible"
error to better diagnose problems with native library accessiblity

Bug: http://b/27406143
Change-Id: Icf3d6c604f09dfa015de863fdb1267d343930d2a
lext_test.cpp
test_main.cpp
tils.h
2ef5f633e7998cf71029341e466d8e13bad7b05b 29-Feb-2016 Elliott Hughes <enh@google.com> Rewrite ifaddrs#getifaddrs_INET.

The old implementation was unnecessarily complex, and using the wrong ioctl
for point-to-point destination addresses.

Bug: http://b/27313259

(cherry picked from commit bf97770a8602ad50ac97a16b978f92c366595684)

Change-Id: Ifad01967d6b7f4bb1e0346a5bb352dbb524bf846
faddrs_test.cpp
31e4472dc7779f4de13975090fc88b1e5dfb52b2 17-Feb-2016 Elliott Hughes <enh@google.com> Fix scope ids for link-local IPv6 addresses from getifaddrs(3).

Bug: http://b/27219454

(cherry picked from commit 7dac8b8aabadbf2dcff20d3646e701728ba3777d)

Change-Id: I006ae68b928b5836d064c020a6db43dcc05add9e
faddrs_test.cpp
ee478ead7dc30235509e36f7675e1b62484bc25d 13-Feb-2016 Christopher Ferris <cferris@google.com> Add a memcpy(a, a, n) test.

clang depends on memcpy where src and dst are the same to actually
work. Even though this is, technically, undefined behavior,
clang is not going to change. Add a test to verify this assumption
holds true for android devices.

(cherry picked from commit 71766c25778fe13717259cdccb62463684794408)

Change-Id: I7d8ba4098729194dda69eab7070fd5c4ba1abbe9
tring_test.cpp
39b952cf0a824db1cdc301dd048db0e56d4d5c24 12-Feb-2016 Christopher Ferris <cferris@google.com> Fix the default alignment of the allocations.

In order to enforce this constraint:

The pointer returned if the allocation succeeds shall be suitably
aligned so that it may be assigned to a pointer to any type of object
and then used to access such an object in the space allocated.

Force all allocations on 32 bit systems to have 8 byte alignment,
and all allocations on 64 bit systems to have 16 byte alignment.

Add a test to verify that the allocator returns the correct alignments.

Bug: 26739265

(cherry picked from commit 72df6708c829a4c6494936fdfbda6dc7e68e647b)

Change-Id: I44ca8bedb1dac375087da1af3a1d7d12034e037f
alloc_test.cpp
66c25c360afb161be02fbdb8da21cd02c9d99447 13-Feb-2016 Elliott Hughes <enh@google.com> Fix regerror(..., nullptr, 0).

Found by passing a bad regular expression to the Google benchmark
code (https://github.com/google/benchmark).

(cherry picked from commit cac2908b08f517802e719ddafe39f45c85c96a33)

Change-Id: I317a7c2ea6535998c0853029023fcefc88cb3750
egex_test.cpp
535c5992d6692124357247a70a37772fae1a8569 11-Feb-2016 Elliott Hughes <enh@google.com> Add tests for zero-sized allocations.

POSIX lets us return null and set errno, but that would be annoying and
surprising.

Bug: http://b/27101951

(cherry picked from commit 884f76e3aa081740f7cfe582b11af7446bf77bd9)

Change-Id: Ice4fd3cd427523edc2ca4ba25caf9701c353db47
alloc_test.cpp
8200e55d941305f6f24f1745492b90271aa417e9 06-Feb-2016 Elliott Hughes <enh@google.com> Add a test for a possible overflow in *printf.

It turns out we don't have any bugs here, but glibc does. Found while
chasing down a toybox failure I saw on the host, but we may as well
add the test in case we ever screw up here in future.

Change-Id: Ib8dd227ed3b742dc4dab8c09dc08e6ea9a35c807
tdio_test.cpp
43f7c875654cb94e589ff9d0c4ac58ca9616093e 05-Feb-2016 Elliott Hughes <enh@google.com> Add a test for snprintf on a PTHREAD_STACK_MIN-sized stack.

This is a common thing for people to want to do, snprintf requires
a lot of stack for itself, and PTHREAD_STACK_MIN should be usable
for realistic code.

Change-Id: Ib09cfb4e0beec1c69ee0944c3ea4c5d03a94c491
tdio_test.cpp
ime_test.cpp
0c485dae707fac45f5d8baff7da1a469e25c2261 03-Feb-2016 Elliott Hughes <enh@google.com> Add in6addr_any and in6addr_loopback symbols.

Change-Id: I3a90fa448b6bd43321672ba74b84a4e9e8a67738
ndroid.mk
etinet_in_test.cpp
5f26c6bc91f653b61c01e2ff6e7eac4847e315a5 03-Feb-2016 Elliott Hughes <enh@google.com> Really add adjtimex(2), and add clock_adjtime(2) too.

Change-Id: I81fde2ec9fdf787bb19a784ad13df92d33a4f852
ndroid.mk
ys_timex_test.cpp
f226ee59e0effedeabed09e2d65be7fa7499cc25 03-Feb-2016 Elliott Hughes <enh@google.com> Add fopen64/freopen64/tmpfile64 aliases.

Our fopen/freopen/tmpfile are already always O_LARGEFILE, but let's add
the aliases for _LARGEFILE_SOURCE compatibility.

Bug: http://b/24807045
Change-Id: I5d99b3ef3c9f27ce70f13313f6a92e96c7f21f80
tdio_test.cpp
a279324094d748b97201412b2457d2f6e26287dd 03-Feb-2016 Elliott Hughes <enh@google.com> Merge "Fix ifaddrs#getifaddrs_INET flakiness."
2d5e21f00d20e72951cc583a1eab0fd9d415594e 03-Feb-2016 Elliott Hughes <enh@google.com> Fix ifaddrs#getifaddrs_INET flakiness.

The interface name wasn't being nul-terminated for the ioctl. Also clean up
the code a bit to give more useful diagnostics on failure.

Bug: http://b/26887941
Change-Id: I30c6bdc1a32733971a27ed1fb7db9d8239b6262b
faddrs_test.cpp
e4fa6e9cc7f894a5a85ca50249b1f6e9efd49d3a 03-Feb-2016 Elliott Hughes <enh@google.com> Expose ftello64.

Also add the missing test that would have caught this.

Bug: http://b/24807045
Change-Id: I756a4d825595b52396b15898e3f717156fd1ba2f
tdio_test.cpp
f68dcbe0930b38db2a0909934f64175b1c51745a 03-Feb-2016 Dan Albert <danalbert@google.com> Fix our fortify tests for global -Werror.

If anyone has a better way of doing this it would be welcome...

Bug: http://b/26936282
Change-Id: I796896866327b4b5b5ee4ec36994fb320993f85d
ndroid.mk
ile-check-cxx
ortify_test.cpp
ortify_test_main.cpp
955426ef79ae635b74ff917c2b9ebc1a24c6a3ef 27-Jan-2016 Elliott Hughes <enh@google.com> Fix a sign extension bug in stdio.

This also lets us test the EOVERFLOW behavior, which pointed out that the
fgetpos/fsetpos return on failure has always been wrong...

Bug: http://b/24807045
Change-Id: I35273eb07c8c9155af858adb27569983397580b6
tdio_test.cpp
03e65eb03bf0bfaafa797daf91e80e8308968db3 26-Jan-2016 Elliott Hughes <enh@google.com> Implement funopen64.

Bug: http://b/24807045
Change-Id: I161920978161389be34b707cc6ce8e05f760d552
tdio_test.cpp
33697a0c43c48e15c3bcf018138b9b837d0099cd 26-Jan-2016 Elliott Hughes <enh@google.com> Factor out the waiting for children in bionic tests.

Change-Id: I4a1e51b6920b33dc892d447f5bd6d10f1cb2704a
lext_test.cpp
thread_dlfcn_test.cpp
thread_test.cpp
ty_test.cpp
tdlib_test.cpp
ys_select_test.cpp
ime_test.cpp
nistd_test.cpp
tils.h
94bb0fab931102f1fcf393aa507a6b77b741844f 26-Jan-2016 Elliott Hughes <enh@google.com> Merge "Support _FILE_OFFSET_BITS=64 for most of <stdio.h>."
d9bb70857577808c197030e7f5422ee1f976f3ac 26-Jan-2016 Elliott Hughes <enh@google.com> Merge "Implement POSIX lockf."
5704c423c81790195161c1757ae79da188590c51 26-Jan-2016 Elliott Hughes <enh@google.com> Implement POSIX lockf.

This has been requested a few times over the years. This is basically
a very late rebase of https://android-review.googlesource.com/45470
which was abandoned years ago. One addition is that this version has
_FILE_OFFSET_BITS=64 support.

POSIX puts this in <unistd.h>. glibc also has it in <fcntl.h>.

Bug: http://b/13077650
Change-Id: I5862b1dc326e326c01ad92438ecc1578d19ba739
nistd_test.cpp
9677fab88c25fd2e6f3149ad00fb8870963f0675 26-Jan-2016 Elliott Hughes <enh@google.com> Support _FILE_OFFSET_BITS=64 for most of <stdio.h>.

This doesn't address funopen, but does add fgetpos/fsetpos/fseeko/ftello.

Bug: http://b/24807045
Change-Id: Ibff6f00df5fb699c8e8f13b91a75caf024540b73
tdio_test.cpp
ca482742985a22dbf5ee4a0afdf8525300f7785d 26-Jan-2016 Yabin Cui <yabinc@google.com> Revert "Revert "Make sem_wait able to return errno EINTR for sdk > 23.""

This reverts commit 6d5108520225fd2c4b10ca63565545ec120aab4a.
And add missing bionic_sdk_version.h.

Change-Id: I24cc738b1fd1d26234c52afbc787f5b3c4a9c9cb
emaphore_test.cpp
6d5108520225fd2c4b10ca63565545ec120aab4a 26-Jan-2016 Dan Albert <danalbert@google.com> Revert "Make sem_wait able to return errno EINTR for sdk > 23."

Broke the build. There's no such file as bionic_sdk_version.h anywhere in the tree.

This reverts commit 892b61d3409e8cdf0e121c688737eb058d57f7ab.

Change-Id: Iec3f4588edfb1d1524bb5f16451fd05dc6ebe44a
emaphore_test.cpp
892b61d3409e8cdf0e121c688737eb058d57f7ab 25-Jan-2016 Yabin Cui <yabinc@google.com> Make sem_wait able to return errno EINTR for sdk > 23.

Posix standards says sem_wait is interruptible by the delivery
of a signal. To keep compatiblity with old apps, only fix that
in newer sdk versions.

Bug: 26743454

Change-Id: I924cbb436658e3e0f397c922d866ece99b8241a3
emaphore_test.cpp
c650447239352d43acc2fd99a8579a85ae0469ab 25-Jan-2016 Josh Gao <jmgao@google.com> Merge "Remove dlmalloc."
0ac0cee0d1ab60a92103a5021e76ec31da2e3234 07-Jan-2016 Josh Gao <jmgao@google.com> Remove dlmalloc.

Bug: http://b/17207577
Change-Id: Ie009badca6deb1f91b27a4340b70cdd6bedff893
ndroid.mk
71288cbfdfe138a7f0d59fa2e642dc6e2317eb6d 23-Jan-2016 Elliott Hughes <enh@google.com> Add another stdio test.

This test didn't catch anything, but it does ensure that we exercise
the "lots of files" case.

Bug: http://b/26747402
Change-Id: I6c51c6436029572a49190d509f131eb93b808652
tdio_test.cpp
7f54348f302eea6cc6f0237ddd8775e061da63ac 22-Jan-2016 Elliott Hughes <enh@google.com> Loosen up sys_time.gettimeofday.

We've seen it take 1146us on Nexus 9 (which did have exceptionally slow
system calls).

Bug: http://b/26724042
Change-Id: I263b7e1267d58fe4a6528403d03e5b245fdcd528
ys_time_test.cpp
8d6e19408cfdbd73ba7e5c9e5b8716d9dad8dcf9 21-Jan-2016 Elliott Hughes <enh@google.com> Merge "Simplify fseek/ftell."
2704bd13409a77237147f861c43796148326b2e3 21-Jan-2016 Elliott Hughes <enh@google.com> Simplify fseek/ftell.

Another step towards _FILE_OFFSET_BITS=64 support.

Bug: http://b/24807045
Change-Id: I00b83c81a7b108176c4d9437bc32611f73b7e967
tdio_test.cpp
be4f7429ca66d0652f31fc78fd88de5ee958f890 21-Jan-2016 Christopher Ferris <cferris@google.com> Merge "Remove dependency on zipalign."
3e3b992469ef7a415882ed11305c916d29870452 21-Jan-2016 Dimitry Ivanov <dimitry@google.com> Merge "Do not unmap reserved region on dlclose"
f45b0e9edee72e97106c4b3d393b9bf1582303b3 15-Jan-2016 Dimitry Ivanov <dimitry@google.com> Do not unmap reserved region on dlclose

dlclose used to unmap the part of the reserved region
for ANDROID_DLEXT_RESERVED_ADDRESS that was neccessary
to map PT_LOAD segments. With this change dlclose
replaces mapped PT_LOAD segments with a PROT_NONE,
MAP_ANONYMOUS | MAP_NORESERVE.

Previously caller was unmapping the reserved region after
the failed dlclose which led to race condition when someone
else reused the region freed by dlclose but before the unmap
by the chromium code.

Bug: http://code.google.com/p/chromium/issues/detail?id=568880
Change-Id: I0f5eaa2bf6641f83dde469b631c518482acc59a2
lext_test.cpp
c0ffceccf93e1752a555086a04d1484c1df1b165 20-Jan-2016 Christopher Ferris <cferris@google.com> Remove dependency on zipalign.

Roll our own version of zipalign so that we can break the dependency
on the build tools zipalign. This breaks the transitive dependency
on androidfw so that building bionic unit tests in brillo works again.

Also modify the DlExtTest.ExtInfoUseFdWithOffset test so it dynamically
gets the offset of the shared library inside of the zip instead of
hard-coding the value.

Bug: 25446938
Change-Id: Idfb5d3089960a94eefa2c76e03da1ad2f4d7fb2f
ndroid.mk
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
ibs/Android.mk
ibs/bionic_tests_zipalign.cpp
923f165b29866cba1bd077117127f576763b384d 20-Jan-2016 Elliott Hughes <enh@google.com> Make FILE*s less usable after fclose(3).

BSD doesn't invalidate the fd stored in struct FILE, which can make
it possible (via fileno(3), for example), to perform operations on
an fd you didn't intend to (rather than just failing with EBADF).

Fixing this makes the code slightly simpler anyway, and might help
catch bad code before it ships.

Bug: http://stackoverflow.com/questions/10816837/fclose-works-differently-on-android-and-linux
Change-Id: I9db74584038229499197a2695c70b58ed0372a87
tdio_test.cpp
89f4e09d8da120d12f0e530aa5bc465c0ff0803f 19-Jan-2016 Elliott Hughes <enh@google.com> Merge "Implement if_nameindex(3)/if_freenameindex(3)."
ed57b98758176f0cccdec16cbed524e444039fe7 16-Jan-2016 Elliott Hughes <enh@google.com> Implement if_nameindex(3)/if_freenameindex(3).

This is just a subset of the recently-implemented getifaddrs(3), though if
we want to handle interfaces (such as "rmnet_*") that don't have an address,
we need to either expose ifaddrs_storage and keep track of which interfaces
we've already seen (which is pretty messy), or refactor the netlink code so
we can reuse it and just extract the information we need for if_nameindex(3).
This patch goes the latter route.

Also clean up if_nametoindex(3) and if_indextoname(3).

Change-Id: I5ffc5df0bab62286cdda2e7af06f032c767119a8
faddrs_test.cpp
et_if_test.cpp
a6c25829f1cf5ff0ede68ba0fcbf152dd6db19b0 17-Jan-2016 Yi Kong <yikong@google.com> Merge "Add more tests for getifaddrs(3)"
e8efb96b9d6363256d6762bbd103e7ded7aa359c 14-Jan-2016 Christopher Ferris <cferris@google.com> Add comment for [p]select_smoke tests STDIN issue.

Change-Id: I59cde8b5aaac3e27419ca86d16f85e5af568acf9
ys_select_test.cpp
64b481c29b47b9790dee01f7feabd97868a54760 13-Jan-2016 Yi Kong <yikong@google.com> Add more tests for getifaddrs(3)

This adds the following two checks:

* getifaddrs sees the same list of interfaces as /sys/class/net.
* IPv4 addresses we get from netdevice(7) agrees with results from
getifaddrs.

Change-Id: I2f6d79d0b5cde6d98a0f671d1623b6b2bc75b60f
faddrs_test.cpp
dd926b57a00d0a7d3c861897af303ea1c454fa01 14-Jan-2016 Christopher Ferris <cferris@google.com> Fix select failures when STDIN is ready.

The select_smoke and pselect_smoke test can fail if STDIN has data ready
to be read. The easiest way to see the failure is to type on the command
line while running the tests.

To avoid this, allow the return value to be 2 or 3 and check which fds
are ready to be read.

Change-Id: Iafba332c5f3ed1943e3d34501f123dd45f06a8c4
ys_select_test.cpp
323900cd7dc2a2dc561563f6963806625d89e397 14-Jan-2016 Dan Albert <danalbert@google.com> Merge "Escape failure messages in XML test output."
09a99641ecda72a0b08951db56bbdb0255a4a105 14-Jan-2016 Dan Albert <danalbert@google.com> Escape failure messages in XML test output.

The gtest XML format requires escaped HTML characters in the test
results.

Change-Id: Ieb9519a55cb52093dfb10a88e883b569bc372cdb
test_main.cpp
13f26a7b2bff5ed88b925b7206256e07596f3626 13-Jan-2016 Christopher Ferris <cferris@google.com> Add method to run fortified versions of funcs.

Add a way to turn fortify off for the files that test fortify functions.

This method involves simply compiling the same file with fortify off and
changing the test name slightly.

It's not very pretty, and it assumes that only these few files test
functions that can be fortified.

Bug: 15195631
Change-Id: Iba9db1d508b7d28a1d6968019cb70fe08864827b
ndroid.mk
tdio_nofortify_test.cpp
tdio_test.cpp
tring_nofortify_test.cpp
tring_test.cpp
trings_nofortify_test.cpp
trings_test.cpp
nistd_nofortify_test.cpp
nistd_test.cpp
9361ad3f80adc1e21ab97c8d684afed311788e00 12-Jan-2016 Elliott Hughes <enh@google.com> Fix <sys/sysmacros.h>.

1. The definitions were wrong.
2. The definitions were inline functions.
3. The definitions were polluting the namespace even for code that doesn't
want BSD cruft.

Note that everybody will still get these by default, because you still get
all the BSD stuff by default.

Bug: http://b/12706131
Change-Id: I062ecd09feef7a6e8ba1922d465b96a9c4bf4f4e
ndroid.mk
ys_sysmacros_test.cpp
5d84373c69d2c0dbb0234c47920b02443b37421c 12-Jan-2016 Elliott Hughes <enh@google.com> Add a getifaddrs(3) debugging tool.

...disguised as a test, because that's the easiest way to keep an eye on it.

Change-Id: Iec2531183790d12aec561d27645e5d400f69efbf
faddrs_test.cpp
588213a37dbad3216a892b04c837b1b135ed2c8e 11-Jan-2016 Elliott Hughes <enh@google.com> Add basic tests for <net/if.h>.

Bug: http://b/26447711
Change-Id: I9bbcdffc07e99c98e367a63de861ddc7b274d579
ndroid.mk
et_if_test.cpp
fdb2963e0a65ececa89837eff64ffd8aca8027d2 22-Dec-2015 Yi Kong <yikong@google.com> Handle AF_PACKET in getifaddr(3).

Also fix a bug where we were mutating the address/broadcast address
of an existing entry rather than the new entry, and use 'const' to
ensure we don't make that mistake again.

Change-Id: I31c127a5d21879b52c85cd0f7ed2e66554a21e39
faddrs_test.cpp
09f4651c0ef1920e5f48d87308f6cdd1e5b74149 05-Jan-2016 Josh Gao <jmgao@google.com> Replace MALLOC_IMPL with MALLOC_SVELTE.

Bug: http://b/26390299
Change-Id: I665f64bff4d598607e1eb7c4078819fe1d400feb
ndroid.mk
9cddb482b498abd134f7ccfc9933747e8bcb9cc7 04-Jan-2016 Elliott Hughes <enh@google.com> Revert "Revert "Implement getifaddrs(3)/freeifaddrs(3).""

This reverts commit 76814a8250fd5e1502909ef5e10e4d166cc96c0e.

This differs from the original in fixing the GCC -Werror build:

bionic/libc/bionic/ifaddrs.cpp: In function 'void __handle_netlink_response(ifaddrs**, nlmsghdr*)':
bionic/libc/bionic/ifaddrs.cpp:113:62: error: use of old-style cast [-Werror=old-style-cast]
ifinfomsg* ifi = reinterpret_cast<ifinfomsg*>(NLMSG_DATA(hdr));

This appears to be a GCC bug; the GCC command-line correctly uses -isystem,
and manually adding #pragma GCC system_header doesn't help. So just turn the
warning off for GCC for now. We won't need to worry about building with GCC
soon anyway.

Bug: http://b/26238832
Change-Id: I01615bd335edf11baf487b1c83a9157cd780f4a1
ndroid.mk
faddrs_test.cpp
bd4d45d55b4ea57b909aecc693f34d5f87869c72 24-Dec-2015 Nick Kralevich <nnk@google.com> Add tests for /proc/self/fd and /proc/self/task/TID/fd access

Add tests to ensure that the following kernel patches are present:

__ptrace_may_access() should not deny sub-threads
* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=73af963f9f3036dffed55c3a2898598186db1045

proc: make proc_fd_permission() thread-friendly
* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=96d0df79f2644fc823f26c06491e182d87a90c2a

proc: actually make proc_fd_permission() thread-friendly
* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=54708d2858e79a2bdda10bf8a20c80eb96c20613

Bug: 26110743
Bug: 24912743
Bug: 26016905
Change-Id: I7eab002ddfade9e4bfe51908e190231c8dde2cc7
ndroid.mk
ug_26110743_test.cpp
b62e633ff679a65df97be55bd0ae6a02633ce472 22-Dec-2015 Yi Kong <yikong@google.com> Merge "Revert "Implement getifaddrs(3)/freeifaddrs(3).""
76814a8250fd5e1502909ef5e10e4d166cc96c0e 22-Dec-2015 Yi Kong <yikong@google.com> Revert "Implement getifaddrs(3)/freeifaddrs(3)."

Werror build broken. Revert while working on a fix.

This reverts commit 0945ed5cc5921243724fed4465d20881f4891a8d.

Change-Id: I67edab7a7a3b9aa673ce9d14aa95380f947838a1
ndroid.mk
faddrs_test.cpp
71417caa927bb6720ae6cd759f335d8081f57895 22-Dec-2015 Yi Kong <yikong@google.com> Merge "Implement getifaddrs(3)/freeifaddrs(3)."
7331fe18d7ffd550996e07b534bc7a6cf625afa5 14-Dec-2015 Dimitry Ivanov <dimitry@google.com> linker: implement shared namespaces

Shared namespaces clone the list of loaded native
libraries from the caller namespace. This allows
classloaders for bundled apps to share already loaded
libraries with default namespace.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I8949d45937fdb38e1f586ff0679003adac0d9dad
(cherry picked from commit e78deef364d952dd1141a2f3067a12060aaf11e6)
lext_test.cpp
0945ed5cc5921243724fed4465d20881f4891a8d 19-Dec-2015 Elliott Hughes <enh@google.com> Implement getifaddrs(3)/freeifaddrs(3).

Time to dust off the old libcore implementation from gingerbread and add it
to bionic. Unlike the original, this actually looks at both RTM_NEWLINK and
RTM_NEWADDR.

Bug: http://b/26238832
Change-Id: I7bb4b432deb766065b66b9c9ff36ed68249aba82
ndroid.mk
faddrs_test.cpp
7cb3c4af134cfa4308742c86086bccdd06463c0c 17-Dec-2015 Elliott Hughes <enh@google.com> Merge "sem_timedwait with a null timeout doesn't mean "forever"."
d4f86aed42a97e1d7c502595b0fe1270f7989c7a 17-Dec-2015 Dimitry Ivanov <dimitry@google.com> Merge "linker: add dlvsym(3)"
9cf99cbad89c8495828788ce693a99ced434f66f 11-Dec-2015 Dimitry Ivanov <dimitry@google.com> linker: add dlvsym(3)

This changes implements dlvsym - dlsym for versioned symbols.

Bug: http://b/22865643
Change-Id: Ic90a60d512104261a1416c43f9100f0d88e3b46f
lfcn_test.cpp
dd586f2ebd0c42904e699f3634568a38c97d4da7 17-Dec-2015 Elliott Hughes <enh@google.com> sem_timedwait with a null timeout doesn't mean "forever".

It actually means "crash immediately". Well, it's an error. And callers are
much more likely to realize their mistake if we crash immediately rather
than return EINVAL. Historically, glibc has crashed and bionic -- before
the recent changes -- returned EINVAL, so this is a behavior change.

Change-Id: I0c2373a6703b20b8a97aacc1e66368a5885e8c51
emaphore_test.cpp
ad33ebead801f24d3197bc16f875501729e98485 16-Dec-2015 Christopher Ferris <cferris@google.com> Fix bug in dlmalloc's version of calloc.

Under some circumstances, doing a calloc will make sure that the memory
returned will be zero up to the size of the requested size. However, if
there is more usable size than the requested size, that extra part
of the allocation will not be zeroed. This change fixes it so that the
entire usable memory is always zeroed.

Change-Id: I8a66d6767c074023c4ba3568bf2705e1886740fc
alloc_test.cpp
d31d4c1cc65ab878c32927259fcc7ac744f7cc52 15-Dec-2015 Elliott Hughes <enh@google.com> Add a few missing pthread tests.

This seems to be all that's tested by system/extras/tests/bionic that isn't
already better tested here.

Change-Id: Id0aa985cefd4047a6007ba9804f541069d9e92ed
thread_test.cpp
162a8524ea79564b5c92e5effc86588cac07e23c 14-Dec-2015 Elliott Hughes <enh@google.com> Merge "Fix personality test for mips32r6"
61cf963efeb8066172ad7529b8036ba9dd392d0e 11-Dec-2015 Lazar Trsic <Lazar.Trsic@imgtec.com> Fix personality test for mips32r6

When personality syscall is executed on mips64, for a 32bit process,
sys_32_personality() is called, which converts PER_LINUX32 -> PER_LINUX.
Change expected value when mips32 is a second architecture.

For more information see:
https://www.linux-mips.org/archives/linux-mips/2015-08/msg00421.html
https://www.linux-mips.org/archives/linux-mips/2015-11/msg00093.html

Change-Id: I8c9062f536ad6e513f0ac585da3568d80e5fa1b4
ys_personality_test.cpp
4a2c5aa30ceea2aaf8dcaee2feb4879978af4fce 11-Dec-2015 Dimitry Ivanov <dimitry@google.com> Move dlsym and dladdr implementation to linker.cpp

Bug: http://b/25716705
Bug: http://b/22865643
Change-Id: If22fc1eda219f676b5fcc06490f7901d21d1749c
lfcn_test.cpp
284ae3559ed909613b189b98bdc3efab94373a30 08-Dec-2015 Dimitry Ivanov <dimitry@google.com> Add permitted_when_isolated_path to linker namespaces

The permitted_when_isolated_path is a way to white-list
directories not present in search-path. It is ignored for
not isolated namespaces.

Bug: http://b/25853516
Bug: http://b/22548808
Change-Id: Ib1538037268eea69323ea49968a34a4a1d1938a5
lext_test.cpp
e371ae68ac0d6d39cacf5edc893bda2f4a61e883 05-Dec-2015 Dimitry Ivanov <dimitry@google.com> Merge "Allow dlopening public libs using absolute path"
22840aab47763c88598b32d1edcac4d8b3ef21f0 05-Dec-2015 Dimitry Ivanov <dimitry@google.com> Allow dlopening public libs using absolute path

dlopen on isolated namespaces should be able to open
public libraries using absolute path not only soname.

Bug: http://b/25853820
Change-Id: If574a67853dc51226f0f376e9e2d108316002f84
lext_test.cpp
939a7e01197858fdb8463bb5a8284ba501a3e882 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename from base/ to android-base/.

Change-Id: I0a4592945400b1fa6892bf7c1fa8659fd711efa3
nistd_test.cpp
tils.h
514f46b74c5424eb10f21349654e90fcf69b3b10 04-Dec-2015 Yabin Cui <yabinc@google.com> Merge "Don't use StringPrintf() in gtest runner."
a32fc8685dc0b81f9e10d99fdb248f33c0fa05f7 04-Dec-2015 Yabin Cui <yabinc@google.com> Don't use StringPrintf() in gtest runner.

Change-Id: I0cd0b3cbb952c65b1c449e88ce12964b93029538
ndroid.mk
test_main.cpp
376b94f1e777375eb9ebb04a882b898aafa94625 03-Dec-2015 Tom Cherry <tomcherry@google.com> Merge "Separate properties by selabel"
d4c9b9d5ac3438d34536613143bbe63374e586f1 17-Nov-2015 Yabin Cui <yabinc@google.com> Improve unit test runner.

1. Read unit test's output while the test is running. Previously
we only read output when the test finishes, which has trouble
when the test outputs too many stuff.
2. Report failed unit test's exit code. It is useful when the
test doesn't fail in ASSERT_xxx, but in somewhere else.

Bug: 25392375
Change-Id: Ie90823337f7c2ee25fa489a5534801d991258f95
ndroid.mk
test_main.cpp
49a309ff6a8349cbd1625711497743463638bebf 24-Sep-2015 Tom Cherry <tomcherry@google.com> Separate properties by selabel

The purpose of this change is to add read access control to the property
space.

In the current design, a process either has access to the single
/dev/__properties__ file and therefore all properties that it contains
or it has access to no properties. This change separates properties
into multiple property files based on their selabel, which allows
creation of sepolicies that allow read access of only specific sets of
properties to specific domains.

Bug 21852512

Change-Id: Ice265db79201ca811c6b6cf6d851703f53224f03
ystem_properties_test.cpp
9cbabd8fe5ef3834682996ff23b4a5325e0586cb 01-Dec-2015 Chih-hung Hsieh <chh@google.com> Merge "Add bionic-unit-tests-gcc{32,64}, compiled with gcc."
aec13988dab7ff32cb005f42b952e3b9b55a4779 30-Nov-2015 Yabin Cui <yabinc@google.com> Merge "Fix pthread_test according to tsan report."
f688c5d5b407b17b42b38b25449ab12320c33786 20-Nov-2015 Chih-Hung Hsieh <chh@google.com> Add bionic-unit-tests-gcc{32,64}, compiled with gcc.

* bionic-unit-tests{32,64} are compiled with clang/llvm.
* Skip one single test in __cxa_thread_atexit_test.cpp
when compiled with aarch64 clang/llvm.
Aarch64 clang/llvm generates relocation references to
"thread_local" symbols not supported by Android linker.

BUG: 25642296
Change-Id: Ia0497b79c4b335228afeb48a26e0592217909953
ndroid.mk
_cxa_thread_atexit_test.cpp
db8caa740a409c2ce75f875df84857e6be69eb9f 24-Nov-2015 Dimitry Ivanov <dimitry@google.com> Merge "Introduce anonymous namespace"
1ffec1cc4d0e283bb1ff6f49843769a3493b8d73 23-Nov-2015 Dmitriy Ivanov <dimitry@google.com> Introduce anonymous namespace

The anonymous namespace is introduced to
handle cases when linker can not find the
caller. This usually happens when caller
code was not loaded by dynamic linker;
for example mono-generated code.

Bug: http://b/25844435
Bug: http://b/22548808
Change-Id: I9e5b1d23c1c75bc78548d68e79216a6a943a33cf
lext_test.cpp
ibs/namespaces_root.cpp
17554356cc865908e5cbd7814c8be7e47c9c4ec5 23-Nov-2015 Yabin Cui <yabinc@google.com> Merge "Change _stdio_handles_locking into _caller_handles_locking."
74ed96d59731aa3661494330804d866e825209d3 21-Nov-2015 Yabin Cui <yabinc@google.com> Merge "Use FUTEX_WAIT_BITSET to avoid converting timeouts."
76144aaa6397fe9e16893882cf59c5c9c0684a66 19-Nov-2015 Yabin Cui <yabinc@google.com> Change _stdio_handles_locking into _caller_handles_locking.

It is reported by tsan that funlockfile() can unlock an unlocked mutex.
It happens when printf() is called before fopen() or other stdio stuff.
As FLOCKFILE(fp) is called before __sinit(), _stdio_handles_locking is false,
and _FLOCK(fp) will not be locked. But then cantwrite(fp) in __vfprintf()
calls__sinit(), which makes _stdio_handles_locking become true, and
FUNLOCKFILE(fp) unlocks _FLOCK(fp).

Change _stdio_handles_locking into _caller_handles_locking,
so __sinit() won't change its value. Add test due to my previous fault.

Bug: 25392375
Change-Id: I483e3c3cdb28da65e62f1fd9615bf58c5403b4dd
thread_test.cpp
tdio_ext_test.cpp
tils.h
2feb9dde6090a4b88d0cadc0a69245beeb173468 19-Nov-2015 Josh Gao <jmgao@google.com> Fix test build break.

Change-Id: I73a39c6d4bb9baebbfb5572e9259bcd405116039
ys_mman_test.cpp
c9a659c57b256001fd63f9825bde69e660c2655b 06-Nov-2015 Yabin Cui <yabinc@google.com> Use FUTEX_WAIT_BITSET to avoid converting timeouts.

Add unittests for pthread APIs with timeout parameter.

Bug: 17569991

Change-Id: I6b3b9b2feae03680654cd64c3112ce7644632c87
thread_test.cpp
emaphore_test.cpp
c22a7de798c4c0da30ad095a0c61a8f905eb9613 07-Nov-2015 Daniel Micay <danielmicay@gmail.com> extend the PTRDIFF_MAX size check to mremap

This removes another way to obtain objects larger than PTRDIFF_MAX. The
only known remaining hole is now jemalloc's merging of virtual memory
spans.

Technically this could be wrapped in an __LP64__ ifndef since it can't
occur on 64-bit due to the 1:1 split. It doesn't really matter either
way.

Change-Id: Iab2af242b775bc98a59421994d87aca0433215bd
ys_mman_test.cpp
2c09e5de299ca87a9e68807e2b4af41ba61710f3 19-Nov-2015 Yabin Cui <yabinc@google.com> Merge "Implement pthread spin."
fe3a83a9343f0e4ff654f09ef8ffc8a773c7c105 18-Nov-2015 Yabin Cui <yabinc@google.com> Implement pthread spin.

In order to run tsan unit tests, we need to support pthread spin APIs.

Bug: 18623621
Bug: 25392375
Change-Id: Icbb4a74e72e467824b3715982a01600031868e29
thread_test.cpp
3cc35e224c6fe6bb82685ff8b2758553563e2a05 18-Nov-2015 Dmitriy Ivanov <dimitry@google.com> Ignore target sdk version for the public namespace

This fixes the bug with using the libraries loaded
prior to android_set_target_sdk_version call.

Bug: http://b/22548808
Change-Id: I3ca2d367b0fa930a437bbb65f780834803d2ef0a
lext_test.cpp
a36158a77d904aa65f50d5950b7608ef8fa3210f 17-Nov-2015 Yabin Cui <yabinc@google.com> Fix pthread_test according to tsan report.

1. Fix leak threads and data races related to spin_flag.
2. Increase stack size to run under tsan.

This doesn't pass all pthread tests, as some tests are used
to run intentionally in race situations.

Bug: 25392375
Change-Id: Icfba3e141e7170abd890809586e89b99adc8bd02
thread_test.cpp
b804b9d67b9e3a8c63471ff9892f6abea2a58684 17-Nov-2015 Yabin Cui <yabinc@google.com> Merge "Implement pthread barrier."
e7c2fffa16eccecfd43d99516751a43776f5f609 06-Nov-2015 Yabin Cui <yabinc@google.com> Implement pthread barrier.

Bug: 24341262
Change-Id: I5472549e5d7545c1c3f0bef78235f545557b9630
thread_test.cpp
949bfb9e3cceac7913fe1debc39617c9ec01ae5e 16-Nov-2015 Chih-hung Hsieh <chh@google.com> Merge "Enable clang to compile more tests."
1f0ccbb59cd32dfad0e6d9fd9619905e067076a6 16-Nov-2015 Dimitry Ivanov <dimitry@google.com> Merge "Introducing linker namespaces"
1e79540807c692fa8dbd494dfe290c3aab85420e 16-Nov-2015 Chih-Hung Hsieh <chh@google.com> Enable clang to compile more tests.

* Disable optimization only in gtest.h of atexit_test.c for arm/aarch64
to keep VTT for std::__1::basic_stringstream<char, std::__1::char_traits<char>,
std::__1::allocator<char> > to link with g++ compiled modules.
* bionic-unit-tests source files are not affected by clang x86_64 fp128 bug
so they can be compiled with clang.

BUG: 25643775
Change-Id: I3da2a0de61edcdca07b7fcd73a16de9da4a1f7d6
ndroid.mk
texit_test.cpp
42d5fcb9f494eb45de3b6bf759f4a18076e84728 30-Oct-2015 Dmitriy Ivanov <dimitry@google.com> Introducing linker namespaces

Bug: http://b/22548808
Change-Id: Ia3af3c0a167f1d16447a3d83bb045d143319b1e1
ndroid.build.mk
lext_test.cpp
ibs/Android.build.linker_namespaces.mk
ibs/Android.build.target.testlib.mk
ibs/Android.mk
ibs/namespaces_dlopened.cpp
ibs/namespaces_private.cpp
ibs/namespaces_public.cpp
ibs/namespaces_root.cpp
5780f9d80963fbe7b93f501dd3dd7edc7fab46b0 13-Nov-2015 Elliott Hughes <enh@google.com> Merge "Fix strftime if tm_zone is null."
a9cac4c87a4ea3e6d1c0a1159909bf0e209a61a7 13-Nov-2015 Elliott Hughes <enh@google.com> Fix strftime if tm_zone is null.

Upstream tzcode said "On platforms with tm_zone, strftime.c now assumes it
is not NULL". Which is fine for any struct tm generated by tzcode, but not
necessarily true of a struct tm constructed by arbitrary code. In particular,
Netflix on Nexus Player was failing to start because they format "%Z" with
a struct tm whose tm_zone is null (the other fields are valid, but, yeah,
that's probably not intentional).

glibc takes a null tm_zone to mean "the current time zone", so let's do that
too. (Historically Android would use the empty string, and POSIX doesn't
clarify which of this is the appropriate behavior when tm_zone is null.)

Bug: http://b/25170306
Change-Id: Idbf68bfe90d143aca7dada8607742905188b1d33
ime_test.cpp
2ed1b29d00e7ad392bf12bb73666ed78a096dad8 13-Nov-2015 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc

The default compiler is clang. We need to explicitly indicate
that we should use gcc.

Change-Id: I37859c2e303f2a86a2565fe72eda1fda7c557a59
ndroid.mk
0c447053de4b87d50ebec260c7e1d949fe934065 12-Nov-2015 Chih-hung Hsieh <chh@google.com> Merge "Enable clang for modules failed with TLS."
5058a005b8dfb4bd5eefe0eb4420f1c37665b2b0 10-Nov-2015 Chih-Hung Hsieh <chh@google.com> Enable clang for modules failed with TLS.

New 3.8 clang/llvm can compile TLS code now.
* For x86_64, still disable clang due to f128 bug.
* For b/25643775, arm and arm64, disable clang in unit tests.
* Fix thread_local_test.cpp to compile with clang and
limit gcc workaround only to arm and aarch64.

BUG: 25643775

Change-Id: Iecd006bf1fc417dbcce2c63343a59c4bf1fa77ea
ndroid.mk
hread_local_test.cpp
f208361b2b7c00b1decefa4bdb7115338649686b 11-Nov-2015 Elliott Hughes <enh@google.com> Clean up pthread_gettid_np test.

Change-Id: I0fad26c7824981bfa3ad3a8a0b28a1984062dcd1
thread_test.cpp
de1246202a229efe555170a7c5803510f5975658 10-Nov-2015 Junjie Hu <junjie.hu@mediatek.com> Fix potential race condition on CTS TC pthread_gettid_np

Root cause:
If start_routine thread exits before pthread_gettid_np is invokded, the "tid" field
will be cleared so that pthread_gettid_np will get "0" (which is cleared by kernel,
due to the flag "CLONE_CHILD_CLEARTID" is set while calling clone system call inside
pthread_create).

Proposed patch:
Use a mutex to guarantee pthread_gettid_np will be invoked and returned before the
start_routine exits

Signed-off-by: Junjie Hu <junjie.hu@mediatek.com>

Change-Id: I22411f1b0f7446d76a0373cef4ccec858fac7018
(cherry picked from commit 4f8010293506d4e08d184e66bf4af44ef3483611)
thread_test.cpp
1a5bfd9eaf22eaf9fcc54d3065d0e88bff4f3e42 11-Nov-2015 Daniel Xie <dxie@google.com> Merge "Fix potential race condition on CTS TC pthread_gettid_np" into marshmallow-cts-dev am: 2010fb6722
am: eebe01b523

* commit 'eebe01b523075c0634b04463c210510f192f154d':
Fix potential race condition on CTS TC pthread_gettid_np
4f8010293506d4e08d184e66bf4af44ef3483611 10-Nov-2015 Junjie Hu <junjie.hu@mediatek.com> Fix potential race condition on CTS TC pthread_gettid_np

Root cause:
If start_routine thread exits before pthread_gettid_np is invokded, the "tid" field
will be cleared so that pthread_gettid_np will get "0" (which is cleared by kernel,
due to the flag "CLONE_CHILD_CLEARTID" is set while calling clone system call inside
pthread_create).

Proposed patch:
Use a mutex to guarantee pthread_gettid_np will be invoked and returned before the
start_routine exits

Signed-off-by: Junjie Hu <junjie.hu@mediatek.com>

Change-Id: I22411f1b0f7446d76a0373cef4ccec858fac7018
thread_test.cpp
09fac86ca370a70b6995216de8df1488a833cb1e 10-Nov-2015 Josh Gao <jmgao@google.com> Fix test failure.

Bug: http://b/25596173
Change-Id: I0cf8f550837d4a936d6a784063a0ec9509150358
ibgen_basename_test.cpp
8b5b2c467281de502ba1c8ffbe447ef95fbf5219 06-Nov-2015 Elliott Hughes <enh@google.com> Merge "fix the mremap signature"
4200e260d266fd0c176e71fbd720d0bab04b02db 03-Nov-2015 Daniel Micay <danielmicay@gmail.com> fix the mremap signature

The mremap definition was incorrect (unsigned long instead of int) and
it was missing the optional new_address parameter.

Change-Id: Ib9d0675aaa098c21617cedc9b2b8cf267be3aec4
ys_mman_test.cpp
fd7a91e69263a991f65fa458ff33de0670b4fd81 06-Nov-2015 Dmitriy Ivanov <dimitry@google.com> linker: cleanup solist after unsuccessful read

Bug: http://b/25560017
Change-Id: I03c5a1d7aed34c480d341aacfb3b1afdfa037b99
lext_test.cpp
eb9b9250122080df4a11293b9b6679e0b63ae2dd 04-Nov-2015 Josh Gao <jmgao@google.com> Fix GNU/POSIX basename headers.

Including glibc's <libgen.h> will result in the user getting the POSIX
version of basename always, regardless of when it is included relative
to <string.h>. Prior to this patch, our implementation would result in
the one that's included first winning.

Bug: http://b/25459151
Change-Id: Id4aaf1670dad317d6bbc05763a84ee87596e8e59
ndroid.mk
ibgen_basename_test.cpp
ibgen_test.cpp
4151db5f997cd91d3505ac6594bede0b50184855 29-Oct-2015 Elliott Hughes <enh@google.com> Add prlimit to LP32.

Bug: http://b/24918750
Change-Id: I0151cd66ccf79a6169610de35bb9c288c0fa4917
ys_resource_test.cpp
1721be2229d07b5eea830f02a76e7be56d172aa9 27-Oct-2015 Elliott Hughes <enh@google.com> Merge "Implement scandirat and scandirat64."
6331e806de41d98083f1bfa3661addfae4682c37 27-Oct-2015 Elliott Hughes <enh@google.com> Implement scandirat and scandirat64.

Bug: http://b/12612339
Change-Id: Id3b249a884fe08964b26a017ae9574961f0cb441
irent_test.cpp
5238eb09844f9c1578353d4c9e297aadb34c71be 27-Oct-2015 Dimitry Ivanov <dimitry@google.com> Merge "Implement load at fixed address feature"
126af757c6d6a6447c19236df8d98ba07f21996f 08-Oct-2015 Dmitriy Ivanov <dimitry@google.com> Implement load at fixed address feature

Bug: http://b/24683631
Change-Id: I3a39ab526c8f9e213339b60e135e5459d0f41381
lext_test.cpp
9216a64c90ae30da109850526cdeaca26f38da14 27-Oct-2015 Elliott Hughes <enh@google.com> Fix <utmp.h> declarations.

If we're going to keep this useless header -- and I think it's too late to
remove it -- it may as well be correct.

Bug: http://b/17700469
Change-Id: Ifec4f8f1a984483d7fa7d81d47786f75b70ff4ba
tmp_test.cpp
6f2d3104c82f81c1f0123a3cfb25ae670841d0ba 13-Oct-2015 Lazar Trsic <Lazar.Trsic@imgtec.com> Correctly resolve realpath for absolute paths

Introduced by: https://android-review.googlesource.com/174475

Change-Id: I44e00040b28be167d5141454f919340afec6084e
lfcn_test.cpp
8ab433df132aa59db08b4548155d72574ad06421 10-Oct-2015 Elliott Hughes <enh@google.com> Fix stdio read after EOF behavior.

Bug: https://code.google.com/p/android/issues/detail?id=184847
Change-Id: Ia20ce94007c2a09649f0763b1dc7ba959f2f618d
tdio_test.cpp
7b77cb35aff34ff56a0b63517267c6203f9d1119 10-Oct-2015 Elliott Hughes <enh@google.com> Fix inet_aton on LP32.

I wasn't checking for overflow. Luckily, I had a test that overflows on LP32.

Change-Id: If2cf33d88f459eb26d0ce75f3c5ed192f516ab7a
rpa_inet_test.cpp
487a1823e8617011009eded8eae9a75c1f871887 10-Oct-2015 Elliott Hughes <enh@google.com> Merge "Fix inet_addr/inet_aton/inet_network."
047866672c66e51b557721cf50ba101305c252d2 09-Oct-2015 Elliott Hughes <enh@google.com> Fix inet_addr/inet_aton/inet_network.

Rewrite inet_addr and inet_network in terms of inet_aton, and reimplement
that to include all the missing error checks.

Bug: http://b/24754503
Change-Id: I5dfa971c87201968985a0894df419f0fbf54768a
rpa_inet_test.cpp
d8df28ff3833e620db1b61dd4038028dd160c870 09-Oct-2015 Josh Gao <jmgao@google.com> Merge "Implement setjmp cookies on MIPS and MIPS64"
1b519c0ae436480881ab10d5b66a184afa4d4373 06-Oct-2015 Nikola Veljkovic <Nikola.Veljkovic@imgtec.com> Implement setjmp cookies on MIPS and MIPS64

Bug: http://b/23942752
Change-Id: Ie58892a97b5075d30d7607667251007cda99d38c
etjmp_test.cpp
268f73917831e709bc6a201658c19ffb5c8cbfd1 08-Oct-2015 Dimitry Ivanov <dimitry@google.com> Merge "Make dt_runpath work for libraries opened from apk"
a828a2f8e6fd5271787a7dea4c682cbf54425a14 02-Sep-2015 Torne (Richard Coles) <torne@google.com> linker: don't pass dlextinfo to dependent loads.

Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: 23742664
Change-Id: I53d8cdf0982d8758e6d2ced4864c704cdf74118f
ibs/Android.mk
a1feb117e4d5614548574f28dede3443e073512b 02-Oct-2015 Dmitriy Ivanov <dimitry@google.com> Make dt_runpath work for libraries opened from apk

This patch also fixes realpath for libraries opened directly
from apks.

Bug: http://b/21960914
Bug: http://b/21961857
Change-Id: I35ade661c87f1d448191f385811f6e9fd3cacf11
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
ibs/Android.build.dt_runpath.mk
ibs/dlopen_b.cpp
bc6379d7da110d9164d5b34cdbebff2e4fc487b8 07-Oct-2015 Yabin Cui <yabinc@google.com> Remove the workaround which fixes JOB_COUNT in CTS test.

Bug: 24376925
Change-Id: Ib195ce1577ee9412068cc1b6223fc051b5bcfcaa
ndroid.mk
test_main.cpp
df62e3171ca52cbdadb3c3edc93c42cfacbad054 03-Oct-2015 Elliott Hughes <enh@google.com> am 5c50449b: Merge "Use const auto& in for loops."

* commit '5c50449b0c098cb8191fe3f7791e91a7ec4f7029':
Use const auto& in for loops.
0b2acdfcc99ecf3ff36fc6337e14b171170f38cf 03-Oct-2015 Elliott Hughes <enh@google.com> Use const auto& in for loops.

Change-Id: Ic437c59797ee4e7dc38291da35c72d827bc89c8d
test_main.cpp
thread_test.cpp
nistd_test.cpp
889dd56428fdecedb55e11b990609993294561ff 30-Sep-2015 Dimitry Ivanov <dimitry@google.com> am a0b9cad0: Merge "Optimize dlopen from a zip file"

* commit 'a0b9cad07629439bab926373515d964253426a69':
Optimize dlopen from a zip file
a0b9cad07629439bab926373515d964253426a69 30-Sep-2015 Dimitry Ivanov <dimitry@google.com> Merge "Optimize dlopen from a zip file"
b48275045de93cce292faaf5170af3ead89b3746 29-Sep-2015 Dmitriy Ivanov <dimitry@google.com> Optimize dlopen from a zip file

This change makes dynamic linker reuse ZipArchiveHandles in
ld_library_path on dlopen to optimize the lookup of dt_needed
libraries.

Bug: http://b/21960534
Change-Id: I65f897910d46dd2ffabdcb0b7842db2f127eee30
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
ibs/Android.mk
8cd1180904a0b8713c20feed5255bbedcfabe4e9 30-Sep-2015 Yabin Cui <yabinc@google.com> am c1eebd5f: Merge "Fix the way to count online cpus."

* commit 'c1eebd5ff42cdf8f8a08be76bfdeaad6a327976c':
Fix the way to count online cpus.
c1eebd5ff42cdf8f8a08be76bfdeaad6a327976c 30-Sep-2015 Yabin Cui <yabinc@google.com> Merge "Fix the way to count online cpus."
cb6f599c44b144db26c13507dbd89805b8fe03be 30-Sep-2015 Yabin Cui <yabinc@google.com> Fix the way to count online cpus.

Read /proc/stat to count online cpus is not correct for all android
kernels. Change to reading /sys/devices/system/cpu/online instead.

Bug: 24376925
Change-Id: I3785a6c7aa15a467022a9a261b457194d688fb38
nistd_test.cpp
4f3e3591ace36b6d86e3a1bc8b3f438989cb0618 29-Sep-2015 Christopher Ferris <cferris@google.com> am 93a91f0c: Force cts to only run one test at a time.

* commit '93a91f0cf4f015762ac1ed57395c4c0de8ba7db3':
Force cts to only run one test at a time.
1c34fea8033d64b7f2c54366add908aba7fa44dc 29-Sep-2015 Colin Cross <ccross@android.com> am 8b279ead: Merge "Pass -q is zip for test"

* commit '8b279eadd3a635c31df9c570ab2144212bfd07cc':
Pass -q is zip for test
8b279eadd3a635c31df9c570ab2144212bfd07cc 29-Sep-2015 Colin Cross <ccross@android.com> Merge "Pass -q is zip for test"
298d176813af58731063b4c403143cedf3803eb4 29-Sep-2015 Colin Cross <ccross@android.com> Pass -q is zip for test

Pass -q to zip for dlext_testzip to avoid printing:
adding: empty_file.txt (stored 0%)
on every compile.

Bug: 24409581
Change-Id: I2320f31182a9a332b3ef8b32a22561092ab5aceb
ibs/Android.build.dlext_testzip.mk
bfd9255ddba7db2e07de6483bf55f567c7f1f7a3 28-Sep-2015 Dan Willemsen <dwillemsen@google.com> am f16f4f8a: Merge "Fix file-check-cxx to handle quoted arguments"

* commit 'f16f4f8a6bac035db5f25538ddb4fe810d0719db':
Fix file-check-cxx to handle quoted arguments
f16f4f8a6bac035db5f25538ddb4fe810d0719db 28-Sep-2015 Dan Willemsen <dwillemsen@google.com> Merge "Fix file-check-cxx to handle quoted arguments"
808602a4852d470f5420af3c1711ffc0a4e90777 28-Sep-2015 Dan Willemsen <dwillemsen@google.com> Fix file-check-cxx to handle quoted arguments

If the OVERRIDE_C_DATE_TIME environment variable is set, the build
system will add a macro to the global cflags that contains a static
quoted date, like:

-D__DATE__="\"Sep 28 2015\""

file-check-cxx needs to properly pass that through as a single, still
quoted argument. So use the quoted "$@" instead of turning each word
into an argument.

Change-Id: I6929d712c280d0452062640e0cba8a176d045c97
ile-check-cxx
b99b3f773cef7d160481f8c30b41c01839ca7090 26-Sep-2015 Colin Cross <ccross@android.com> am 55f87a0c: Merge "Force non-color output for bionic FileCheck tests"

* commit '55f87a0c0bb587ee85b5662967563462d52db560':
Force non-color output for bionic FileCheck tests
0f575d4482cebbedcc9d44634ba453fa57f21c3f 26-Sep-2015 Colin Cross <ccross@android.com> am 4a54ec82: Merge "Add .PHONY for phony bionic test targets"

* commit '4a54ec8200356a755aeeb212c4dd9cefad39754c':
Add .PHONY for phony bionic test targets
93a91f0cf4f015762ac1ed57395c4c0de8ba7db3 25-Sep-2015 Christopher Ferris <cferris@google.com> Force cts to only run one test at a time.

Also, slightly increase the timeout for each test run.

Bug: 24198050

(cherry picked from commit daaaed18ce1d2f2da9d2240e974922299d937670)

Change-Id: I29e169e962da803a89abf0a28e071abcafa315b7
ndroid.mk
test_main.cpp
55f87a0c0bb587ee85b5662967563462d52db560 26-Sep-2015 Colin Cross <ccross@android.com> Merge "Force non-color output for bionic FileCheck tests"
4a54ec8200356a755aeeb212c4dd9cefad39754c 26-Sep-2015 Colin Cross <ccross@android.com> Merge "Add .PHONY for phony bionic test targets"
c1d4ba88cfd824b938feed68a706d2a06e993d3a 26-Sep-2015 Christopher Ferris <cferris@google.com> am b48ca46d: Merge "Force cts to only run one test at a time."

* commit 'b48ca46d88d9e664763eff39604f772a57d8e2fb':
Force cts to only run one test at a time.
840be7cb790b6122bda2238999951c55d6483511 25-Sep-2015 Colin Cross <ccross@android.com> Force non-color output for bionic FileCheck tests

Turning on color output will break the bionic compilation tests that
check for expected warnings, as they will be matching color output
against non-color expected values. Turn off color locally.

Bug: 24273983
Change-Id: Ia3b3262ccece121217f0dc0997734b3ad65b928b
ndroid.mk
b67afb3eb5429a8605dde90298f2af938dfa467c 25-Sep-2015 Colin Cross <ccross@android.com> Add .PHONY for phony bionic test targets

Bug: 24384320
Change-Id: I41038ff8b34391d03ce1e204e30e5ae34ec56614
ndroid.mk
daaaed18ce1d2f2da9d2240e974922299d937670 25-Sep-2015 Christopher Ferris <cferris@google.com> Force cts to only run one test at a time.

Also, slightly increase the timeout for each test run.

Bug: 24198050
Change-Id: I2b0ebdebb909023d0f179e0a433c564266a99161
ndroid.mk
test_main.cpp
6eb06b0399c95f52cd28ff7971582ebec42f45f7 24-Sep-2015 Christopher Ferris <cferris@google.com> am 70a9f0a3: Merge "Fix over read in strcpy/stpcpy/strcat."

* commit '70a9f0a3bc310c863b5c90c9860aae842f82e47f':
Fix over read in strcpy/stpcpy/strcat.
70a9f0a3bc310c863b5c90c9860aae842f82e47f 24-Sep-2015 Christopher Ferris <cferris@google.com> Merge "Fix over read in strcpy/stpcpy/strcat."
fdfcfce7c6392d32f95a9f776ecd13da205b906c 24-Sep-2015 Christopher Ferris <cferris@google.com> Fix over read in strcpy/stpcpy/strcat.

This bug will happen when these circumstances are met:

- Destination address & 0x7 == 1, strlen of src is 11, 12, 13.
- Destination address & 0x7 == 2, strlen of src is 10, 11, 12.
- Destination address & 0x7 == 3, strlen of src is 9, 10, 11.
- Destination address & 0x7 == 4, strlen of src is 8, 9, 10.

In these cases, the dest alignment code does a ldr which reads 4 bytes,
and it will read past the end of the source. In most cases, this is
probably benign, but if this crosses into a new page it could cause a
crash.

Fix the labels in the cortex-a9 strcat.

Modify the overread test to vary the dst alignment to expost this bug.
Also, shrink the strcat/strlcat overread cases since the dst alignment
variation increases the runtime too much.

Bug: 24345899
Change-Id: Ib34a559bfcebd89861985b29cae6c1e47b5b5855
uffer_tests.cpp
tring_test.cpp
01030c24b0e3ace1b4cdaf415354e2f315f4f3a9 22-Sep-2015 Yabin Cui <yabinc@google.com> Increase alternative signal stack size on 64-bit devices.

Bug: 23041777
Bug: 24187462
Change-Id: I7d84c0cc775a74753a3e8e101169c0fb5dbf7437
thread_test.cpp
tack_unwinding_test.cpp
839119757d4d841359ad5f16d3bde8e4581f8322 23-Sep-2015 Elliott Hughes <enh@google.com> am cb696c50: Merge "Remove libpagemap include hack."

* commit 'cb696c50c293f387c7de46cd3c8573a335e273bf':
Remove libpagemap include hack.
7660a088cdf942dc6ee0ad33a44e4fafecc77e93 23-Sep-2015 Elliott Hughes <enh@google.com> Remove libpagemap include hack.

Change-Id: I4c75ae4e311342c9ab4f317026904f893e931384
ndroid.mk
12432ca4839b4df9b040b2bd3b4401a48e1f8a06 23-Sep-2015 Elliott Hughes <enh@google.com> am 8d92afe3: Merge "Fix another duplicate maps parser."

* commit '8d92afe32265be8c36ea2adb3c4059298cd583eb':
Fix another duplicate maps parser.
15dfd63aba596f95f2478bfca36b91f69ed7f9b3 23-Sep-2015 Elliott Hughes <enh@google.com> Fix another duplicate maps parser.

Change-Id: Icb69f59ffbd0d5de7f727142260fae152d36a904
thread_test.cpp
tils.h
f599ea9743098a694262b7ab6c3b3d3f11eeb0dd 23-Sep-2015 Elliott Hughes <enh@google.com> am 9e3a2491: Merge "Clean up /proc/<pid>/maps sscanfs."

* commit '9e3a24915241c07d8ea886533c8de6a85744a734':
Clean up /proc/<pid>/maps sscanfs.
9e3a24915241c07d8ea886533c8de6a85744a734 23-Sep-2015 Elliott Hughes <enh@google.com> Merge "Clean up /proc/<pid>/maps sscanfs."
0dec2289211dd75e2dd99e4aad84ece845e69864 23-Sep-2015 Elliott Hughes <enh@google.com> Clean up /proc/<pid>/maps sscanfs.

sscanf will swallow whitespace for us.

Change-Id: I59931cbad00f0144fd33ed4749ac0aaad15e6de6
thread_test.cpp
9583f7e7c2863c63596429ccb23a34fdbf272102 22-Sep-2015 Jorge Lucangeli Obes <jorgelo@google.com> am dd514539: Merge "Add preliminary OEM UID/GID support."

* commit 'dd51453904f609347ce7951661eff8bc12a1c0a4':
Add preliminary OEM UID/GID support.
dd51453904f609347ce7951661eff8bc12a1c0a4 22-Sep-2015 Jorge Lucangeli Obes <jorgelo@google.com> Merge "Add preliminary OEM UID/GID support."
042a61de21296a7c5e4243b1e50ec591d124de98 22-Sep-2015 Yabin Cui <yabinc@google.com> am 3d00f79f: Merge "Increase alternative signal stack size on 64-bit devices."

* commit '3d00f79f98c8b981a36a79657f07a303a2288a55':
Increase alternative signal stack size on 64-bit devices.
3d00f79f98c8b981a36a79657f07a303a2288a55 22-Sep-2015 Yabin Cui <yabinc@google.com> Merge "Increase alternative signal stack size on 64-bit devices."
a39e30141d46c268ca66d6ad786d244275c4e827 22-Sep-2015 Jorge Lucangeli Obes <jorgelo@google.com> Add preliminary OEM UID/GID support.

Until we implement full support for passwd/group files, add a simple
way to use the new OEM UID/GID range (5000-5999).

oem_XXX -> 5000 + XXX iff 0 <= XXX < 1000.

Bug: 23225475

Change-Id: If48b88135d5df538313414f747d6c4c63bf0a103
tubs_test.cpp
d97f422405cfb3f1d6287f879ce828f7195e68d3 22-Sep-2015 Elliott Hughes <enh@google.com> am 822c40a3: Merge "<netinet/udp.h> should include <linux/udp.h>."

* commit '822c40a3389a953d9b43f05ad6e40640fd55f9c4':
<netinet/udp.h> should include <linux/udp.h>.
f8a2243ebeb3ce60e412cd7b71b31c7b31313d58 22-Sep-2015 Elliott Hughes <enh@google.com> <netinet/udp.h> should include <linux/udp.h>.

The comment about "other stuff" referred to pre-uapi headers. Everything
in the current <linux/udp.h> should be exposed to userspace. The only
problem is that BSD and Linux use different names for the members of
struct udphdr. We can move the Linux udphdr out of the way and use an
anonymous union to get the best of both worlds. (Though unfortunately
this means that code that includes <linux/udp.h> directly instead of
using <netinet/udp.h> now won't have any definition of struct udphdr.
We've taken the stance in the past that you shouldn't include a linux/
header if there's a standard equivalent --- you should rely on us
transitively including it for you.)

Change-Id: Ie625892441b0edd8df3b76d3fcf2cbe299077bc4
ndroid.mk
etinet_udp_test.cpp
33ac04a215a70d2f39f1ddec1bba5a42c0fd8bee 22-Sep-2015 Yabin Cui <yabinc@google.com> Increase alternative signal stack size on 64-bit devices.

Bug: 23041777
Bug: 24187462
Change-Id: I7d84c0cc775a74753a3e8e101169c0fb5dbf7437
thread_test.cpp
tack_unwinding_test.cpp
9e3d873036b581b9986f42cc40f2d43f057ed7f1 17-Sep-2015 Josh Gao <jmgao@google.com> am 823cff84: Merge changes I81408ef0,Id0eb8d06

* commit '823cff847b3b202b235ddd84650338f07bc61511':
Implement setjmp cookies on AArch64.
Implement setjmp cookies on ARM.
7fda8d2aa4d24ab400f6f0cb9f792488b634afae 11-Sep-2015 Josh Gao <jmgao@google.com> Implement setjmp cookies on ARM.

Reuse the top bits of _JB_SIGFLAG field previously used to store a
boolean to store a cookie that's validated by [sig]longjmp to make it
harder to use as a ROP gadget. Additionally, encrypt saved registers
with the cookie so that an attacker can't modify a register's value to
a specific value without knowing the cookie.

Bug: http://b/23942752
Change-Id: Id0eb8d06916e89d5d776bfcaa9458f8826717ba3
etjmp_test.cpp
72e678c8a7f78a04dffc57a6b2add45aeee4d1ec 17-Sep-2015 Yabin Cui <yabinc@google.com> am cbd0a15b: Merge "Fix the way to get main thread stack start address."

* commit 'cbd0a15be881abb8ce1feb5b389da2f517a9a4c6':
Fix the way to get main thread stack start address.
569333293aeefbe792826cd59140dc23704018c4 11-Sep-2015 Mor-sarid, Nitzan <nitzan.mor-sarid@intel.com> Fix the way to get main thread stack start address.

For previous way to get the stack using the [stack] string from
/proc/self/task/<pid>/maps is not enough. On x86/x86_64, if an
alternative signal stack is used while a task switch happens,
the [stack] indicator may no longer be correct.

Instead, stack_start from /proc/self/stat which is always inside
the main stack, is used to find the main stack in /proc/self/maps.

Change-Id: Ieb010e71518b57560d541cd3b3563e5aa9660750
Signed-off-by: Nitzan Mor-sarid <nitzan.mor-sarid@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
thread_test.cpp
edc73f6286bcd1f7d0278d25d4484bf23a0e53b2 04-Sep-2015 Elliott Hughes <enh@google.com> am ba9c1705: Merge "linker: don\'t pass dlextinfo to dependent loads"

* commit 'ba9c17053456aed4452a349cf45c5960d9231f25':
linker: don't pass dlextinfo to dependent loads
edfc9f63a261994f2565492436607c04df980e21 03-Sep-2015 Dmitriy Ivanov <dimitry@google.com> linker: don't pass dlextinfo to dependent loads

Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: http://b/23742664
Bug: http://b/20948231
Bug: http://b/20841817
Change-Id: I340ebae1127666d5c6c6f9c6521b89fb93f15bdd
lext_test.cpp
ibs/Android.mk
d3c7f67aed0b5ac0bd7fd03c6925cbaf6b1305ba 02-Sep-2015 Yabin Cui <yabinc@google.com> am 32c85daa: Merge "build bionic gtest runner on mac."

* commit '32c85daa1570e589ce953c42b40fb34cf2b5e989':
build bionic gtest runner on mac.
767fb1c5c685be7a044199a93e0faea2ca88206e 02-Sep-2015 Yabin Cui <yabinc@google.com> build bionic gtest runner on mac.

Change-Id: I39a7e94b6662256646dfaeb8f9ecd5c03cd5fbc6
ndroid.mk
test_main.cpp
b57e9efd40d5765f9ff62f2aa3b6b2ca8523b024 28-Aug-2015 Elliott Hughes <enh@google.com> am c2e634dd: Merge "Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64."

* commit 'c2e634dd303a44b11e30ab31e39ffc4eae5467f8':
Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.
adf5c7237da419393462a19c94c102abf7865c78 27-Aug-2015 Elliott Hughes <enh@google.com> Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.

bionic is built without _FILE_OFFSET_BITS=64, so internally regoff_t
was 32-bit on LP32, but code compiled with _FILE_OFFSET_BITS would
expect rm_so and rm_eo in struct regmatch_t to be 64-bit, leading to
confusion.

Bug: http://b/23566443
Change-Id: Iae92fa545104068e4f64ce1977f5ec616859638c
egex_test.cpp
e7a09ff7d99740c5e74308abc1e209522811b814 27-Aug-2015 Chih-hung Hsieh <chh@google.com> am bfaee4bd: Merge "Add test cases for __emutls_get_address."

* commit 'bfaee4bd6ad901a699df21fd44d95f34e2e7444d':
Add test cases for __emutls_get_address.
c6effb3af6f27c1acfbc2f776bb516e5f4d24476 27-Aug-2015 Elliott Hughes <enh@google.com> am 848808c6: Merge "Add preadv/pwritev."

* commit '848808c660ec4811f4ff5a2748b6f754b008cd21':
Add preadv/pwritev.
bfaee4bd6ad901a699df21fd44d95f34e2e7444d 27-Aug-2015 Chih-hung Hsieh <chh@google.com> Merge "Add test cases for __emutls_get_address."
6f4594d5dc61bb67978c44cd6eeb0e7bfb621c9b 26-Aug-2015 Elliott Hughes <enh@google.com> Add preadv/pwritev.

Bug: http://b/12612572
Change-Id: I38ff2684d69bd0fe3f21b1d371b88fa60d5421cb
ys_uio_test.cpp
83380b5cf05c9db5067c58cb01e67f282ef53b25 14-Aug-2015 Chih-Hung Hsieh <chh@google.com> Add test cases for __emutls_get_address.

BUG: 22984770
Change-Id: I193c3612190260a08f3b3ad8b856c0ae8f94e03d
hread_local_test.cpp
03deb8287b019e9d526b193a0b7fa5e3fa6e8f77 26-Aug-2015 Elliott Hughes <enh@google.com> am 629ed517: Merge "Add strchrnul."

* commit '629ed517126b3be32f2b2e8b710e63358691c296':
Add strchrnul.
7ac3c128bb5df83cb001cb50b6a5ee4da9a0b0e0 26-Aug-2015 Elliott Hughes <enh@google.com> Add strchrnul.

Bug: http://b/18374026
Change-Id: Iea923309c090a51a2d41c5a83320ab3789f40f1c
tring_test.cpp
652480695172d90209e5163e92180a3952fba29a 21-Aug-2015 Yabin Cui <yabinc@google.com> am 62c26ed9: Merge "add fortified implementations of write/pwrite{,64}"

* commit '62c26ed93e76ca9b3dd265f41eb3685ed2e72808':
add fortified implementations of write/pwrite{,64}
62c26ed93e76ca9b3dd265f41eb3685ed2e72808 21-Aug-2015 Yabin Cui <yabinc@google.com> Merge "add fortified implementations of write/pwrite{,64}"
afdd15456ad0c7223c690731f5eb0af54cdb0024 21-Jul-2015 Daniel Micay <danielmicay@gmail.com> add fortified implementations of write/pwrite{,64}

These are just based on the read/pread{,64} implementations with the
function calls and error messages adjusted as appropriate. The only
difference is that the buffer parameters are const.

Change-Id: Ida1597a903807f583f230d74bcedffdb7b24fcf6
ortify_compilation_test.cpp
ortify_test.cpp
2bcb25c1c3153a28229bffcdd4d289ac72b987cc 11-Aug-2015 Yabin Cui <yabinc@google.com> am 0660be89: am a6a12a78: am 0fdcdd00: Merge "Fix flaky test time.timer_settime_0." into lollipop-mr1-cts-dev

* commit '0660be899f2d907dedbcb643315b73e652ec9510':
Fix flaky test time.timer_settime_0.
0660be899f2d907dedbcb643315b73e652ec9510 11-Aug-2015 Yabin Cui <yabinc@google.com> am a6a12a78: am 0fdcdd00: Merge "Fix flaky test time.timer_settime_0." into lollipop-mr1-cts-dev

* commit 'a6a12a7804402273e193074a58162cc0b3890812':
Fix flaky test time.timer_settime_0.
a6a12a7804402273e193074a58162cc0b3890812 11-Aug-2015 Yabin Cui <yabinc@google.com> am 0fdcdd00: Merge "Fix flaky test time.timer_settime_0." into lollipop-mr1-cts-dev

* commit '0fdcdd0067af88e7deef73070d0861ceb9f53c37':
Fix flaky test time.timer_settime_0.
bf572d91b50f818a7c3e29340cccf1931939ff8b 11-Aug-2015 Yabin Cui <yabinc@google.com> Fix flaky test time.timer_settime_0.

It fixes the problem reported in https://code.google.com/p/android/issues/detail?id=182395.

Change-Id: Ie16aa04095dac08a62dd0d4c50e763b36526624c
ime_test.cpp
ee8576d11413c7b9d42f466fb378921b4cdb01f3 11-Aug-2015 Dan Albert <danalbert@google.com> am a3c01467: Merge "Move up to C++14."

* commit 'a3c01467ecf31cab1410ce7b8554e2e77dae3309':
Move up to C++14.
5341691955e2fc2b271b722c37496d72a0e8c683 11-Aug-2015 Dan Albert <danalbert@google.com> Move up to C++14.

The default standard version is now ahead of us. Stop specifying C++11
so we get that too.

Change-Id: Ic96942cd7fd134118e29b744601b0119e49b6ac4
ndroid.mk
ibs/Android.mk
c23143a5fdd32a1cc0ca0efdb435d9f46b596113 11-Aug-2015 Yabin Cui <yabinc@google.com> am ff4afc13: Merge "Omit comment when reading --gtest_list_tests option\'s output."

* commit 'ff4afc136ef5d00d33a611e7bc1950249db9fbcf':
Omit comment when reading --gtest_list_tests option's output.
ff4afc136ef5d00d33a611e7bc1950249db9fbcf 11-Aug-2015 Yabin Cui <yabinc@google.com> Merge "Omit comment when reading --gtest_list_tests option's output."
23e0bdf7d4476399c04557396e288ad21938e65f 10-Aug-2015 Elliott Hughes <enh@google.com> am 182b91f6: Merge "Invalidate cached pid in vfork."

* commit '182b91f62809b03870f561a88135f5453966fe41':
Invalidate cached pid in vfork.
bf830ade7f4d45ab884b8c56631db7d7b4b5c077 10-Aug-2015 Yabin Cui <yabinc@google.com> Omit comment when reading --gtest_list_tests option's output.

Gtest add comments when listing typed tests. And we should omit them.

Bug: 23040880
Change-Id: If6034af301337fc06eeab294d2dbe5317a6b7f91
test_main.cpp
5891abdc66aa9578395bc8b8e5740f629a2694b7 08-Aug-2015 Elliott Hughes <enh@google.com> Invalidate cached pid in vfork.

Bug: http://b/23008979
Change-Id: I1dd900ac988cdbe10aad3abc53240c5d352891d5
nistd_test.cpp
993a2bee84e25604e7ef8c1d386e7cd3904627e0 01-Aug-2015 Yabin Cui <yabinc@google.com> am 7e919dae: Merge "add a fortified implementation of getcwd"

* commit '7e919daeaad62515ebbbf7b06badc77625a14d90':
add a fortified implementation of getcwd
9101b00400cfb20b96112682169c5da67e065ff2 20-May-2015 Daniel Micay <danielmicay@gmail.com> add a fortified implementation of getcwd

Change-Id: Ice3e6d3e1ff07788305dc85f8ee4059baad5fac4
ortify_compilation_test.cpp
ortify_test.cpp
9d7c6a7e570a8b91a094f0df4407b5624b469730 31-Jul-2015 Elliott Hughes <enh@google.com> am 61c21b63: Merge "Revert "add a fortified implementation of getcwd""

* commit '61c21b63bc1602bce8685757fb1c2a788cc9eb8d':
Revert "add a fortified implementation of getcwd"
4c43aac9a5db6de1e34fdab652dab01b32141718 31-Jul-2015 Elliott Hughes <enh@google.com> Revert "add a fortified implementation of getcwd"

This reverts commit 89a121d43a274131cf9f84b0e685bebf1e70cc1b.

Change-Id: Ib6f6fd424acea68a063777e9f324405450e23316
ortify_compilation_test.cpp
ortify_test.cpp
4279bac26a15b69a85d3d98a57ff7094b579f207 31-Jul-2015 Yabin Cui <yabinc@google.com> am 442a3fca: Merge "add a fortified implementation of getcwd"

* commit '442a3fcae68152a95ef481ef99932d1bc001dc08':
add a fortified implementation of getcwd
89a121d43a274131cf9f84b0e685bebf1e70cc1b 20-May-2015 Daniel Micay <danielmicay@gmail.com> add a fortified implementation of getcwd

Change-Id: I95001ae4fe8f206db83e5c44d129ba11310695ce
ortify_compilation_test.cpp
ortify_test.cpp
c9bee108050ab367953f8f1d9cb73e837c1d06df 28-Jul-2015 Elliott Hughes <enh@google.com> am 4955cde2: Merge "Add a regression test for a fixed strnlen bug."

* commit '4955cde2c55d4860f12039a96d14fc756b1308a3':
Add a regression test for a fixed strnlen bug.
d2a9fb326769900b786ef36aa0ccf60a65fe497e 28-Jul-2015 Elliott Hughes <enh@google.com> Add a regression test for a fixed strnlen bug.

Bug: https://code.google.com/p/android/issues/detail?id=74741
Change-Id: I78b0114bdbe8e680b0e938af608a634e73c86eda
tring_test.cpp
c11758f2c9ff88d069c1fa22be5165220a07dc5c 28-Jul-2015 Chih-hung Hsieh <chh@google.com> am cebef1a7: Merge "Add one simple thread local storage test."

* commit 'cebef1a7812fe3552f12dd7e885a1f879a9946ed':
Add one simple thread local storage test.
cebef1a7812fe3552f12dd7e885a1f879a9946ed 28-Jul-2015 Chih-hung Hsieh <chh@google.com> Merge "Add one simple thread local storage test."
7656d0cec0509f73705da222a2389b00031097d8 27-Jul-2015 Chih-Hung Hsieh <chh@google.com> Add one simple thread local storage test.

This test should pass with gcc and fail with clang,
until clang/llvm supports emutls or Android linker supports
ELF TLS models.

BUG: 21082792
Change-Id: Id8c97da52c68ec230c7d26af703f6ed32d53a4fe
ndroid.mk
hread_local_test.cpp
0e63c39cca56ae1d2b5877b6ffced3c6a4ca312b 28-Jul-2015 Yabin Cui <yabinc@google.com> am 8af32633: Merge "add fortified implementations of fread/fwrite"

* commit '8af32633498184e58e6f8d5d75b9f9cdbef5b6be':
add fortified implementations of fread/fwrite
8af32633498184e58e6f8d5d75b9f9cdbef5b6be 28-Jul-2015 Yabin Cui <yabinc@google.com> Merge "add fortified implementations of fread/fwrite"
7835c65ca777cd88b9ec656d780a7a48b591467f 25-Jul-2015 Elliott Hughes <enh@google.com> am adc5795f: Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)."

* commit 'adc5795fb7b674e6d40d1f190c675607c1379343':
Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).
189394b885e4b11e9f009fd2e434e6dc6696277b 25-Jul-2015 Elliott Hughes <enh@google.com> Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).

Bug: http://b/18342333
Change-Id: Id12ed4e85a0f35d7d27202f7792df42a65a74b4e
nistd_test.cpp
fed2659869ec41a93f655be8058568ddab419e01 18-Jul-2015 Daniel Micay <danielmicay@gmail.com> add fortified implementations of fread/fwrite

A __size_mul_overflow utility is used to take advantage of the checked
overflow intrinsics in Clang and GCC (>= 5). The fallback for older
compilers is the optimized but less than ideal overflow checking pattern
used in OpenBSD.

Change-Id: Ibb0d4fd9b5acb67983e6a9f46844c2fd444f7e69
ortify_compilation_test.cpp
ortify_test.cpp
c0c9704e1128bcc1e172e23032b63b7b31c75283 23-Jul-2015 Yabin Cui <yabinc@google.com> am 2565492d: Merge "Add getgrgid_r/getgrnam_r."

* commit '2565492db0d67b95348cd1c3026ed338ca59aa37':
Add getgrgid_r/getgrnam_r.
2565492db0d67b95348cd1c3026ed338ca59aa37 22-Jul-2015 Yabin Cui <yabinc@google.com> Merge "Add getgrgid_r/getgrnam_r."
c4786d366b11ed81165d43ee7f23e0d4965fc00f 21-Jul-2015 Yabin Cui <yabinc@google.com> Add getgrgid_r/getgrnam_r.

Bug: 22568551
Change-Id: I3c0772d119d6041063c6be53f5bcc5ea1768f0d5
tubs_test.cpp
361d4b4c87da4b40cb613ed39d42cf303f0e8d3b 21-Jul-2015 Ying Wang <wangying@google.com> We don't have CXX_BARE any more

Now we have split CXX_WRAPPER from TARGET_CXX and CXX_BARE isn't needed
any more.

Bug: 22612634
Change-Id: I52c78b0d1b325910e875a786d17f780731778b4b
(cherry-pick from commit 9d11a7087c860195bf23f2825a7fe70d43ff7b78)
ndroid.mk
40e2b72fb30cd0aace5b85185e1d0989c9ff2e1a 21-Jul-2015 Ying Wang <wangying@google.com> am e39b279b: Merge "We don\'t have CXX_BARE any more" into mnc-dev

* commit 'e39b279bb4971d0c3322214ea977275f1bc58c0b':
We don't have CXX_BARE any more
9d11a7087c860195bf23f2825a7fe70d43ff7b78 21-Jul-2015 Ying Wang <wangying@google.com> We don't have CXX_BARE any more

Now we have split CXX_WRAPPER from TARGET_CXX and CXX_BARE isn't needed
any more.

Bug: 22612634
Change-Id: I52c78b0d1b325910e875a786d17f780731778b4b
ndroid.mk
8bdf8ab97c59f6c0a0152d923dcb668681e4e031 20-Jul-2015 Dmitriy Ivanov <dimitry@google.com> am e70d7a78: Merge "Fix dt_runpath test."

* commit 'e70d7a78f0bfba8b09d37c145769cb8d1d7c5fb6':
Fix dt_runpath test.
3fef96f827bb4aebed08e48a1a760e0280029efd 20-Jul-2015 Dmitriy Ivanov <dimitry@google.com> Fix dt_runpath test.

Bfd linker produces DT_RPATH instead of DT_RUNPATH
unless --enable-new-dtags option is specified.

Bug: http://b/22560945
Change-Id: I71bdc5137b899ab736e55c5a9574cfbba8e1983b
ibs/Android.build.dt_runpath.mk
a89821abe3f2f3e763a95ac1e8e330fbbbca4996 15-Jul-2015 Yabin Cui <yabinc@google.com> am 60a11dcb: Merge "Add test for an Android kernel bug about prctl."

* commit '60a11dcb44992f610e696fc246c70731012080dd':
Add test for an Android kernel bug about prctl.
91ce715af1a1a22f6b29f1218843f29a4d0b0e0b 14-Jul-2015 Yabin Cui <yabinc@google.com> Add test for an Android kernel bug about prctl.

Bug: 20017123

Change-Id: I8c109a06999a8bffcc8e8298b04ee637bb67d878
ndroid.mk
ys_prctl_test.cpp
fcd017148ba7ecf181f2f4065437c01c1c66cd4e 10-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> am d1e10d7d: Merge "Use delete[] to de-allocate pointers from new[]"

* commit 'd1e10d7d168a8461d9eb47e48802ea11d8bd0640':
Use delete[] to de-allocate pointers from new[]
d1e10d7d168a8461d9eb47e48802ea11d8bd0640 10-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Merge "Use delete[] to de-allocate pointers from new[]"
4d44675283e6c92d3294592be4fce7c9d89c19b6 09-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Use delete[] to de-allocate pointers from new[]

Upstream clang has a new diagnostic, '-Wmismatched-new-delete' to
generate a warning (that becomes an error with -Werror) when delete is
used to deallocate pointers created with 'new[]'. This patch fixes
'delete's that trigger this warning/error.

Change-Id: Id7b6f6c2df3e860e576de55e2f61f3d2be3a3986
uffer_tests.cpp
b4f5d6d89471ffc4cd5f528e95b4fbf869c339d5 08-Jul-2015 Evgenii Stepanov <eugenis@google.com> am 33ef6c20: Merge "Respect caller DT_RUNPATH in dlopen()."

* commit '33ef6c20f2ddf19b29ed3a4e50139fa391b1a3d4':
Respect caller DT_RUNPATH in dlopen().
33ef6c20f2ddf19b29ed3a4e50139fa391b1a3d4 08-Jul-2015 Evgenii Stepanov <eugenis@google.com> Merge "Respect caller DT_RUNPATH in dlopen()."
0cdef7e7f3c6837b56a969120d9098463d1df8d8 07-Jul-2015 Evgenii Stepanov <eugenis@google.com> Respect caller DT_RUNPATH in dlopen().

When dlopen-ing a library, add the caller's DT_RUNPATH to the directory search
list. This fixes dlfcn.dt_runpath in bionic-unit-tests-glibc(32|64).

Bug: 21899363
Change-Id: Ife6a7e192939292cf4dc291b7e6b95945761cde3
lfcn_test.cpp
7830dcf1b54cf5e9db1d26042bc618ed1ef2ef7a 01-Jul-2015 Dmitriy Ivanov <dimitry@google.com> am 416695a7: Merge "Improve personality initialization"

* commit '416695a75c3892dd709a80ea8a640da07082594e':
Improve personality initialization
c2247478d5bcd6e8fe4d2b58f0bdeff73daa4c80 01-Jul-2015 Dmitriy Ivanov <dimitry@google.com> Improve personality initialization

1. Personality parameter should be unsigned int (not long)
2. Do not reset bits outside of PER_MASK when setting
personality value.
3. Set personality for static executables.

Bug: http://b/21900686
Change-Id: I4c7e34079cbd59b818ce221eed325c05b9bb2303
(cherry picked from commit f643eb38c36eb63f612e20dea09fd43ac6a6b360)
ys_personality_test.cpp
f643eb38c36eb63f612e20dea09fd43ac6a6b360 01-Jul-2015 Dmitriy Ivanov <dimitry@google.com> Improve personality initialization

1. Personality parameter should be unsigned int (not long)
2. Do not reset bits outside of PER_MASK when setting
personality value.
3. Set personality for static executables.

Bug: http://b/21900686
Change-Id: I4c7e34079cbd59b818ce221eed325c05b9bb2303
ys_personality_test.cpp
168ebad960c230441a23cfbdd1e82cdf5e9c8aa9 29-Jun-2015 Dmitriy Ivanov <dimitry@google.com> am 46d24d12: Merge "Replace NULL with nullptr"

* commit '46d24d12e167a0b5afa4ded218aa4db0a477141a':
Replace NULL with nullptr
46d24d12e167a0b5afa4ded218aa4db0a477141a 29-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Replace NULL with nullptr"
4ab0edac1a0ba21be56c46ee349efd8e7d0dfadc 24-Jun-2015 Chih-Hung Hsieh <chh@google.com> am d807b9a1: Merge "Use gcc to build and test x86_64 long double code."

* commit 'd807b9a12d3e49132b095df3d883618452033b51':
Use gcc to build and test x86_64 long double code.
d807b9a12d3e49132b095df3d883618452033b51 24-Jun-2015 Chih-Hung Hsieh <chh@google.com> Merge "Use gcc to build and test x86_64 long double code."
e79d06b0e852c5ae854bb27de9c9de7f29b4343d 23-Jun-2015 Chih-Hung Hsieh <chh@google.com> Use gcc to build and test x86_64 long double code.

Clang/llvm x86_64 configuration of long double is still
incompatible with gcc.
https://llvm.org/bugs/show_bug.cgi?id=23897

BUG: 21899249
Change-Id: I47fd6d0ce2daa84ae0035e7885a4d90e4c3056f7
ndroid.mk
0a9df9a13ec86e61b8cb8a3206ddb19e5c4a4ef4 24-Jun-2015 Dmitriy Ivanov <dimitry@google.com> am af6ee5b5: Merge "Work around compiler optimization"

* commit 'af6ee5b5bc446ef5a6f2bf41bc4f2e13657978be':
Work around compiler optimization
aff18fd60804e177c319d04dd4c12f3ee1c0cba8 23-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Replace NULL with nullptr

Change-Id: If66d0c5ae1ea1ed371b44e067d4ae59ac54a8842
lfcn_test.cpp
7d09a8cd114751f88bf0d03f0f2e8f87a4a5ed9a 23-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Work around compiler optimization

This makes bionic-unit-test-glibc64 behave consistently
when testing dlopen from a library with dt_runpath.

Bug: http://b/21899363
Change-Id: I9d446eb6852876975874d6b7761f6f81cc4e9916
ibs/dlopen_b.cpp
c29626c12a4b408c6b9362bc4ede569599340bea 22-Jun-2015 Dmitriy Ivanov <dimitry@google.com> am 13cee57d: Merge "Remove libdl* tests from bionic-unit-tests-static"

* commit '13cee57dee4ebd14b57e7b5acd372228eb9c4a37':
Remove libdl* tests from bionic-unit-tests-static
96ebdcdca0a834ffbf75bbe2ab66e75c5cf6ecd6 22-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Remove libdl* tests from bionic-unit-tests-static

Bug: http://b/21900592
Change-Id: I907cc15684b121ec2fbdeca49fc584bb6d2eaacc
(cherry picked from commit de4e27e231143e4e1982b4ca9effd03c1ca12d86)
ndroid.mk
de4e27e231143e4e1982b4ca9effd03c1ca12d86 22-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Remove libdl* tests from bionic-unit-tests-static

Bug: http://b/21900592
Change-Id: I907cc15684b121ec2fbdeca49fc584bb6d2eaacc
ndroid.mk
1df44bd0a4392ae87593d010817e25faded83551 19-Jun-2015 Yabin Cui <yabinc@google.com> am cb060759: am 8beb0c34: am b245bc75: am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev

* commit 'cb0607590341ed2512a55015e66e19e7f7db3723':
Fix flaky test of timer_create_multiple in L.
cb0607590341ed2512a55015e66e19e7f7db3723 19-Jun-2015 Yabin Cui <yabinc@google.com> am 8beb0c34: am b245bc75: am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev

* commit '8beb0c34da46a5146a2de8256db8bb42febb283c':
Fix flaky test of timer_create_multiple in L.
8beb0c34da46a5146a2de8256db8bb42febb283c 19-Jun-2015 Yabin Cui <yabinc@google.com> am b245bc75: am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev

* commit 'b245bc750021ce6d220e71625fca66620cdd1f05':
Fix flaky test of timer_create_multiple in L.
d1ade7ce0237089d0e44eb2bee0691e4814d1289 19-Jun-2015 Yabin Cui <yabinc@google.com> Don't use TIMER_ABSTIME in time_test.

If TIMER_ABSTIME is used in timer_settime(), the timer is always fired
immediately, which is not the intent of the tests.

Change-Id: I76047dbeb2bdded272ee6d028630b53bfd7d8514
ime_test.cpp
410c1adf5fececb0149b7b65fde3130327ff24c8 19-Jun-2015 Yabin Cui <yabinc@google.com> Fix flaky test of timer_create_multiple in L.

Bug: 20677618
Change-Id: I0cb5faf77edce042b10611543180f3e2e73d3d05
ime_test.cpp
11ea08c5cbc47db16f6c024338fbe9f6f456ce80 16-Jun-2015 Dan Albert <danalbert@google.com> Use new sanitizer option.

Change-Id: I21b04a1f3be3b10ee557bf9e0caa5db638686364
ndroid.build.mk
cce405a134c338ff6b76c56aafe02ef73c93a38c 04-Mar-2015 Dan Albert <danalbert@google.com> Add a sys/procfs.h.

Needed for building gdbserver out of the box.

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: Ieadda2b595f08bfddfa61fcd68006b8e7c1a438d
(cherry picked from commit bf18c61798d1ae9197ae087ed85e94eef55e8678)
ndroid.mk
ys_procfs_test.cpp
333bdad361b566df2d9d2d5968fb23e8d3983019 16-Jun-2015 Elliott Hughes <enh@google.com> Merge "Add a sys/procfs.h."
bf18c61798d1ae9197ae087ed85e94eef55e8678 04-Mar-2015 Dan Albert <danalbert@google.com> Add a sys/procfs.h.

Needed for building gdbserver out of the box.

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: Ieadda2b595f08bfddfa61fcd68006b8e7c1a438d
ndroid.mk
ys_procfs_test.cpp
ae1e75458ad281f121116c8c5dfe9d8086e43a2b 11-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Make path to apk compliant with jar url format" into mnc-dev
402a75060dcd194c1991a15df2aba51f0d868ac3 09-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Make path to apk compliant with jar url format

Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
(cherry picked from commit 524f1f1efe0cb32714c61e26f21701ac952b9e42)
lext_test.cpp
25ac753f474492ffa3625ca6b5aae254bb205c33 11-Jun-2015 Elliott Hughes <enh@google.com> Add process_vm_readv and process_vm_writev.

Bug: http://b/21761353
Change-Id: Ic8ef3f241d62d2a4271fbc783c8af50257bac498
(cherry picked from commit be57a40d2973739c4fb0aa1cfb0014f34aeec2bd)
ndroid.mk
ys_uio_test.cpp
c910de9d5e6ff5c00356883fb567227ab04e0389 11-Jun-2015 Elliott Hughes <enh@google.com> Merge "Add process_vm_readv and process_vm_writev."
be57a40d2973739c4fb0aa1cfb0014f34aeec2bd 11-Jun-2015 Elliott Hughes <enh@google.com> Add process_vm_readv and process_vm_writev.

Bug: http://b/21761353
Change-Id: Ic8ef3f241d62d2a4271fbc783c8af50257bac498
ndroid.mk
ys_uio_test.cpp
bd3b961186b0616a13c4c28abd484e0bd6ee017c 11-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Fix application_sdk_versions_smoke test

Bug: http://b/21364029
Change-Id: I9716d6b0ea7fae6483629a290dbe695b68526588
(cherry picked from commit 79b3877a137510946ddd39ab71c0badf1a769c11)
ibdl_test.cpp
79b3877a137510946ddd39ab71c0badf1a769c11 11-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Fix application_sdk_versions_smoke test

Bug: http://b/21364029
Change-Id: I9716d6b0ea7fae6483629a290dbe695b68526588
ibdl_test.cpp
6865082ca6d887766c6651ed2d079dca56a99d32 10-Jun-2015 Evgenii Stepanov <eugenis@google.com> Support DT_RUNPATH in the linker.

Only $ORIGIN substitution is supported, but not linux-specific $LIB
or $PLATFORM.

Change-Id: I5814a016c7c91afba080230a547a863686e7c2b9
ndroid.build.mk
lfcn_test.cpp
ibs/Android.build.dt_runpath.mk
ibs/Android.mk
ibs/dlopen_b.cpp
60907c7f4ec788def8741e4efb933eafb6560eaa 10-Jun-2015 Christopher Ferris <cferris@google.com> Allow NULL in pthread_mutex_lock/unlock.

The pthread_mutex_lock and pthread_mutex_unlock were allowed to
fail silently on L 32 bit devices when passed a NULL. We changed
this to a crash on 32 bit devices, but there are still games that make
these calls and are not likely to be updated. Therefore, once again
allow NULL to be passed in on 32 bit devices.

Bug: 19995172
(cherry picked from commit 511cfd9dc8cb41bca4920687c7d816ee916ee8e5)

Change-Id: I159a99a941cff94297ef3fffda7075f8ef1ae252
thread_test.cpp
511cfd9dc8cb41bca4920687c7d816ee916ee8e5 10-Jun-2015 Christopher Ferris <cferris@google.com> Allow NULL in pthread_mutex_lock/unlock.

The pthread_mutex_lock and pthread_mutex_unlock were allowed to
fail silently on L 32 bit devices when passed a NULL. We changed
this to a crash on 32 bit devices, but there are still games that make
these calls and are not likely to be updated. Therefore, once again
allow NULL to be passed in on 32 bit devices.

Bug: 19995172
Change-Id: If7e8860075ecd63c0064d80f64e226fad7bd3c26
thread_test.cpp
524f1f1efe0cb32714c61e26f21701ac952b9e42 09-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Make path to apk compliant with jar url format

Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
lext_test.cpp
e1d0810cd7e2aa045d5cc1e7d2b8697acd8467be 06-Jun-2015 Nick Kralevich <nnk@google.com> Add O_PATH support for flistxattr()

A continuation of commit 2825f10b7f61558c264231a536cf3affc0d84204.

Add O_PATH compatibility support for flistxattr(). This allows
a process to list out all the extended attributes associated with
O_PATH file descriptors.

Change-Id: Ie2285ac7ad2e4eac427ddba6c2d182d41b130f75
ys_xattr_test.cpp
ea248d9ca80d4ef731d821648711094aa03b0318 03-Jun-2015 Yabin Cui <yabinc@google.com> Merge "Make sys_resource test more robust." into lollipop-cts-dev
automerge: 492a0bf

* commit '492a0bf212973baa1c33d584d57e75395774447f':
Make sys_resource test more robust.
e7ece90b5036a56241c268861bb0dea87aa856b7 05-Jan-2015 Yabin Cui <yabinc@google.com> Make sys_resource test more robust.

Bug: 19482626

"ulimit -c xxx" command may run before bionic-unit-tests.
Make sure sys_resource test fails gently in that case.

Change-Id: Ic3b5ed8b20acba56df8c5ef082c88e5050e761aa
(cherry picked from commit 4853f40f3fb6664cb1b7af97b6b3e795717026b1)
ys_resource_test.cpp
c92f9f8069f567ad2c2557e2ef56e13de4bf8713 31-May-2015 Nick Kralevich <nnk@google.com> libc: Add O_PATH support for fgetxattr / fsetxattr

Support O_PATH file descriptors when handling fgetxattr and fsetxattr.
This avoids requiring file read access to pull extended attributes.

This is needed to support O_PATH file descriptors when calling
SELinux's fgetfilecon() call. In particular, this allows the querying
and setting of SELinux file context by using something like the following
code:

int dirfd = open("/path/to/dir", O_DIRECTORY);
int fd = openat(dirfd, "file", O_PATH | O_NOFOLLOW);
char *context;
fgetfilecon(fd, &context);

This change was motivated by a comment in
https://android-review.googlesource.com/#/c/152680/1/toys/posix/ls.c

(cherrypicked from commit 2825f10b7f61558c264231a536cf3affc0d84204)

Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
ndroid.mk
ys_xattr_test.cpp
c4ebe60e1a2fc165ff11442765325628e27f2a05 30-May-2015 Dmitriy Ivanov <dimitry@google.com> Fix dlsym(handle_of_main_executable, ...)

According to man dlopen(3) and posix docs in the case when si is handle
of the main executable we need to search not only in the executable and its
dependencies but also in all libraries loaded with RTLD_GLOBAL.

see also: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlopen.html

Bug: http://b/21528224
Bug: http://b/17512583
Bug: https://code.google.com/p/android/issues/detail?id=173822
Change-Id: Ib2801367ba48b6f3704da89a6d9f5e6911430013
(cherry picked from commit f439b5a3186ca0fef1092f45770abc716da9d87a)
lfcn_test.cpp
ibs/Android.mk
ef55f967234f160a4e00a51ca53377fadd17715d 02-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Fix dlsym(handle_of_main_executable, ...)"
2825f10b7f61558c264231a536cf3affc0d84204 31-May-2015 Nick Kralevich <nnk@google.com> libc: Add O_PATH support for fgetxattr / fsetxattr

Support O_PATH file descriptors when handling fgetxattr and fsetxattr.
This avoids requiring file read access to pull extended attributes.

This is needed to support O_PATH file descriptors when calling
SELinux's fgetfilecon() call. In particular, this allows the querying
and setting of SELinux file context by using something like the following
code:

int dirfd = open("/path/to/dir", O_DIRECTORY);
int fd = openat(dirfd, "file", O_PATH | O_NOFOLLOW);
char *context;
fgetfilecon(fd, &context);

This change was motivated by a comment in
https://android-review.googlesource.com/#/c/152680/1/toys/posix/ls.c

Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
ndroid.mk
ys_xattr_test.cpp
f439b5a3186ca0fef1092f45770abc716da9d87a 30-May-2015 Dmitriy Ivanov <dimitry@google.com> Fix dlsym(handle_of_main_executable, ...)

According to man dlopen(3) and posix docs in the case when si is handle
of the main executable we need to search not only in the executable and its
dependencies but also in all libraries loaded with RTLD_GLOBAL.

see also: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlopen.html

Bug: http://b/21528224
Bug: http://b/17512583
Bug: https://code.google.com/p/android/issues/detail?id=173822
Change-Id: Ib2801367ba48b6f3704da89a6d9f5e6911430013
lfcn_test.cpp
ibs/Android.mk
c5e02eeb353c3cdd357413f563701d5018fc76a5 01-Jun-2015 Dan Albert <danalbert@google.com> Cleanup ftruncate negative test.

Addresses post-submit comments from
I54692ab8105dd09db6af7a2c0894a17bdd118aa0.

Bug: http://b/21309901
Change-Id: Ie19ee8cdcc4055a65fe7dfc103156e54eafe8977
(cherry picked from commit 9d476a02e9a14e847669a6683c585028175aa322)
nistd_test.cpp
9d476a02e9a14e847669a6683c585028175aa322 01-Jun-2015 Dan Albert <danalbert@google.com> Cleanup ftruncate negative test.

Addresses post-submit comments from
I54692ab8105dd09db6af7a2c0894a17bdd118aa0.

Bug: http://b/21309901
Change-Id: Ie19ee8cdcc4055a65fe7dfc103156e54eafe8977
nistd_test.cpp
5f3e19dbbeb851fff5cf7f9869d344feca479413 20-May-2015 Dan Albert <danalbert@google.com> Fix error handling for negative size in ftruncate.

Bug: 21309901
Change-Id: I54692ab8105dd09db6af7a2c0894a17bdd118aa0
(cherry picked from commit c05554ec5c9aff5e0f1e83de9bb62c3569eecca2)
nistd_test.cpp
d8ead18145cba98fdc7256f9a0e69b8c1c90cd1c 22-May-2015 Dmitriy Ivanov <dimitry@google.com> Add functions to provide target sdk version

Bug: http://b/21364029
Change-Id: I8648d1bff6c8fd6e7cd12da7f128e048b9f2829a
(cherry picked from commit 79fd668bb4ddb22432eeda2ebd8d10359013d9a8)
ndroid.mk
ibdl_test.cpp
79fd668bb4ddb22432eeda2ebd8d10359013d9a8 22-May-2015 Dmitriy Ivanov <dimitry@google.com> Add functions to provide target sdk version

Bug: http://b/21364029
Change-Id: I8648d1bff6c8fd6e7cd12da7f128e048b9f2829a
ndroid.mk
ibdl_test.cpp
ffe01a3de62d17cbe1cdf3b40a91d1ac9a9d36b5 21-May-2015 Dan Albert <danalbert@google.com> Merge "Fix error handling for negative size in ftruncate."
c15a935202319a41ee0be94afcdbde1d07568ec8 20-May-2015 Yabin Cui <yabinc@google.com> am fd20a8c2: resolved conflicts for merge of 473d96c0 to lmp-mr1-ub-dev

* commit 'fd20a8c2d669b3f2d63e2d33a32b90d1b7f17b82':
Fix timer flaky test in lollipop-mr1-cts-dev.
b0c6f2dba2dc7b1604e00d0d553ac7f38f719049 20-May-2015 Yabin Cui <yabinc@google.com> Fix pthread_attr_getstack__main_thread failure on glibc.

Move test of bionic specific implementation into bionic ifdef.

Bug: 19805726
Change-Id: Idf369b16e7f41f060c75b0aaf34e05cf3c161aa9
thread_test.cpp
c05554ec5c9aff5e0f1e83de9bb62c3569eecca2 20-May-2015 Dan Albert <danalbert@google.com> Fix error handling for negative size in ftruncate.

Bug: 21309901
Change-Id: I54692ab8105dd09db6af7a2c0894a17bdd118aa0
nistd_test.cpp
fd20a8c2d669b3f2d63e2d33a32b90d1b7f17b82 20-May-2015 Yabin Cui <yabinc@google.com> resolved conflicts for merge of 473d96c0 to lmp-mr1-ub-dev

Change-Id: I48269218b152054d527d9257d40490b54205140f
2b5c2285c0679190b90b954d5e71f7ee8698adba 08-May-2015 Yabin Cui <yabinc@google.com> Remove pthread_detach_no_leak test.

This test has lost its purpose as we are using mmap/munmap for pthread_internal_t. And it is a flaky test.

Bug: 21205574
Bug: 20860440
Change-Id: I7cbb6bc3fd8a2ca430415beab5ee27a856ce4ea7
(cherry picked from commit 2957cc5f1043adf0b9c0f1cdfff2d408952e40f5)
thread_test.cpp
ff407803dbbee26ab19c02aaece0e75c019534c4 15-May-2015 Dmitriy Ivanov <dimitry@google.com> Remove -z global workaround for target x86

Change-Id: I08e75a1c7437c97e4af59316d2c14c7fa3f65e03
(cherry picked from commit 933332462d37dfa121fa691095cdce218a0139bf)
ibs/Android.mk
933332462d37dfa121fa691095cdce218a0139bf 15-May-2015 Dmitriy Ivanov <dimitry@google.com> Remove -z global workaround for target x86

Change-Id: I08e75a1c7437c97e4af59316d2c14c7fa3f65e03
ibs/Android.mk
4bac6ea463a8f20793f5c1425965729ded1419fe 12-May-2015 Dmitriy Ivanov <dimitry@google.com> Improved dlsym tests and fixes to linker

Answers the question: what if dependent library
was preloaded with RTLD_LOCAL flag.

Also add test for RTLD_NEXT within local_group.

Bug: http://b/17512583
Change-Id: I79e081e68b3a8c0ed8980d4275a06515fea94ec9
(cherry picked from commit 697bd9fd38ab078a117ad9a5777cf286c467b9b9)
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_from_this.cpp
ibs/dlsym_from_this_functions.cpp
ibs/dlsym_from_this_symbol.cpp
ibs/dlsym_from_this_symbol2.cpp
697bd9fd38ab078a117ad9a5777cf286c467b9b9 12-May-2015 Dmitriy Ivanov <dimitry@google.com> Improved dlsym tests and fixes to linker

Answers the question: what if dependent library
was preloaded with RTLD_LOCAL flag.

Also add test for RTLD_NEXT within local_group.

Bug: http://b/17512583
Change-Id: I79e081e68b3a8c0ed8980d4275a06515fea94ec9
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_from_this.cpp
ibs/dlsym_from_this_functions.cpp
ibs/dlsym_from_this_symbol.cpp
ibs/dlsym_from_this_symbol2.cpp
5c0996a96970eb7cf93d3203313a2532c119f1a7 08-May-2015 Yabin Cui <yabinc@google.com> Fix timer flaky test in lollipop-mr1-cts-dev.

It is partically cherry-pick from https://android-review.googlesource.com/#/c/123410/.
And as lollipop-mr1-cts-dev still uses stlport, <stdatomic.h> is used instead of <atomic>.

Bug: 20677618
Change-Id: I952a6fd074facc4227c955fecf3ecbfbbaec4193
ime_test.cpp
f9eeea6d6531b0dea837027c7e1f47bec837f311 08-May-2015 Yabin Cui <yabinc@google.com> Merge "Remove pthread_detach_no_leak test."
2957cc5f1043adf0b9c0f1cdfff2d408952e40f5 08-May-2015 Yabin Cui <yabinc@google.com> Remove pthread_detach_no_leak test.

This test has lost its purpose as we are using mmap/munmap for pthread_internal_t. And it is a flaky test.

Bug: 20860440
Change-Id: I7cbb6bc3fd8a2ca430415beab5ee27a856ce4ea7
thread_test.cpp
a60fd09e2692e17c8bfa210d3cb64b490aea4c9d 06-May-2015 Dmitriy Ivanov <dimitry@google.com> Move pthread_atfork_dlclose test out of static lib

Bug: http://b/20858755
Change-Id: I0d84e8b43dc33902d75af18db6b7c8e0b619d718
(cherry picked from commit 5624a6a1e52ff959b0f88765d38f190700422773)
ndroid.mk
thread_dlfcn_test.cpp
thread_test.cpp
5624a6a1e52ff959b0f88765d38f190700422773 06-May-2015 Dmitriy Ivanov <dimitry@google.com> Move pthread_atfork_dlclose test out of static lib

Bug: http://b/20858755
Change-Id: I0d84e8b43dc33902d75af18db6b7c8e0b619d718
ndroid.mk
thread_dlfcn_test.cpp
thread_test.cpp
64a869880921b7e12d092b3fe7adc68fc74f98c6 04-May-2015 Christopher Ferris <cferris@google.com> Modify test to avoid race condition.
automerge: 3da136a

* commit '3da136aa47e2d1608b98abb2580f024b36f92831':
Modify test to avoid race condition.
9a2744df301c509ea48361016ab441c792ec6d5a 25-Apr-2015 Elliott Hughes <enh@google.com> Merge "Fix POSIX timer thread naming."
d1aea30b2ade504550f7bb7996c808b9af1c415d 25-Apr-2015 Elliott Hughes <enh@google.com> Fix POSIX timer thread naming.

Spencer Low points out that we never actually set a name because the constant
part of the string was longer than the kernel's maximum, and the kernel
rejects long names rather than truncate.

Shorten the fixed part of the string while still keeping it meaningful. 9999
POSIX timers should be enough for any process...

Bug: https://code.google.com/p/android/issues/detail?id=170089
Change-Id: Ic05f07584c1eac160743519091a540ebbf8d7eb1
thread_test.cpp
2c256a0f0927abd94f2210b37c18ead210d30477 25-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Unregister pthread_atfork handlers on dlclose()"
e91e66f223950fdc963cd89697541a32a253a0a6 25-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Use bfd linker for x86/x86_64 targets

ld.gold in current toolchain for x86_64
does not support -z global.

Change-Id: Iea2b192f0f0aa998a02adb356fd4eec4e10a1739
ibs/Android.mk
ea295f68f1fae7c701baaa717f67296659d567ac 21-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Unregister pthread_atfork handlers on dlclose()

Bug: http://b/20339788
Change-Id: I874c87faa377645fa9e0752f4fc166d81fd9ef7e
ibs/Android.build.pthread_atfork.mk
ibs/Android.mk
ibs/pthread_atfork.cpp
thread_test.cpp
6612d7a34768484eb002c07a1c7df1bd85c0997a 25-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Enable dlsym_df_1_global test for arm/arm64

Change-Id: I1fdebced93175cb14053e2239e79f97239fc2dc2
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
094f58fb2a57d1ed5736ae3588bf0355618f915b 24-Apr-2015 Dimitry Ivanov <dimitry@google.com> Revert "Unregister pthread_atfork handlers on dlclose()"

The visibility control in pthread_atfork.h is incorrect.
It breaks 64bit libc.so by hiding pthread_atfork.

This reverts commit 6df122f8528f9b9fcf7dfea14ae98b0ef66274e1.

Change-Id: I21e4b344d500c6f6de0ccb7420b916c4e233dd34
ibs/Android.build.pthread_atfork.mk
ibs/Android.mk
ibs/pthread_atfork.cpp
thread_test.cpp
6df122f8528f9b9fcf7dfea14ae98b0ef66274e1 21-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Unregister pthread_atfork handlers on dlclose()

Change-Id: I326fdf6bb06bed12743f08980b5c69d849c015b8
ibs/Android.build.pthread_atfork.mk
ibs/Android.mk
ibs/pthread_atfork.cpp
thread_test.cpp
42281880a8ac8614832ff918a14e4b950f35d05d 17-Apr-2015 Daniel Micay <danielmicay@gmail.com> add fortified readlink/readlinkat implementations

Change-Id: Ia4b1824d20cad3a072b9162047492dade8576779
ortify_test.cpp
3875744f89600027c69ea68650fff1eeb4b29723 17-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Support symbol versioning"
2a815361448d01b0f4e575f507ce31913214c536 09-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Support symbol versioning

Bug: http://b/20139821
Change-Id: I64122a0fb0960c20b2ce614161b7ab048456b681
lfcn_test.cpp
ibs/Android.build.versioned_lib.mk
ibs/Android.mk
ibs/versioned_lib_other.cpp
ibs/versioned_lib_other.map
ibs/versioned_lib_v1.cpp
ibs/versioned_lib_v1.map
ibs/versioned_lib_v2.cpp
ibs/versioned_lib_v2.map
ibs/versioned_lib_v3.cpp
ibs/versioned_lib_v3.map
ibs/versioned_uselib.cpp
ibs/versioned_uselib.map
e7e1c875b0f8eefb1d771f200a58f54e64c39d55 16-Apr-2015 Daniel Micay <danielmicay@gmail.com> add fortified implementations of pread/pread64

Change-Id: Iec39c3917e0bc94371bd81541619392f5abe29b9
ortify_test.cpp
a40cb0ca7fe8ddc146831e92ec543be9feb26a65 16-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Call __cxa_thread_finalize for the main thread."
2587c6a2f0f946bd7c1e526c20b2623c01accd60 16-Apr-2015 Yabin Cui <yabinc@google.com> Merge "Change on handling of SIGEV_THREAD timers."
95f1ee235ae257802a94d7e94d476ea0aaea5cd8 14-Jan-2015 Yabin Cui <yabinc@google.com> Change on handling of SIGEV_THREAD timers.

1. Don't prevent calling callback when SIGEV_THREAD timers are disarmed by timer_settime.
As in POSIX standard: The effect of disarming or resetting a timer with pending
expiration notifications is unspecified. And glibc didn't prevent in this situation, so I
think it is fine to remove the support.
2. Still prevent calling callback when SIGEV_THREAD timers are deleted by timer_delete.
As in POSIX standard: The disposition of pending signals for the deleted timer is unspecified.
However, glibc handles this (although that is not perfect). And some of our tests in
time_test.cpp depend on this feature as described in b/18039727. so I retain the support.
3. Fix some flaky test in time_test.cpp, and make "time*" test pass on bionic-unit-tests-glibcxx.

Bug: 18263854

Change-Id: I8ced184eacdbfcf433fd81b0c69c38824beb8ebc
ime_test.cpp
163ab8ba86deb991c73152e6828f270cc71dc4c5 16-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Call __cxa_thread_finalize for the main thread.

Bug: http://b/20231984
Bug: http://b/16696563
Change-Id: I71cfddd0d404d1d4a593ec8d3bca9741de8cb90f
_cxa_thread_atexit_test.cpp
66aa0b61f736678e97a0cfaf975052881a23651b 15-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Hide emutls* symbols in libc.so

Also make thread_local in test static to avoid ld.bfd
warning for arm64.

Change-Id: I09a3f2aa9b73a4fafa3f3bbc64ddc2a128ad50ee
_cxa_thread_atexit_test.cpp
8f3f04184a5772b421867b59acd3d0dfbc6fa4eb 14-Apr-2015 Yabin Cui <yabinc@google.com> Merge "Prevent using static-allocated pthread keys before creation."
5ddbb3f936ee44555a46020239e49ab45109a806 06-Mar-2015 Yabin Cui <yabinc@google.com> Prevent using static-allocated pthread keys before creation.

Bug: 19993460

Change-Id: I244dea7f5df3c8384f88aa48d635348fafc9cbaf
thread_test.cpp
de889741201faa338e01babdfd10bbd597769e60 11-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Fix dl* tests to run-on-host"
ef25592f14d23ce6294ea103e9edf894779d141d 08-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Fix dl* tests to run-on-host

Bug: http://b/20121152
Change-Id: I1e1f41d885c75dbb26f91565a53a15d62ef72ce6
lext_test.cpp
lfcn_test.cpp
9f2c2f53d372001ac6565b060a07d4416ca58e47 09-Apr-2015 Yabin Cui <yabinc@google.com> Merge "Provide writer preference option in rwlock."
76615dae93c18ac890e167c547a08c0228709a33 17-Mar-2015 Yabin Cui <yabinc@google.com> Provide writer preference option in rwlock.

Previous implementation of rwlock contains four atomic variables, which
is hard to maintain and change. So I make following changes in this CL:

1. Add pending flags in rwlock.state, so we don't need to synchronize
between different atomic variables. Using compare_and_swap operations
on rwlock.state is enough for all state change.

2. Add pending_lock to protect readers/writers waiting and wake up
operations. As waiting/wakeup is not performance critical, using a
lock is easier to maintain.

3. Add writer preference option.

4. Add unit tests for rwlock.

Bug: 19109156

Change-Id: Idcaa58d695ea401d64445610b465ac5cff23ec7c
thread_test.cpp
1dce3ed24940808a553f4da1a92a9b6759efd4ab 07-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Fix x86_64 build

Change-Id: Id81c059bf3ecdb9cc84d04d16ffda34baaadc5a1
tils.h
8a1007dbababa6c4812c267ca9119cf0765afc3f 07-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Add realpath for soinfo"
aae859cc3ca127d890e853cbf12b731e05624a22 31-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Add realpath for soinfo

This change adds realpath to soinfo and
extends limit on filenames from 128 to PATH_MAX.

It also removes soinfo::name field, linker uses
dt_soname instead.

Bug: http://b/19818481
Bug: https://code.google.com/p/android/issues/detail?id=80336
Change-Id: I9cff4cb5bda3ee2bc74e1bbded9594ea7fbe2a08
lext_test.cpp
lfcn_test.cpp
tils.h
67de2593b3d7e9e94ac8993efd51da4b512c6af5 06-Apr-2015 Elliott Hughes <enh@google.com> Merge "Add a test for getdelim(3) on a directory."
694fd2d880634f23254582ab1161bffbfd104696 05-Apr-2015 Elliott Hughes <enh@google.com> Add a test for getdelim(3) on a directory.

Apparently uClibc has a bug here. We don't, but let's keep it that way.

Bug: http://landley.net/notes.html#21-03-2015
Change-Id: If406df963db9bee47921d7a1c116ebcab08d96bf
tdio_test.cpp
4bd8f9637daaada333ff35945b00cfe6cb822376 04-Apr-2015 Yabin Cui <yabinc@google.com> Merge "Fix bug for recursive/errorcheck mutex on 32-bit devices."
f796985923e2d8308e00ed9567f36546dafb98d7 03-Apr-2015 Yabin Cui <yabinc@google.com> Fix bug for recursive/errorcheck mutex on 32-bit devices.

Bug: 19216648
Change-Id: I3b43b2d18d25b9bde352da1e35f9568133dec7cf
ndroid.mk
thread_test.cpp
tack_protector_test.cpp
45c57131d25c82d6026ed36a791e9f5be40d5d7e 04-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Add libdl dependency for target libraries

Fixed x86_64 target build with gcc 4.9

Change-Id: Id3b1e9286c2bcbb8e3ac117bcef957304db7cfd3
ibs/Android.mk
aea165cb03abceb85062e94f22f72e1c9d9800a4 03-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Add ANDROID_DLEXT_FORCE_LOAD flag"
9b82136b987bc01224e3b42732334ea27c97d188 03-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Add ANDROID_DLEXT_FORCE_LOAD flag

This flag allows to force loading of the library
in the case when for some reason multiple ELF files
share the same filename (because the already-loaded
library has been removed and overwritten, for example).

Change-Id: I798d44409ee13d63eaa75d685e99c4d028d2b0c1
lext_test.cpp
06b6e3c51d38d70c5ca99f3a3f795697031ac27f 02-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Look into local group on dlsym with RTLD_DEFAULT"
76ac1acdacc045cf1e56504e011dca68137dcd61 01-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Look into local group on dlsym with RTLD_DEFAULT

Fix dlsym to look into local group when called with
RTLD_DEFAULT and RTLD_NEXT.

Bug: 17512583
Change-Id: I541354e89539c712af2ea4ec751e546913027084
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_from_this.cpp
00d1101cc170ce786f26143a897b4a3e3363b55f 02-Apr-2015 Yabin Cui <yabinc@google.com> Merge "Refactor pthread_mutex to support 32-bit owner_tid on 64-bit devices."
618935d2679e84cc839316c042ee3dde5f7d7097 02-Apr-2015 Christopher Ferris <cferris@google.com> Merge "gtest_repeat should allow negative values."
119cb55d43304579af741d8dbc3ca701b97bbf70 02-Apr-2015 Christopher Ferris <cferris@google.com> gtest_repeat should allow negative values.

If you pass in a negative value to gtest_repeat, it should run forever.
The new runner didn't allow this, now it does.

Change-Id: Ie0002c12e2fdad22b264adca37c165cfcfe05c7a
test_main.cpp
e69c24543db577d8b219ab74b0ba7566e0f13b38 14-Feb-2015 Yabin Cui <yabinc@google.com> Refactor pthread_mutex to support 32-bit owner_tid on 64-bit devices.

Bug: 19216648
Change-Id: I765ecacc9036659c766f5d1f6600e1a65364199b
thread_test.cpp
0ad256c1b234cddc97290be761f8a0163a5c6c00 01-Apr-2015 Elliott Hughes <enh@google.com> Fix ftw tests when run as non-root.

Root can create subdirectories inside non-writable directories, but
other users can't.

Change-Id: I102fe610d1bd2733aebf184b544e58612465287d
tw_test.cpp
6170693e28dd72a1517c267f3f62b3f37477b8bb 31-Mar-2015 Elliott Hughes <enh@google.com> Make ThreadLocalBuffer a class rather than a macro.

Bug: 19995392
Change-Id: I497c512648fbe66257da3fb3bcd5c9911f983705
thread_test.cpp
947adedebc480917b8490bc16e8b2d82b441095a 26-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Add test for thread_local keyword.

For gcc only for the time being.

Bug: 19800080
Bug: 16696563
Change-Id: Ifaa59a131ca2d9030554cee7ce631dcb1d081938
ndroid.mk
_cxa_thread_atexit_test.cpp
8f3eb5a4e5dbbac1fb431e40e25eec07ecc24ee8 26-Mar-2015 Yabin Cui <yabinc@google.com> Merge "Revert "Cause Fatal error when invalid pthread_id is detected.""
220b99bdc1c5f51825ac2a87062bc05fe3e0d722 26-Mar-2015 Yabin Cui <yabinc@google.com> Revert "Cause Fatal error when invalid pthread_id is detected."

Some code like in https://buganizer.corp.google.com/u/0/issues/19942911 need to change first.

This reverts commit 03324780aae9ff28c8acf52debf0ea39120e5ab8.

Change-Id: I13ff1e5b3d0672bae9cde234ffba32fbbf33d338
thread_test.cpp
f2d153f836e529892854b91452fabd2c2fa79c05 26-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Initial implementation of __cxa_thread_atexit_impl"
df79c330d895af31f39ee301dee62731fa586168 26-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Initial implementation of __cxa_thread_atexit_impl

This is initial implementations; does not yet handle
dlclose - undefined behavior, needs linker support to
handle it right.

Bug: 19800080
Bug: 16696563
Change-Id: I7a3e21ed7f7ec01e62ea1b7cb2ab253590ea0686
ndroid.mk
_cxa_thread_atexit_test.cpp
17393b06bab9cb3e95d0f466a56c746de19b8eee 21-Mar-2015 Yabin Cui <yabinc@google.com> Hide internal of pthread_mutex_t.

Bug: 19249079
Change-Id: Iffb79c8d861b698d474f212dc80c638fc2cf1620
thread_test.cpp
03324780aae9ff28c8acf52debf0ea39120e5ab8 25-Mar-2015 Yabin Cui <yabinc@google.com> Cause Fatal error when invalid pthread_id is detected.

This is a patch testing whether we can use abort() instead of
returning ESRCH for invalid pthread ids. It is an intermediate
step to remove g_thread_list/g_thread_list_lock.

Bug: 19636317
Change-Id: Idd8e4a346c7ce91e1be0c2ebcb78ce51c0d0a31d
thread_test.cpp
b58457221364eaad039c2c49a42626b725e980d5 17-Mar-2015 Yabin Cui <yabinc@google.com> Add test for pthread types alignment check.

Bug: 19249079
Change-Id: I83c4f0d11ec5d82a346ae0057d02a92bb1d519e8
thread_test.cpp
bbb0432a33787f1a627abb396fe343a7943ac7bc 19-Mar-2015 Yabin Cui <yabinc@google.com> Return EINVAL when calling pthread_detach for joined thread.

Change-Id: I717015132187e087e0ad485284a13c8801e25e77
thread_test.cpp
52393a56335435efc605aff66aca3145873e1e56 19-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Move open from zip tests to dlext

To avoid building them for glibc.

Also replace snprintf with std::string

Change-Id: I12e1d2e4ab46ff5af6c05453da67842e0d838fc5
lext_test.cpp
lfcn_test.cpp
618f1a36f8635fa0f2d60c621fbf79ead2c3f3de 18-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Implement lookup by DT_SONAME

This CL also fixes SEARCH_NAME hack and resolves
https://code.google.com/p/android/issues/detail?id=6670
once and for all.

Bug: https://code.google.com/p/android/issues/detail?id=6670
Change-Id: I9b8d6a672cd722f30fbfbb40cdee8d9b39cfe56e
lfcn_test.cpp
ibs/Android.mk
c6fbbb42e69bef4f058d0cbfaaaf3cbf51f95694 19-Mar-2015 Elliott Hughes <enh@google.com> Merge "Hide statfs/fstatfs' ST_VALID flag from userspace."
fa495d51b02e1575088ed358614d3baa442f455f 18-Mar-2015 Elliott Hughes <enh@google.com> Hide statfs/fstatfs' ST_VALID flag from userspace.

Spotted while debugging the strace 4.10 upgrade.

Change-Id: I1af1be9c9440151f55f74a835e1df71529b0e4fe
ys_statvfs_test.cpp
ys_vfs_test.cpp
c0eaa732844a8397d40a7ec82641f709e4b47a61 18-Mar-2015 Dimitry Ivanov <dimitry@google.com> Merge "Support loading shared libraries from zip files"
ee7649c5ac5f1e56cc8193cd4cee73004c04893d 16-Mar-2015 Daniel Micay <danielmicay@gmail.com> set errno to ENOENT in getauxval per glibc 2.19

Bionic's getauxval(...) implementation returns zero when entries are
missing. Zero can be a valid value, so there is no unambiguous way of
detecting an error. Since glibc 2.19, errno is set to ENOENT when an
entry is missing to make it possible to detect this. Bionic should match
this behavior as code in the Linux ecosystem will start relying on it to
check for the presence of newly added entries.

Change-Id: Ic1efe29bc45fc87489274c96c4d2193f3a7b8854
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
etauxval_test.cpp
5490bebd7cdd4406780358f590391b75ab8a7d84 17-Mar-2015 Yabin Cui <yabinc@google.com> Merge "Remove duplication in pthread_mutex.cpp."
aef719510a57274e73ca02ab5ecdc5bf17d3985c 16-Jan-2015 Simon Baldwin <simonb@google.com> Support loading shared libraries from zip files

Add code to support loading shared libraries directly from within
APK files.

Extends the linker's handling of LD_LIBRARY_PATH, DT_RUNPATH, etc
to allow elements to be either directories as normal, or ZIP
format files. For ZIP, the ZIP subdirectory string is separated
from the path to file by '!'.

For example, if DT_NEEDED is libchrome.so and Chrome.apk is the
Android ARM APK then the path element

/system/app/Chrome.apk!lib/armeabi-v7a

would cause the linker to load lib/armeabi-v7a/libchrome.so
directly from inside Chrome.apk. For loading to succeed,
libchrome.so must be 'stored' and not compressed in Chrome.apk,
and must be page aligned within the file.

Motivation:
Chromium tracking issue:
https://code.google.com/p/chromium/issues/detail?id=390618

Bug: 8076853
Change-Id: Ic49046600b1417eae3ee8f37ee98c8ac1ecc19e7
lfcn_test.cpp
ibs/Android.build.dlext_testzip.mk
cb0443c0fa07e4c049f426e3041894df522732df 16-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Remove obsolete test_isolated wrapper function

We already run all of our tests in isolated mode.

Change-Id: I8236baa302b1026a9b4a1c33a4aa65e223771bc7
lfcn_test.cpp
test_ex.h
thread_test.cpp
d3e2a207ffcaefedf2d3baaaad3d62be1abdb33c 16-Mar-2015 Yabin Cui <yabinc@google.com> Merge "Hide content of pthread_cond_t in pthread_cond_internal_t."
b1ada3dd3fbf188ced9ab1edf1ee154d119bbc02 16-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Fix typo

Change-Id: Ie6dad7d09873c88f6bbb2d45c2780e3b0c618bd6
lext_test.cpp
32651b8e8e453391c7aaca47cd885e94d54d0bf4 14-Mar-2015 Yabin Cui <yabinc@google.com> Hide content of pthread_cond_t in pthread_cond_internal_t.

Bug: 19249079
Change-Id: I6f55af30bcd6211ce71630c6cacbef0e1663dcee
thread_test.cpp
64a9c4f697a2588bbcfb20534b8b15b823595d1f 13-Mar-2015 Yabin Cui <yabinc@google.com> Make gtest_main exit 1 when some test are failed.

This is the gtest behavior, which I think can make test status
judgement more convenient.

Change-Id: I7d3c210d1744b954a4148cd905dd5c353207fce8
test_main.cpp
5b8e7cd957f9380e93c3aee84962d157fe0bc526 05-Mar-2015 Yabin Cui <yabinc@google.com> Remove duplication in pthread_mutex.cpp.

Also add unit tests about thread woken up by pthread_mutex_unlock.

Bug: 19216648

Change-Id: I8bde8105b00186c52a2f41d92458ae4a5eb90426
thread_test.cpp
c6e5874a4c19f398eb179a23de9b1d2c06bccea0 09-Mar-2015 Yabin Cui <yabinc@google.com> Loosen fchmodat AT_SYMLINK_NOFOLLOW test on symlink.

It has been reported in b2/19657449 and b2/19381040 that fchmodat
AT_SYMLINK_NOFOLLOW operation on symlink can succeed. It seems to be
controlled by kernel(version or configuration) or user configuration
whether chmod is allowed on symlinks. Unless we can disable chmod on
symlinks in bionic explicitly, we can not guarantee that the test can
pass. But it seems reasonable to allow chmod on symlink if kernel allows
to. So We prefer to loosen the test here, accepting both success and
failure when doing chmod operation on symlinks.

Bug: 19657449
Bug: 19381040
Change-Id: I780e84f0b50d0412fbac9f1c240d07e984892a28
ys_stat_test.cpp
24e8871faa34e9c49c629ae63970422ff75ee4a2 05-Mar-2015 Yabin Cui <yabinc@google.com> Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp.

Bug: 19234260
Change-Id: Ife27ca13eeae317739eda25b40dd2a08606d6d6f
ndroid.mk
ortify_compilation_test.cpp
ortify_sprintf_warnings.cpp
d9647594dee6fc0352845904f2249b7f1c4e2364 05-Mar-2015 Yabin Cui <yabinc@google.com> Fix fortify compilation test in x86_64.

Change-Id: Ic243f6583e4f435899d01c7845dddacacbfc916e
ortify_sprintf_warnings.cpp
94545eba371be428c11d587a3b7d9883f37c7b19 05-Mar-2015 Yabin Cui <yabinc@google.com> Fix fortify compilation test on x86.

Change-Id: I9b88cbcec51b6f1dbac2780a9bf82851bd6cc87c
ortify_sprintf_warnings.cpp
f3bd305b8f8270f157ee79851fc630abd94d3245 05-Mar-2015 Yabin Cui <yabinc@google.com> Fix fortify compilation test on mips.

Change-Id: Icff5b859ae58067bfa34430d3f5684335fe063b4
ortify_sprintf_warnings.cpp
e1c0213be3f0c2c4e310cbc262da88835a2e5d86 05-Mar-2015 Yabin Cui <yabinc@google.com> Merge "Switch pthread_rwlock_t to stdatomic."
08ee8d2030fbc73c4c144e819dd68806b0351cbe 12-Feb-2015 Yabin Cui <yabinc@google.com> Switch pthread_rwlock_t to stdatomic.

Bug: 19099838
Change-Id: Ie82967a60b5cec61a8bdd1e0e4a03738d01944f8
thread_test.cpp
20f2268d61966230587957912491b67ad8bb91c8 04-Mar-2015 Yabin Cui <yabinc@google.com> Add fortify compile test.

Two parts of tests are added:
1. Compile time warnings for gcc checking built-in functions.
2. Compile time errors for each errordecl() in bionic.

Bug: 19234260
Change-Id: Iec6e4a8070c36815574fe9e0af9595d6143a4757
ortify_sprintf_warnings.cpp
cc9ca1051dbf5bd2af1b801de13d43a399521cf9 28-Feb-2015 Christopher Ferris <cferris@google.com> Fix fread returning bad data.

Bug: 19172514
Change-Id: I05016577858a02aca7d14e75e6ec28abc925037c
tdio_test.cpp
f6237470a3f5ce801b5df2500f3d0ffb1aec4515 27-Feb-2015 Yabin Cui <yabinc@google.com> Make bionic gtest main be compatible with gtest output format for cts test.

Bug: 17589740
Change-Id: Ifab521da379a33bf0a7bf11c21386f936f0d494c
ndroid.mk
test_main.cpp
ea9c933f360cc07b821b542321309c65cceddbfc 24-Feb-2015 Yabin Cui <yabinc@google.com> Make all output of child test go to parent process in gtest_main.

Change-Id: Iad460e89755051cdb99593cbf42c97d9a359f32b
test_main.cpp
35778253a5ed71e87a608ca590b63729d9f88567 24-Feb-2015 Nick Kralevich <nnk@google.com> Fix "faccessat ignores flags"

The kernel system call faccessat() does not have any flags arguments,
so passing flags to the kernel is currently ignored.

Fix the kernel system call so that no flags argument is passed in.

Ensure that we don't support AT_SYMLINK_NOFOLLOW. This non-POSIX
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html)
flag is a glibc extension, and has non-intuitive, error prone behavior.

For example, consider the following code:

symlink("foo.is.dangling", "foo");
if (faccessat(AT_FDCWD, "foo", R_OK, AT_SYMLINK_NOFOLLOW) == 0) {
int fd = openat(AT_FDCWD, "foo", O_RDONLY | O_NOFOLLOW);
}

The faccessat() call in glibc will return true, but an attempt to
open the dangling symlink will end up failing. GLIBC documents this
as returning the access mode of the symlink itself, which will
always return true for any symlink on Linux.

Some further discussions of this are at:

* http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003617.html
* http://permalink.gmane.org/gmane.linux.lib.musl.general/6952

AT_SYMLINK_NOFOLLOW seems broken by design. I suspect this is why this
function was never added to POSIX. (note that "access" is pretty much
broken by design too, since it introduces a race condition between
check and action). We shouldn't support this until it's clearly
documented by POSIX or we can have it produce intuitive results.

Don't support AT_EACCESS for now. Implementing it is complicated, and
pretty much useless on Android, since we don't have setuid binaries.
See http://git.musl-libc.org/cgit/musl/commit/?id=0a05eace163cee9b08571d2ff9d90f5e82d9c228
for how an implementation might look.

Bug: 18867827
Change-Id: I25b86c5020f3152ffa3ac3047f6c4152908d0e04
ys_stat_test.cpp
be52e658171edf6651895c40d1563289bafa52f7 24-Feb-2015 Elliott Hughes <enh@google.com> Fix dup2 in the case where the two fds are equal.

dup3's behavior differs from dup2 in this case, so we need to paper
over that in the C library.

Change-Id: I313cd6f226db5e237f61866f324c5ecdd12bf762
nistd_test.cpp
3cfb52aab2548df635e9672218cc433e14922fd3 19-Feb-2015 Elliott Hughes <enh@google.com> Add GNU extensions mempcpy and wmemcpy.

Used by elfutils. On the bright side, they stopped using __mempcpy.

Bug: 18374026
Change-Id: Id29bbe6ef1c5ed5a171bb6c32182f129d8332abb
tring_test.cpp
char_test.cpp
3da136aa47e2d1608b98abb2580f024b36f92831 19-Feb-2015 Christopher Ferris <cferris@google.com> Modify test to avoid race condition.

There is a possible race if a timer is set to trigger at nearly the same
time as it is set. Since nobody uses the timers like this, modify the test
so this doesn't happen. The race that this can provoke has been fixed in
aosp.

Bug: 19423618
Change-Id: I21084c99da5ae46f404936d673dae6bad7c82caa
ime_test.cpp
54b61b7ca7d7c9c7474e2beb35d20a9ab635529f 17-Feb-2015 Christopher Ferris <cferris@google.com> Merge "Accuracy tests for libm"
fb48c68221afb1f9e7c63a15a20cca0857d1b9f9 17-Feb-2015 Elliott Hughes <enh@google.com> Merge "Fix memchr overflow."
e1f9ddaf0d314186da8b2a86e5a438f6ff204030 14-Feb-2015 Elliott Hughes <enh@google.com> Regression test for NDK bug 80199.

Bionic never had this bug, but since the proposed fix is to remove the NDK's
broken code, we should add a regression test here.

Bug: https://code.google.com/p/android/issues/detail?id=80199
Change-Id: I4de21b5da9913cef990bc4d05a7e27562a71a02b
char_test.cpp
41ef902379ba24bd8a3ca6d7733b8376efb55ebd 14-Feb-2015 Elliott Hughes <enh@google.com> Fix memchr overflow.

The overflow's actually in the generic C implementation of memchr.

While I'm here, let's switch our generic memrchr to the OpenBSD version too.

Bug: https://code.google.com/p/android/issues/detail?id=147048
Change-Id: I296ae06a1ee196d2c77c95a22f11ee4d658962da
tring_test.cpp
56b2b2916b72eb21352c7aed529e0deeb5582072 02-Sep-2014 Jingwei Zhang <jingwei.zhang@intel.com> Accuracy tests for libm

This patch adds more tests for math functions to address coverage
issue of math functions discussed in:
https://android-review.googlesource.com/#/c/49653/
https://android-review.googlesource.com/#/c/94780/

These are data sets used in regression tests for the Intel the math library (libm). They were collected over a long period of testing various libm implementations.
The data sets contain function specific data (special and corner cases such as +/-0, maximum/minimum normalized numbers, +/-infinity, QNaN/SNaN, maximum/minimum denormal numbers, arguments that would produce close to overflow/underflow results, known hard-to-round cases, etc), implementation specific data (arguments close to table look-up values for different polynomial approximations, worst cases for range reduction algorithms) and other data with interesting bit patterns.
The reference values are computed with Maple and were converted into hexadecimal format.

Change-Id: I7177c282937369eae98f25d02134e4fc3beadde8
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
ath_cos_intel_data.h
ath_cosf_intel_data.h
ath_data/acos_intel_data.h
ath_data/acosf_intel_data.h
ath_data/acosh_intel_data.h
ath_data/acoshf_intel_data.h
ath_data/asin_intel_data.h
ath_data/asinf_intel_data.h
ath_data/asinh_intel_data.h
ath_data/asinhf_intel_data.h
ath_data/atan2_intel_data.h
ath_data/atan2f_intel_data.h
ath_data/atan_intel_data.h
ath_data/atanf_intel_data.h
ath_data/atanh_intel_data.h
ath_data/atanhf_intel_data.h
ath_data/cbrt_intel_data.h
ath_data/cbrtf_intel_data.h
ath_data/ceil_intel_data.h
ath_data/ceilf_intel_data.h
ath_data/copysign_intel_data.h
ath_data/copysignf_intel_data.h
ath_data/cos_intel_data.h
ath_data/cosf_intel_data.h
ath_data/cosh_intel_data.h
ath_data/coshf_intel_data.h
ath_data/exp2_intel_data.h
ath_data/exp2f_intel_data.h
ath_data/exp_intel_data.h
ath_data/expf_intel_data.h
ath_data/expm1_intel_data.h
ath_data/expm1f_intel_data.h
ath_data/fabs_intel_data.h
ath_data/fabsf_intel_data.h
ath_data/fdim_intel_data.h
ath_data/fdimf_intel_data.h
ath_data/floor_intel_data.h
ath_data/floorf_intel_data.h
ath_data/fma_intel_data.h
ath_data/fmaf_intel_data.h
ath_data/fmax_intel_data.h
ath_data/fmaxf_intel_data.h
ath_data/fmin_intel_data.h
ath_data/fminf_intel_data.h
ath_data/fmod_intel_data.h
ath_data/fmodf_intel_data.h
ath_data/frexp_intel_data.h
ath_data/frexpf_intel_data.h
ath_data/hypot_intel_data.h
ath_data/hypotf_intel_data.h
ath_data/ilogb_intel_data.h
ath_data/ilogbf_intel_data.h
ath_data/ldexp_intel_data.h
ath_data/ldexpf_intel_data.h
ath_data/log10_intel_data.h
ath_data/log10f_intel_data.h
ath_data/log1p_intel_data.h
ath_data/log1pf_intel_data.h
ath_data/log2_intel_data.h
ath_data/log2f_intel_data.h
ath_data/log_intel_data.h
ath_data/logb_intel_data.h
ath_data/logbf_intel_data.h
ath_data/logf_intel_data.h
ath_data/modf_intel_data.h
ath_data/modff_intel_data.h
ath_data/nearbyint_intel_data.h
ath_data/nearbyintf_intel_data.h
ath_data/nextafter_intel_data.h
ath_data/nextafterf_intel_data.h
ath_data/pow_intel_data.h
ath_data/powf_intel_data.h
ath_data/remainder_intel_data.h
ath_data/remainderf_intel_data.h
ath_data/remquo_intel_data.h
ath_data/remquof_intel_data.h
ath_data/rint_intel_data.h
ath_data/rintf_intel_data.h
ath_data/round_intel_data.h
ath_data/roundf_intel_data.h
ath_data/scalb_intel_data.h
ath_data/scalbf_intel_data.h
ath_data/scalbn_intel_data.h
ath_data/scalbnf_intel_data.h
ath_data/significand_intel_data.h
ath_data/significandf_intel_data.h
ath_data/sin_intel_data.h
ath_data/sincos_intel_data.h
ath_data/sincosf_intel_data.h
ath_data/sinf_intel_data.h
ath_data/sinh_intel_data.h
ath_data/sinhf_intel_data.h
ath_data/sqrt_intel_data.h
ath_data/sqrtf_intel_data.h
ath_data/tan_intel_data.h
ath_data/tanf_intel_data.h
ath_data/tanh_intel_data.h
ath_data/tanhf_intel_data.h
ath_data/trunc_intel_data.h
ath_data/truncf_intel_data.h
ath_data_test.h
ath_exp_intel_data.h
ath_expf_intel_data.h
ath_log_intel_data.h
ath_logf_intel_data.h
ath_pow_intel_data.h
ath_powf_intel_data.h
ath_sin_intel_data.h
ath_sincos_intel_data.h
ath_sincosf_intel_data.h
ath_sinf_intel_data.h
ath_tan_intel_data.h
ath_tanf_intel_data.h
ath_test.cpp
7f925097e8a741bb23f91c45ffcbd74688c9e231 10-Feb-2015 Elliott Hughes <enh@google.com> Fix our ftw tests.

SELinux denies access to some files in /sys, so we can't just trawl
through that asserting general truths. Instead, create a small known
tree.

Sadly neither ftw nor nftw takes user callback data, otherwise it would
be nice to assert that we visit all the expected nodes.

Bug: 19252748
Change-Id: Ib5309c38aaef53e6030281191a265a8d5a619044
tw_test.cpp
05d26211d8d310a30de05b06ce5807198e948f9d 04-Feb-2015 Christopher Ferris <cferris@google.com> Display errors instead of running infinitely.

When there is an error detected, the code runs forever and then times
out without any indication of what happened. Change it so that error
messages are printed and the test fails.

Change-Id: Id3160fc2f394984de0157356594fd8b40de66b4a
tack_unwinding_test.cpp
ead08148bdfe880f40c457d923e6456044196fc7 05-Feb-2015 Yabin Cui <yabinc@google.com> Add path separator in bionic-unit-tests program path.

Bug: 19220800
Change-Id: I4245b1270363544cd5f083fe7ea7d9b11b46cdc0
test_main.cpp
63826658f4bcfff4f3a87fe651f22cc9b35fe8b9 05-Feb-2015 Yabin Cui <yabinc@google.com> Merge "Add signal handling in bionic gtest main."
1d4c780a2e1fe81cf3ea35ba0641dd14744c142a 03-Feb-2015 Yabin Cui <yabinc@google.com> Add signal handling in bionic gtest main.

The two bugs are very closely related and code amount is very small,
So I think they may be fixed in one change.

Bug: 19128558
Bug: 19129994
Change-Id: I44a35398e64dfca7e9676428cb8f4026e8f6e488
test_main.cpp
17976019a13a94ae428849bfe297f8e531f95013 05-Feb-2015 Yabin Cui <yabinc@google.com> Merge "Fix poll/ppoll fortify test to avoid hanging in failed fortify clang test."
f4fe6937aa5ac5a424b63bc68c5a953aaf46e1c6 04-Feb-2015 Yabin Cui <yabinc@google.com> Fix poll/ppoll fortify test to avoid hanging in failed fortify clang test.

Bug: 19220800
Change-Id: Ie75c640183c4a41a499556fefb4f824a134a5fb1
ortify_test.cpp
11829be3e1a9e9e2271ba64a78c327bde6e044eb 03-Feb-2015 Yabin Cui <yabinc@google.com> Merge "Add test about pthread_mutex_t owner tid limit."
140f3678f0f21eeda5916e9b8de87b93fd660a61 03-Feb-2015 Yabin Cui <yabinc@google.com> Add test about pthread_mutex_t owner tid limit.

Bug: 19216648
Change-Id: I7b12955bdcad31c13bf8ec2740ff88ba15223ec0
thread_test.cpp
d80ec66121b5af96c6b3d07ba34353b3d517f5b3 02-Feb-2015 Nick Kralevich <nnk@google.com> Merge "Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support"
3cbc6c627fe57c9a9783c52d148078f8d52f7b96 01-Feb-2015 Nick Kralevich <nnk@google.com> Add fchmodat(AT_SYMLINK_NOFOLLOW) and fchmod O_PATH support

Many libc functions have an option to not follow symbolic
links. This is useful to avoid security sensitive code
from inadvertantly following attacker supplied symlinks
and taking inappropriate action on files it shouldn't.
For example, open() has O_NOFOLLOW, chown() has
lchown(), stat() has lstat(), etc.

There is no such equivalent function for chmod(), such as lchmod().
To address this, POSIX introduced fchmodat(AT_SYMLINK_NOFOLLOW),
which is intended to provide a way to perform a chmod operation
which doesn't follow symlinks.

Currently, the Linux kernel doesn't implement AT_SYMLINK_NOFOLLOW.
In GLIBC, attempting to use the AT_SYMLINK_NOFOLLOW flag causes
fchmodat to return ENOTSUP. Details are in "man fchmodat".

Bionic currently differs from GLIBC in that AT_SYMLINK_NOFOLLOW
is silently ignored and treated as if the flag wasn't present.

This patch provides a userspace implementation of
AT_SYMLINK_NOFOLLOW for bionic. Using open(O_PATH | O_NOFOLLOW),
we can provide a way to atomically change the permissions on
files without worrying about race conditions.

As part of this change, we add support for fchmod on O_PATH
file descriptors, because it's relatively straight forward
and could be useful in the future.

The basic idea behind this implementation comes from
https://sourceware.org/bugzilla/show_bug.cgi?id=14578 , specifically
comment #10.

Change-Id: I1eba0cdb2c509d9193ceecf28f13118188a3cfa7
ys_stat_test.cpp
d036e94bb39a551768dc756a79366e6378fe95e3 02-Feb-2015 Elliott Hughes <enh@google.com> Explicitly check that the reason fortify tests abort is fortify.

Change-Id: I95291e2febf7b497c1d9f37fd7fa9acdd21e86a4
ortify_test.cpp
4674e3899afcc6b3ac8a48cdb716695d5489d26b 02-Feb-2015 Elliott Hughes <enh@google.com> Fortify poll and ppoll.

And remove the test for FD_ZERO fortification, which never made much
sense anyway.

Change-Id: Id1009c5298d461fa4722189e8ecaf22f0c529536
ortify_test.cpp
b6e3e800d26d8ca05aca65e529cc31a180fb58d4 01-Feb-2015 Elliott Hughes <enh@google.com> Add the fortify tests back into the glibc tests.

Change-Id: I4426d0c7c1bfe3b0028a674f72d1c3b9d883d6af
ndroid.mk
11c4353cdd9f78bdb36837ab0c97c41bb46d49ed 28-Jan-2015 Yabin Cui <yabinc@google.com> Add --gtest-filter as synonym for --gtest_filter in bionic gtest main.

Bug: 19130480
Change-Id: I0d3df70ee8f692581cc4b9b742c5f347259fd0d2
test_main.cpp
385c07a74ca5438a6f7fe0ada2b461f880563073 27-Jan-2015 Yabin Cui <yabinc@google.com> Merge "Fix parse of gtest_filter in bionic gtest main."
0bc4e9697e75acae012f54352887bba885cf923f 27-Jan-2015 Yabin Cui <yabinc@google.com> Fix parse of gtest_filter in bionic gtest main.

Bug: 19130330
Change-Id: Id6a60570a8aab6ae7259ff228b3801285b378f77
test_main.cpp
acc06a0b74e41728c6067280134a59d8b700d535 27-Jan-2015 Elliott Hughes <enh@google.com> Merge "Add a test for float registers across setjmp/logjmp."
4a82ede75449deb1f554ef95b7ce2e4cd2b5d072 27-Jan-2015 Yabin Cui <yabinc@google.com> Rename "TIMEWARN" to "SLOW" in bionic gtest.

Bug: 19109188.
Change-Id: Idfe769ac652bf37642da24e4abb6061ca861d57e
test_main.cpp
87dd503018c075a7afe5f0c0613262aca3861d21 27-Jan-2015 Elliott Hughes <enh@google.com> Add a test for float registers across setjmp/logjmp.

Change-Id: I17cc056b185755e0b91de096b5ceefee4f4e0b3a
etjmp_test.cpp
0e6af17a35b1e5e6e8c4a22dcb934bb641a92488 27-Jan-2015 Yabin Cui <yabinc@google.com> Merge "Support --gtest_ouput option in bionic gtest main."
657b1f9befa56251a39eec1b0624a00c5f068f57 23-Jan-2015 Yabin Cui <yabinc@google.com> Support --gtest_ouput option in bionic gtest main.

Bug: 19109500
Change-Id: Ib18f90ad522e66ea62dd4e02e314585d9b36e15f
test_main.cpp
247cfe03825f46e38371954d04fcb90a8b36c824 26-Jan-2015 Elliott Hughes <enh@google.com> Merge "Add <error.h>."
b8a8cf0d1a333401eae9c9e1d70b9c1b154ff9c9 25-Jan-2015 Elliott Hughes <enh@google.com> Add <error.h>.

Bug: https://code.google.com/p/android/issues/detail?id=79170
Change-Id: Id91765fac45124545e2674a5b2c814707c1a448b
ndroid.mk
rror_test.cpp
14152b9f31cc13c4fbffcbdf8155f3c3ee0c33a7 25-Jan-2015 Elliott Hughes <enh@google.com> Remove obsolete BUILD_TINY_ANDROID.

Change-Id: If2fc97134340fd09ec2583b666ace2f673cbdf66
ndroid.mk
e6bb5a27769cc974c4c6c1bfc96dcd07f0c0f5ef 24-Jan-2015 Elliott Hughes <enh@google.com> Fix optimized fread.

gcov does writes after reads on the same stream, but the bulk read optimization
was clobbering the FILE _flags, causing fwrite to fail.

Bug: 19129055
Change-Id: I9650cb7de4bb173a706b502406266ed0d2b654d7
tdio_test.cpp
31005ca4c8562f3e6dfbed079eeaff8361ff8cdc 24-Jan-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Minimize calls to mprotect"
279a22f96e639e76c801bdb39aee5576f2280fe0 23-Jan-2015 Dmitriy Ivanov <dimitry@google.com> Minimize calls to mprotect

Implement refcounter based data protection guard
to avoid unnecessary calls to mprotect when dlopen/dlclose
is called from a constructor.

Bug: 19124318
Big: 7941716
Change-Id: Id221b84ce75443094f99756dc9950b0a1dc87222
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_dlopen_from_ctor.cpp
4ce907d2ceeadc1f66d874a4d12207ea2397bd7f 23-Jan-2015 Dan Albert <danalbert@google.com> Allow make to set a timeout for the host tests.

Change-Id: Icc2ebf64bd1da1687bf313fe7a5640155c5795d8
ndroid.mk
62284dd2cc1d8a2e90f86e7bede32fb1e18c1c5a 23-Jan-2015 Elliott Hughes <enh@google.com> There's no such thing as LOCAL_CXXFLAGS.

Change-Id: Iad70e6bd4cb7cec9e0ece500a540e4dadc83d92e
ndroid.mk
0ed7e08cda2547fa6b23813035a7b34a8889d163 23-Jan-2015 Elliott Hughes <enh@google.com> Fix the stdio.fread_EOF test.

Another sizeof/strlen screwup caused by trying to be too clever. Use
std::string instead.

Also fix all the ASSERT_STREQ calls in this file that had the arguments
the right^Wwrong way round. If I ever see Kent Beck...

Change-Id: I47a1bdfee99cf4e7bed9b398f3158a308fbcf1e8
tdio_test.cpp
bcb378d643680719ec88587031a1571c87304736 22-Jan-2015 Elliott Hughes <enh@google.com> Fix fread_EOF test name.

Change-Id: I53a7f1428fd27c0b2a5c80f2e8af4845d17f5b4b
tdio_test.cpp
8c4994bbc1a9a01e34ea92c91eb5b2d1a27bd074 21-Jan-2015 Elliott Hughes <enh@google.com> Implement __fsetlocking.

The old __isthreaded hack was never very useful on Android because all user
code runs in a VM where there are lots of threads running. But __fsetlocking
lets a caller say "I'll worry about the locking for this FILE*", which is
useful for the normal case where you don't share a FILE* between threads
so you don't need any locking.

Bug: 17154740
Bug: 18593728
Change-Id: I2a8dddc29d3edff39a3d7d793387f2253608a68d
tdio_ext_test.cpp
c053a42831165044cca0bb9eb220b8f5d27fdd18 21-Jan-2015 Elliott Hughes <enh@google.com> Merge "Optimized fread."
75b99387dd3a8833f09e2139e7062be5d38c5511 20-Jan-2015 Elliott Hughes <enh@google.com> Optimized fread.

This makes us competitive with glibc for fully-buffered and unbuffered reads,
except in single-threaded situations where glibc avoids locking, but since
we're never really single-threaded anyway, that isn't a priority.

Bug: 18593728
Change-Id: Ib776bfba422ccf46209581fc0dc54f3567645b8f
tdio_test.cpp
516eb531137a50e2fd82108c5b7a43b87c103312 20-Jan-2015 Yabin Cui <yabinc@google.com> Remove testcase time printing in bionic-unit-tests.

Bug: 19075565
Change-Id: Icccb60657a2985e96abb1703673f0ebe2199586a
test_main.cpp
6104eb9fa7a23ef1ce779073eb8cd28194e4c164 20-Jan-2015 Yabin Cui <yabinc@google.com> Add target libbionic_gtest_main for cts test.

Bug: 17589740
Change-Id: I37f2d3fe72870b9dc867407fa1619c9a6fcd5cbb
ndroid.mk
1d7b3f3ccc4f2883cbc0fe677dff888c56c18996 20-Jan-2015 Elliott Hughes <enh@google.com> Merge "Improve <stdio_ext.h> testing."
df8f1a42d1cde97bcd46f5a29a67a44330c5c4f2 17-Jan-2015 Elliott Hughes <enh@google.com> Improve <stdio_ext.h> testing.

I almost fixed a non-bug. Add a test to prevent me from doing that.

Change-Id: I4a1dc13e603a7a377bdaee2e78132015087f7107
tdio_ext_test.cpp
cfe7e75fc13afb987d86aaaee305040f3369f797 16-Jan-2015 Yabin Cui <yabinc@google.com> Merge "Make sys_resource test more robust."
4853f40f3fb6664cb1b7af97b6b3e795717026b1 05-Jan-2015 Yabin Cui <yabinc@google.com> Make sys_resource test more robust.

"ulimit -c xxx" command may run before bionic-unit-tests.
Make sure sys_resource test fails gently in that case.

Change-Id: Ic3b5ed8b20acba56df8c5ef082c88e5050e761aa
ys_resource_test.cpp
19e246dda6772ffc532b1762cd7870d6c3b01c12 18-Dec-2014 Yabin Cui <yabinc@google.com> Fix possible leak in pthread_detach.

If pthread_detach() is called while the thread is in pthread_exit(),
it takes the risk that no one can free the pthread_internal_t.
So I add PTHREAD_ATTR_FLAG_ZOMBIE to detect this, maybe very rare, but
both glibc and netbsd libpthread have similar function.

Change-Id: Iaa15f651903b8ca07aaa7bd4de46ff14a2f93835
thread_test.cpp
deab11acd7000573ad9c034e5bf9475aadbc5cbe 15-Jan-2015 Yabin Cui <yabinc@google.com> Merge "Make bionic-unit-tests default run isolate mode."
a35cd8cdc2d43c8352011c5177af09adc2225c4e 13-Jan-2015 Yabin Cui <yabinc@google.com> Test that ip6-localhost exists in etc/hosts.

Addition change: make netdb_test pass on host.

Bug: 18791191
Change-Id: I7a9e29aa559ff6557288b47323d8a436379201a2
etdb_test.cpp
be837360c38d365c2d5e70f87fae1a42c520acb0 03-Jan-2015 Yabin Cui <yabinc@google.com> Make bionic-unit-tests default run isolate mode.

Fix bug of handling signal terminated tests.

Bug: 17589740
Bug: 18951146
Change-Id: I4803382b26cd5454693090202b3ba38e3dbe66e5
test_main.cpp
c62a4b5a7aede760b06298f4b641b5a9768f5744 09-Jan-2015 Elliott Hughes <enh@google.com> Fix freeaddrinfo(NULL).

Bug: https://code.google.com/p/android/issues/detail?id=13228
Change-Id: I5e3b126d90d750a93ac0b8872198e50ba047e603
etdb_test.cpp
917d390510e442b9b030d54992ebf41cc1e7f853 08-Jan-2015 Yabin Cui <yabinc@google.com> Make pthread stack size match real range.

Bug: 18908062
Change-Id: I7037ac8273ebe54dd19b1561c7a376819049124c
thread_test.cpp
bfa15e464ecfb43d93e468f166d91e4e6265f300 08-Jan-2015 Dmitriy Ivanov <dimitry@google.com> Set linux 32bit personality for 32 bit processes

Bug: 18069809
Change-Id: Ie143d56b0f8f03510dc451649291067e1add1d2f
ndroid.mk
ys_personality_test.cpp
597800f1d71590fc9ad51ce5227280586b2ceda5 02-Jan-2015 Yabin Cui <yabinc@google.com> Merge "better gtest runner for bionic"
541b0b187dd91684efdcebf72c8830e976ca04a6 02-Jan-2015 Yabin Cui <yabinc@google.com> Merge "Reserve enough user request stack space in pthread_create."
6a7aaf46759db32c6ed0eb953a4a230dc96af0d9 23-Dec-2014 Yabin Cui <yabinc@google.com> Reserve enough user request stack space in pthread_create.

Bug: 18830897
Change-Id: I1ba4aaeaf66a7ff99c5d82ad45469011171b0a3b
thread_test.cpp
ba09edcb41799e037780b92ddcbe6bd08bac5996 21-Dec-2014 Elliott Hughes <enh@google.com> Merge "Fix nan output in the printf family."
1b18aff9ba7c06e0e41ccafd22e1a4a585f86d78 16-Dec-2014 Elliott Hughes <enh@google.com> Fix nan output in the printf family.

Bug: https://code.google.com/p/android/issues/detail?id=82452
Change-Id: I51f226c8b033de6e81baeea5e6db3de6ed196f73
tdio_test.cpp
370a3e573d1cdff6070c77322d4a07bd53e5db3c 18-Dec-2014 Yabin Cui <yabinc@google.com> Merge "Sync with upstream for gethnamaddr.c."
58d33a51f336d6823ef1ec915949a5884699ff5f 17-Dec-2014 Yabin Cui <yabinc@google.com> Sync with upstream for gethnamaddr.c.

Bug: 18566967
Change-Id: I37e7410226b49eec67614e20b2c1d5e3e47817a5
etdb_test.cpp
92b9cb2c899c386954b8f9ad8111aa6c8c63e306 16-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add another test for weak-reference"
bfa88bca5ca387d6b3560074050856527cfc7514 16-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Add another test for weak-reference

This one covers undefined weak reference in .so
referenced via JUMP_SLOT relocation.

Bug: 17526061
Change-Id: Ib8764bd30c1f686c4818ebbc6683cf42dee908b2
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_weak_undefined.cpp
294d1e2c9e17873a0ce1c23cb2a559fc04f610be 08-Dec-2014 Yabin Cui <yabinc@google.com> better gtest runner for bionic

1. option to run each test in a separate forked process: "--isolate".
2. warnings about slow tests: "--warnline".
3. run multiple tests at the same time: "-j N".

Bug: 17589740
Change-Id: Ife5f4cafec43aa051ad7bd9c9b2b7e2e437db0de
ndroid.mk
lext_test.cpp
test_main.cpp
ys_socket_test.cpp
6c238f2926e69a950f0671ae5519584c20d84196 12-Dec-2014 Yabin Cui <yabinc@google.com> Fix pthread key num calculation.

Bug: 18723085
Change-Id: Iba2c834b350e4cdba0b2d771b221560a3e5df952
thread_test.cpp
nistd_test.cpp
562ae1e6e42e83f674507d2b915deb503200befe 11-Dec-2014 Yabin Cui <yabinc@google.com> make stack_protector_DeathTest work for gcc4.9

Bug: 18721888
Change-Id: I5f0b5c84319f56dbc4efb88e9d828138944667ae
tack_protector_test.cpp
1510a1c1ae1068ee75a1577ad1052fe5c3169816 10-Dec-2014 Elliott Hughes <enh@google.com> Fix the setjmp tests for mips.

Although the LP32 mips sigset_t is large enough to represent all signals,
their jmp_buf is too small. This test succeeded on arm and x86 because the
RT signals were never in the 'expected' sigset_t, so the equality comparison
with the 'actual' sigset_t worked fine --- everyone was blind to the RT
signal. On mips the tests fail because the 'expected' sigset_t does contain
the RT signal but the 'actual' doesn't because the jmp_buf only saves and
restores the first 32 signals.

There are 32 free bits (currently used as padding) in the LP32 mips jmp_buf,
and they might choose to use those to provide better support than the other
two platforms, but I'll leave that to them. It will be easy to just remove
the #if defined(__LP64__) from this change in that case.

For mips64 it's not to late to increase the size of the jmp_buf and fix
the setjmp family, but since there are decisions to be made here for LP32,
I'll leave it all to Imagination folks...

Bug: 16918359
Change-Id: I6b723712fce0e9210dafa165d8599d950b2d3500
etjmp_test.cpp
94926f8cfa0adf37c4e19256ade7261a97f72e51 09-Dec-2014 Yabin Cui <yabinc@google.com> Merge "support _POSIX_REALTIME_SIGNALS"
b033761cbf0e79ade9a8c956c2e63b42ee838183 09-Dec-2014 Yabin Cui <yabinc@google.com> Merge "Change _POSIX_CPUTIME macro to make it compitable with glibc."
725756045e03ea6f7ef00d02e883ef2914d06dde 08-Dec-2014 Yabin Cui <yabinc@google.com> Change _POSIX_CPUTIME macro to make it compitable with glibc.

Change-Id: I7a8dbb74bd622693c9fef60bd779687207517b7d
nistd_test.cpp
634816055f51c536d24dea30dfe930b7fe2fa603 02-Dec-2014 Yabin Cui <yabinc@google.com> support _POSIX_REALTIME_SIGNALS

Bug: 18489947
Change-Id: I2e834d68bc10ca5fc7ebde047b517a3074179475
copedSignalHandler.h
thread_test.cpp
ignal_test.cpp
nistd_test.cpp
1c0c0ede573e3caf86b6fc395ba933bfb7235afa 06-Dec-2014 Elliott Hughes <enh@google.com> Fix signal mask save/restore for x86-64.

Bug: 16918359
Change-Id: I30bf61e7d5f1c21daa3a1a21d361e98d77220bf3
etjmp_test.cpp
5afae64a1bac56638c6348f0c8f5e9d61b654029 26-Nov-2014 Yabin Cui <yabinc@google.com> implement posix_madvise

Bug: 18472477
Change-Id: I8183de6c281acf69ed5f7f88351b056b9827b162
ys_mman_test.cpp
nistd_test.cpp
65f0df78730fb0d6994f9d4d0a16dc0241081d94 03-Dec-2014 Elliott Hughes <enh@google.com> Implement <pty.h>.

Based on the package/apps/Terminal implementation. I'll switch them over
shortly. This also lets us build the toybox version of netcat.

Change-Id: Ia922a100141a67409264b43b937eeca07b21f344
ndroid.mk
ty_test.cpp
tmp_test.cpp
6995c1dcb5a9ad77a54d950fc24f5aba00909b69 03-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Extract bionic-prepare-run-on-host to inc file."
06b1b8ceac992b861cc8a4fe21a3f8d5a40bb99c 02-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Extract bionic-prepare-run-on-host to inc file.

Make benchmark run-on-host depend on bionic-prepare-run-on-host.

Change-Id: I0bdbf561b2580d607a49b7c83cc273320ac55429
ndroid.mk
27d276f3a6d81d29fab13de96496efb7bc072773 02-Dec-2014 Elliott Hughes <enh@google.com> Avoid pathological behavior in OpenBSD's fread.

(cherry picked from commit 20841a137beac5caa824e3586c7bd91d879ff92e)

Bug: https://code.google.com/p/android/issues/detail?id=81155
Bug: 18556607
Change-Id: Ibdfebc20dce4c34ad565014523c9b074e90ea665
tdio_test.cpp
20841a137beac5caa824e3586c7bd91d879ff92e 02-Dec-2014 Elliott Hughes <enh@google.com> Avoid pathological behavior in OpenBSD's fread.

Bug: https://code.google.com/p/android/issues/detail?id=81155
Bug: 18556607
Change-Id: Idc60976b79610e2202cc42dc393dcb4ca6c42e05
tdio_test.cpp
a55126f1f615fc5e49b846ca1142a513a39a0ae1 02-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Create /system/lib(64)? symlinks for host tests.

Replace LD_LIBRARY_PATH with default path for
the tests run on host.

Bug: 18589961

Change-Id: Id4a84b73d25c2ca9c557fcfa19b8169daeaa016b
ndroid.mk
291dbf65cadeccbb33e60b33fbe9f5f48c8763ff 02-Dec-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Count references for groups instead of instances"
ab972b9adf8789a9e1b03129cd7f0c22e6bba117 29-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Count references for groups instead of instances

Count references on the group level to avoid
partially unloading function that might be
referenced by other libraries in the local_group

Bonus: with this change we can correctly unload recursively
linked libraries. is_recursive check is removed.

Also dynamic executables (not .so) with 0 DT_NEEDED libraries
are now correctly linked.

Change-Id: Idfa83baef402840599b93a875f2881d9f020dbcd
lfcn_test.cpp
ibs/Android.build.dlopen_2_parents_reloc.mk
ibs/Android.mk
ibs/dlopen_2_parents_reloc_answer.cpp
ibs/dlopen_testlib_invalid.cpp
ibs/dlopen_testlib_loopy_a.cpp
ibs/dlopen_testlib_loopy_b.cpp
ibs/dlopen_testlib_loopy_c.cpp
ibs/dlopen_testlib_loopy_invalid.cpp
ibs/dlopen_testlib_loopy_root.cpp
e323e99ffbf9e508e74a261f1075433f5a81677f 02-Dec-2014 Yabin Cui <yabinc@google.com> restore sigprocmask in setjmp/longjmp test.

Bug: 18571921
Change-Id: Ib8ca7a36abd3ccc729c20c0e32d45b1b33069f65
etjmp_test.cpp
tack_unwinding_test.cpp
3e6ef3f90285191976a60d7a94287fb0fec1af5d 01-Dec-2014 Yabin Cui <yabinc@google.com> Merge "support _POSIX_CPUTIME"
9fea4090f1160ad8ca77e7b2a9a1a81dc4376329 31-Oct-2014 Yongqin Liu <yongqin.liu@linaro.org> bionic tests: add setjmp/_setjmp/sigsetjmp tests.

Bug: 17288973
Change-Id: I2808eee58cbddae1b16fbe19a715b72d6dbaaec3
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
ndroid.mk
etjmp_test.cpp
d5c652756bb1a52959cd5c62447b62462f90f983 26-Nov-2014 Yabin Cui <yabinc@google.com> support _POSIX_CPUTIME

Bug: 18490039
Change-Id: I01fa83b48e1b908de1f227b6e4f98e280bcd50ee
ime_test.cpp
nistd_test.cpp
eb3a5e026e65ea80b17580a71f4451f5cf5d6612 24-Nov-2014 Yabin Cui <yabinc@google.com> Merge "flesh out sysconf(3) and the _POSIX_* constants"
1c19194c9d2518dbe86973cd313a277ecb70d75c 20-Nov-2014 Yabin Cui <yabinc@google.com> flesh out sysconf(3) and the _POSIX_* constants

Bug: 17571891
Change-Id: I81036615486bde65969ae5662587fcc88348474e
nistd_test.cpp
0864d8bc47d57a3e63c1444dad1e263dd310d64f 21-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Rename test_forked -> test_isolated

Change-Id: Ie72627e986c159832cbd3635d8ff5b1af3d5b1eb
test_ex.h
thread_test.cpp
8b4b82733877928da429e47d9a9bb73317517b2e 21-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add test_forked() option"
00e37818a704fdd3d5f6a59022eff3a29b03bcce 21-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Add test_forked() option

Executing test via test_forked() allows us to
avoid undesired global state changes in tests like
atexit, dlopen(.., RTLD_NODELETE) and similar.

Change-Id: I118cdf009269ab5dd7b117c9b61dafa47de2a011
test_ex.h
thread_test.cpp
770198d3f707d5eccd6796f311015903aec31b26 20-Nov-2014 Elliott Hughes <enh@google.com> Merge "Make the ftw(3) tests a bit more thorough."
63bd43bbdca967e2d9d8c0bfcd60d39ab661fa74 19-Nov-2014 Elliott Hughes <enh@google.com> Make the ftw(3) tests a bit more thorough.

These also test much of fts(3).

Change-Id: Ia9245d6acbbd071191563ab1b91a400044104028
tw_test.cpp
6b48b20a1e613dcb41704deb266142a7cc45588c 19-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Yet another relocation test"
7699d13a74769fe8063fcca95588c87c571226c0 19-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Yet another relocation test

This time we check if a -> b -> c function in 'a' relocates against
implementation in 'c'.

Change-Id: I528180c3efd346bd447ea0237e5a8a0ac3cc031f
ndroid.build.mk
lfcn_test.cpp
ibs/Android.build.dlopen_check_order_reloc_siblings.mk
ibs/dlopen_check_order_reloc_grandchild_answer.cpp
ibs/dlopen_check_order_reloc_grandchild_answer_impl.cpp
649f78df79bc45a46de9f3c391f395d5ab4fe73a 19-Nov-2014 Yabin Cui <yabinc@google.com> Merge "fix shared gid support in getpwnam/getgrnam"
a04c79b9d38cf9c8d3c79f4bbbfc45c9da9c0143 19-Nov-2014 Yabin Cui <yabinc@google.com> fix shared gid support in getpwnam/getgrnam

Bug: 18374693
Change-Id: I5353403cbbead6f6abac87bee2cf53a60dba408c
tubs_test.cpp
a2547055f25db614601ee8651f2e42ece01f7842 18-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Fix jump to unmapped memory on atexit

Split d-tor calls and soinfo_free to 2 separate steps

Bug: 18338888
Change-Id: Idbcb7242ade16fa18cba7fe30505ebd8d6023622
ibs/dlopen_check_order_reloc_nephew_answer.cpp
8eda0a6d69fda865b576bc18311a3d79c84b42a1 18-Nov-2014 Elliott Hughes <enh@google.com> Merge "libc: Fix mktime returns an uncorrect time in empty TZ case"
ee4c8febb7bd1f5492486cc11980f925425b02ec 17-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Merge "bionic/test: migrate sysconf tests from system/extras to bionic/tests"
f2c882095b5747cd7f3158428208580a7ff72ed6 17-Nov-2014 Elliott Hughes <enh@google.com> Merge "Add getaddrinfo(3) tests for NULL arguments."
32fea147eaac4b811440a29d362fdad7e2c5a4ec 16-Nov-2014 Elliott Hughes <enh@google.com> Add getaddrinfo(3) tests for NULL arguments.

According to https://github.com/ukanth/afwall/pull/213 some OEMs have
shipped a getaddrinfo(3) that crashes given NULL hostnames.

Change-Id: I9cea5fdd68546b7c64cf47e10e2b2b4d672b69d0
etdb_test.cpp
eef1eb64bb5be68bfb00f8e71d3118a2cfec99e7 15-Nov-2014 Dan Albert <danalbert@google.com> Merge "Allow asan for glibc tests."
01f1ff2440759e34197f741a7b380a71c607f513 15-Nov-2014 Dan Albert <danalbert@google.com> Allow asan for glibc tests.

SANITIZE_HOST will break if we don't allow ASAN.

Change-Id: I0beed82b058db391f633e0ea1098f140497c65d4
ndroid.build.mk
ndroid.mk
154e2026c83575eb17101df3a8d1192e305588d4 27-May-2014 Satoru Takeuchi <satoru.x.takeuchi@sonymobile.com> libc: Fix mktime returns an uncorrect time in empty TZ case

The mktime API returned an uncorrect time when TZ is set as empty.
A timezone UTC/GMT+0 should be implied in the empty case. However
mktime keeps previous information about timezone. If mktime was called
with a timezone which has DST before, the "defaulttype" member of
"state" structure wouldn't be 0. Then it would be used next time,
even though UTC/GMT+0 doesn't have DST.

Added initialization of the "defaulttype" in the empty TZ case.

Change-Id: Ic480c63c548c05444134e0aefb30a7b380e3f40b
ime_test.cpp
bc6447673fba0b38d948dcd627ab6744395c771a 25-Sep-2014 Derek Xue <derek.xue@linaro.org> bionic/test: migrate sysconf tests from system/extras to bionic/tests

The old test are implemented in file:
system/extras/tests/bionic/libc/other/test_sysconf.c
This change is to migrate them to bionic/tests with the gtest format.

and since the sysconf is defined in unistd.h, will put the test under
bionic/tests/unistd_test.cpp file as unistd.syscon test

Change-Id: Ie519147c1c86a6c4cefa8c88b18bf58bdfbffbdb
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
nistd_test.cpp
9d93986481b67a8135e57fc6400ca8c59f7375f6 15-Nov-2014 Yabin Cui <yabinc@google.com> Add functions in sysinfo.h.

Bug: 17703902

Change-Id: I699d12d76a8fc483c919be730c2ac63641b71a1d
ndroid.mk
ys_sysinfo_test.cpp
661423a453b2692d592df56307a876dfc35c50f2 15-Nov-2014 Yabin Cui <yabinc@google.com> Merge "Increase support of pathconf options."
b5e581abfe28de8ed6c8c8af1c265bb4e36f97bb 08-Nov-2014 Yabin Cui <yabinc@google.com> Increase support of pathconf options.

Bug: 18206366
Change-Id: Ie770e49f5af3631eb9fbd2cd5174edf004c81e00
nistd_test.cpp
9df4b13baff9f958ad39a8cff59924c157978dac 14-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Fix host build for arm/arm64

Change-Id: Id92543e4080aede205b3e63099fa2baa36ba21f0
ibs/Android.mk
b3356773c6b5fbbbb26d22b3d6c6e0e598840e44 14-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Add test for --hash-style=sysv

With build system switched to gnu-hash we need
a test for sysv-hashed library.

Change-Id: I34adc216fa79199aa46066cf13fcc1c1f2581f0e
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
59b1dea8829b081e23c3156b44af624bf8fac962 14-Nov-2014 Christopher Ferris <cferris@google.com> Merge "Add missing function prototypes wcpcpy/wcpncpy."
5c7d9584d90f9516fb1df0dcdf3b804139794474 14-Nov-2014 Christopher Ferris <cferris@google.com> Add missing function prototypes wcpcpy/wcpncpy.

Also add smoke tests for a few of the wchar functions.

Change-Id: Id1be522f55a6708564d444941f42097548f16497
char_test.cpp
e3c4acf1e3ef36c2ab1f48b1261dec9a1d8330a4 13-Nov-2014 Elliott Hughes <enh@google.com> Fix our <mntent.h> implementation.

Used by toybox.

Change-Id: I36a5053423e5cc54ae02a68f4fe110d75134accd
ntent_test.cpp
68d98d832b7935ed5be23836c481a14f00b19ef1 13-Nov-2014 Elliott Hughes <enh@google.com> Assume glibc >= 2.15.

This catches one trivial difference between us and glibc --- the error
returned by pthread_setname_np for an invalid pthread_t.

Change-Id: If4c21e22107c6488333d11184f8005f8669096c2
thread_test.cpp
ys_socket_test.cpp
92a585c91a83e63949431c617de936742b080150 13-Nov-2014 Elliott Hughes <enh@google.com> Merge "Fix glibc 2.15 build."
fb50057138ef37232dc67c8559fd26719ee26021 13-Nov-2014 Elliott Hughes <enh@google.com> 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
tring_posix_strerror_r_test.cpp
ys_resource_test.cpp
nistd_test.cpp
ec18ce06f2d007be40ad6f043058f5a4c7236573 10-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Add support for hash-style=gnu

Change-Id: I171434a587420895feac8a9b1ad2342087197568
lfcn_test.cpp
ibs/Android.mk
e5cabca516252addb5e305c8e1e0f35cafbcafbe 12-Nov-2014 Yabin Cui <yabinc@google.com> Merge "implement missing seekdir and telldir"
bbdfa518830d49565966acea02796769434e0d74 12-Nov-2014 Elliott Hughes <enh@google.com> Merge "gethostname.c: change to report ENAMETOOLONG error when buflen is less"
83204d5708eb49df05ea365be01e136ef7823752 12-Nov-2014 Elliott Hughes <enh@google.com> Merge "bionic tests: migrate gethostname test to unistd_test.cpp from system/extras"
2f954bab2d524f6afed8a443c2a7ee32876db0fa 30-Oct-2014 Yongqin Liu <yongqin.liu@linaro.org> gethostname.c: change to report ENAMETOOLONG error when buflen is less

change to behaviour the same as glibc for the check about buflen

Change-Id: I98265a8fe441df6fed2527686f89b087364ca53d
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
nistd_test.cpp
d94e7f0f1d95e0da73fca8d591fdb56b69d82653 25-Sep-2014 Derek Xue <derek.xue@linaro.org> bionic tests: migrate gethostname test to unistd_test.cpp from system/extras

The old tests are implemented in file
system/extras/tests/bionic/libc/common/test_gethostname.c
Here migrate the test to the tests/unistd_test.cpp file and
add some more checks

Change-Id: Iab1e3da873bb333d1ddefc03108d536933792db2
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
nistd_test.cpp
1468765f8ab81ae9e32638d25c14e1f5dd35da2b 10-Nov-2014 Christopher Ferris <cferris@google.com> Add align/overread tests for strlcpy/strlcat.

Change-Id: I2801c7ee1847cd68ec95eba5bdffde5e52edf1e5
tring_test.cpp
b86a4c7f651ab347611847e4f5a1a50d6ee1827b 08-Nov-2014 Elliott Hughes <enh@google.com> Add sethostname(2).

Not very useful, but helps building stuff like toybox out of the box.

Change-Id: I110e39030452bd093a84278e019c5752d293718d
nistd_test.cpp
5ca4a9e2da46db30ad6d8556b61679d138aaf88d 07-Nov-2014 Yabin Cui <yabinc@google.com> implement missing seekdir and telldir

Bug: 18266863
Change-Id: I189ee949d4f7ccee099f3341e349cd969d25480f
irent_test.cpp
tdio_test.cpp
b20c24456e43df430ec5626a68e5dc0dc6929344 07-Nov-2014 Elliott Hughes <enh@google.com> Implement all the POSIX _l functions.

Strictly speaking, this only implements the _l variants of the functions
we actually have. We're still missing nl_langinfo_l, for example, but we
don't have nl_langinfo either.

Change-Id: Ie711c7b04e7b9100932a13f5a5d5b28847eb4c12
trings_test.cpp
274afe8f0eab4139c94d5f8b1ee3d267f449ef42 06-Nov-2014 Elliott Hughes <enh@google.com> Add POSIX lcong48.

Change-Id: I821046816661d77275cb02c8c99d526bb41afb9c
tdlib_test.cpp
39ba30354a3890dd653ab55819d38eed3855edaa 06-Nov-2014 Elliott Hughes <enh@google.com> Merge "Fix our <complex.h> support."
b8ee16f1dc1253e3f1c99b4a6b9df249515cd919 06-Nov-2014 Elliott Hughes <enh@google.com> Fix our <complex.h> support.

We build libm with -fvisibility=hidden, so we weren't exporting any
of the <complex.h> functions.

We also weren't building many of the functions anyway.

We were also missing the complex inverse trigonometric functions.

And because we didn't even have perfunctory "call each function once"
tests, we didn't notice that we weren't exporting any symbols, so this
patch adds at least that level of testing.

Change-Id: Ibcf2843f507126c51d134cc5fc8d67747e033a0d
ndroid.mk
omplex_test.cpp
9df70403d95f5cfe6824e38a9a6c35f9b9bbc76a 06-Nov-2014 Yabin Cui <yabinc@google.com> make all bionic death tests not dumpable

Bug: 18067305

Change-Id: Ia1ecacf47eddecc9bc58aaac779e0c218f463179
ionicDeathTest.h
ortify_test.cpp
thread_test.cpp
tack_protector_test.cpp
tdlib_test.cpp
ystem_properties_test.cpp
nistd_test.cpp
2311383180aee9388d28b03901a1e4ef021bcfa7 05-Nov-2014 Yabin Cui <yabinc@google.com> Merge "check invalid file offset when loading library"
c13a2044e3b4d6084ef7ed32fb35e63e4157a96a 05-Nov-2014 Elliott Hughes <enh@google.com> Merge "Fix newlocale with a NULL locale name."
7e0d0f8572152c47a993e7bc8407690556754bd4 05-Nov-2014 Elliott Hughes <enh@google.com> Fix newlocale with a NULL locale name.

Bug: https://code.google.com/p/android/issues/detail?id=78567
Change-Id: I272dabc12ab186b44a525c7e8ac1846e62334e85
ocale_test.cpp
1b37ba2178d618221905e17436f38e0c5a8397f3 04-Nov-2014 Elliott Hughes <enh@google.com> Improve math tests to allow a specific ulp bound.

At the moment our libm is only good enough for a 1 ulp bound on these tests,
but that's better than the 4 ulp bound you get from gtest by default.

I'm not really happy with the multiple structures and corresponding functions,
but at least they mean there's no duplication in the tests themselves, and it
should be easy enough for us to make further improvements in future.

Change-Id: I004e12970332e1d9531721361d6c34f908cfcecc
ndroid.mk
ath_cos_intel_data.h
ath_cos_test.cpp
ath_cosf_intel_data.h
ath_cosf_test.cpp
ath_data_test.h
ath_exp_intel_data.h
ath_exp_test.cpp
ath_expf_intel_data.h
ath_expf_test.cpp
ath_log_intel_data.h
ath_log_test.cpp
ath_logf_intel_data.h
ath_logf_test.cpp
ath_pow_intel_data.h
ath_pow_test.cpp
ath_powf_intel_data.h
ath_powf_test.cpp
ath_sin_intel_data.h
ath_sin_test.cpp
ath_sincos_intel_data.h
ath_sincos_test.cpp
ath_sincosf_intel_data.h
ath_sincosf_test.cpp
ath_sinf_intel_data.h
ath_sinf_test.cpp
ath_tan_intel_data.h
ath_tan_test.cpp
ath_tanf_intel_data.h
ath_tanf_test.cpp
ath_test.cpp
16f7f8d2503a9033a09a4d7e857561d63471bb82 04-Nov-2014 Yabin Cui <yabinc@google.com> check invalid file offset when loading library

Bug: 18178121
Bug: 18078224

Change-Id: I5254433d54645db68e9b83d5095dc2bf9d8531bc
lext_test.cpp
9d3382d97a2cdc8c8f78c7825ece16f09292fc36 04-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Fix dlsym() to take into account RTLD_GLOBAL/LOCAL"

This reverts commit c85e82dde5c4b2accc50a9e17740b9005dfbae6a.

Bug: 18222321
Bug: 18211780
Change-Id: I32f4048bd5ea85dc8a3dfccce8cf141b241ab692
lfcn_test.cpp
ibs/dlopen_testlib_simple.cpp
69c5d108a5cb44167a04d42ffdad6a39648ed235 04-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Add RTLD_NODELETE flag support"

This reverts commit c87f65d2cd0690d81665f8b241c1d763f72b6f80.

Bug: 18222321
Bug: 18211780
Change-Id: I00252e26a28a41ab9f1e2dd3b32f0f80d86297f1
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_nodelete_1.cpp
ibs/dlopen_nodelete_2.cpp
ibs/dlopen_nodelete_dt_flags_1.cpp
00dce525530c5d26c20750863f3e9890b468787a 04-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Fix relocation to look for symbols in local group"

This reverts commit fd2747bb585fc51b5ad56db09c0e9b66c7091a92.

Bug: 18222321
Bug: 18211780
Change-Id: I2d4ebab1e73b7277161af76b99f8249825b22d65
lfcn_test.cpp
ibs/Android.build.dlopen_check_order_dlsym.mk
ibs/Android.build.dlopen_check_order_reloc_main_executable.mk
ibs/Android.build.dlopen_check_order_reloc_siblings.mk
ibs/Android.mk
ibs/dlopen_check_order_dlsym_answer.cpp
ibs/dlopen_check_order_reloc_answer.cpp
ibs/dlopen_check_order_reloc_answer_impl.cpp
ibs/dlopen_check_order_reloc_nephew_answer.cpp
ibs/dlopen_check_order_reloc_root_answer.cpp
ibs/dlopen_check_order_reloc_root_answer_impl.cpp
ibs/dlopen_testlib_answer.cpp
f947be2889639defc6424b1813ccc779528b7598 04-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Fix symbol lookup order during relocation"

This reverts commit 976402cca13a1f4f3aa988fd301575e134ef5f2c.

Bug: 18222321
Bug: 18211780
Change-Id: Iafdd3d843db7b1cf288be9a0232022816622c944
ndroid.mk
l_test.cpp
lfcn_test.cpp
ibs/Android.mk
ibs/dl_df_1_global.cpp
ibs/dl_df_1_use_global.cpp
ibs/dl_preempt_library_1.cpp
ibs/dl_preempt_library_2.cpp
494bee796aa60131981308493e0e295493537e12 04-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Fix arm64 and arm builds."

This reverts commit 445111a1c977e94a4233efd54f3690defa4a7582.

Bug: 18222321
Bug: 18211780
Change-Id: I4fa9e1b63ec9b528f8bfed73c2ec15046c43a2fe
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
d18f4b25785761c022906b93b2123b3be90182e8 03-Nov-2014 Elliott Hughes <enh@google.com> Ensure we initialize stdin/stdout/stderr's recursive mutexes.

(cherry-pick of 6a03abcfd23f31d1df06eb0059830e22621282bb.)

Bug: 18208568
Change-Id: I9da16ce0f9375bc363d1d02be706d73fd3b1e150
tdio_test.cpp
695781b6f0419f82939176a6ec1a240300d9f036 03-Nov-2014 Dan Albert <danalbert@google.com> Merge "Make host tests depend on /system/etc/hosts."
62b727978933160ae7a32a27b9a5e4fbb9d575e2 03-Nov-2014 Dan Albert <danalbert@google.com> Make host tests depend on /system/etc/hosts.

Change-Id: I3e5ab1325d5e250a1d14b53f3a5a465d9f5de30c
ndroid.mk
6a03abcfd23f31d1df06eb0059830e22621282bb 03-Nov-2014 Elliott Hughes <enh@google.com> Ensure we initialize stdin/stdout/stderr's recursive mutexes.

Bug: 18208568
Change-Id: I9da16ce0f9375bc363d1d02be706d73fd3b1e150
tdio_test.cpp
445111a1c977e94a4233efd54f3690defa4a7582 01-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Fix arm64 and arm builds.

Bug: 18186310

(cherry picked from commit 4e446b19d8710cd2004785db4a00f18f249fe73f)

Change-Id: Ibc77a9ade36dc6b9bf5a316b5ab9ae5f0a70e826
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
4e446b19d8710cd2004785db4a00f18f249fe73f 01-Nov-2014 Dmitriy Ivanov <dimitry@google.com> Fix arm64 and arm builds.

Change-Id: I2c8c41626768e792f27a2616f2cd5ae66606319d
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
976402cca13a1f4f3aa988fd301575e134ef5f2c 28-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Fix symbol lookup order during relocation

Relocate symbol against DF_1_GLOBAL shared libraries
loaded before this shared library. This includes
main executable, ld_preloads and other libraries
that have DF_1_GLOBAL flag set.

Bug: 2643900
Bug: 15432753
Bug: 18186310

(cherry picked from commit d225a5e65223b375a63548c4b780f04d8f3d7b60)

Change-Id: I4e889cdf2dfbf8230b0790053d311ee6b0d0ee2d
ndroid.mk
l_test.cpp
lfcn_test.cpp
ibs/Android.mk
ibs/dl_df_1_global.cpp
ibs/dl_df_1_use_global.cpp
ibs/dl_preempt_library_1.cpp
ibs/dl_preempt_library_2.cpp
fd2747bb585fc51b5ad56db09c0e9b66c7091a92 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Fix relocation to look for symbols in local group

The local group is a sequence of libraries in default (breadth-first)
order. It allows RTLD_LOCALLY loaded library to correctly relocate
symbols within its group (see test-cases).

Local group lookup is performed after main executable and ld_preloads.

Bug: 2643900
Bug: 15432753
Bug: 18186310

(cherry picked from commit cfa97f172dc1b10d650fefbb6ccffd88ce72a5fb)

Change-Id: I5fa8c673f929e4652c738912c7ae078d7ec286d2
lfcn_test.cpp
ibs/Android.build.dlopen_check_order_dlsym.mk
ibs/Android.build.dlopen_check_order_reloc_main_executable.mk
ibs/Android.build.dlopen_check_order_reloc_siblings.mk
ibs/Android.mk
ibs/dlopen_check_order_dlsym_answer.cpp
ibs/dlopen_check_order_reloc_answer.cpp
ibs/dlopen_check_order_reloc_answer_impl.cpp
ibs/dlopen_check_order_reloc_nephew_answer.cpp
ibs/dlopen_check_order_reloc_root_answer.cpp
ibs/dlopen_check_order_reloc_root_answer_impl.cpp
ibs/dlopen_testlib_answer.cpp
4d0c1f673f8a22f5415b9a879e4544f6bcfe419c 17-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Correct way to specify additional dependencies

Previous one was not covering all the targets

Bug: 17548097
Bug: 18186310

(cherry picked from commit 4a9e1937c56511aef579312bf39ab345f9179230)

Change-Id: I2cd9e58893555d16cbfe291b2d1279621489d5ad
ndroid.build.mk
ndroid.mk
ibs/Android.mk
382e06ce8eab506276aaad39da3fbd533ef898d2 31-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Add dlfcn_test to glibc test suite.

Bug: 18186310

(cherry picked from commit eb27bbae8f0edc6b62ca2db73256c7fb53b9e9bf)

Change-Id: I1d608dfa12dbafbdcdb8bc6d818c5872404c19e0
ndroid.mk
lfcn_test.cpp
ibs/Android.build.testlib.mk
ibs/Android.mk
ibs/dlopen_testlib_simple.cpp
c87f65d2cd0690d81665f8b241c1d763f72b6f80 20-May-2014 Dmitriy Ivanov <dimitry@google.com> Add RTLD_NODELETE flag support

Bug: 18186310
Bug: https://code.google.com/p/android/issues/detail?id=64069

(cherry picked from commit 1b20dafdbe65e43b9f4c95057e8482380833ea91)

Change-Id: Ic02eec22a7c322ece65eb40730a3404f611526b1
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_nodelete_1.cpp
ibs/dlopen_nodelete_2.cpp
ibs/dlopen_nodelete_dt_flags_1.cpp
c85e82dde5c4b2accc50a9e17740b9005dfbae6a 16-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Fix dlsym() to take into account RTLD_GLOBAL/LOCAL

Symbols from libraries opened with RTLD_LOCAL (default)
should not be visible via dlsym(RLTD_DEFAULT/RTLD_NEXT, .)

Bug: 17512583
Bug: 18186310

(cherry picked from commit e8ba50fe0d51fbefee1a8f5bb62bf51d841512c8)

Change-Id: Idf6bbe2233fb2bfc0c88677e7d1fc518fb3f7a8b
lfcn_test.cpp
ibs/dlopen_testlib_simple.cpp
d225a5e65223b375a63548c4b780f04d8f3d7b60 28-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Fix symbol lookup order during relocation

Relocate symbol against DF_1_GLOBAL shared libraries
loaded before this shared library. This includes
main executable, ld_preloads and other libraries
that have DF_1_GLOBAL flag set.

Bug: 2643900
Bug: 15432753
Change-Id: Ia788748be59b739d1c7e62b978e7e255f9e65c7b
ndroid.mk
l_test.cpp
lfcn_test.cpp
ibs/Android.mk
ibs/dl_df_1_global.cpp
ibs/dl_df_1_use_global.cpp
ibs/dl_preempt_library_1.cpp
ibs/dl_preempt_library_2.cpp
89aaaffbf8f2d09b56c1cc1345cdaf28c331ab5e 29-Oct-2014 Elliott Hughes <enh@google.com> Extra strtod/strtof tests.

Check that libc doesn't suffer from a couple of bugs that affected
Java in the past.

Bug: 2206701
Change-Id: I9eb64d7ff2fa0b79e93079b897a5fb78bef866be
tdlib_test.cpp
22e2c9d963e0dde19e5876ab8dfc3576efc42ccc 05-Sep-2014 Elliott Hughes <enh@google.com> Fix mips signed/unsigned signal_test.cpp build breakage.

(cherry picked from commit aa13e839f06231b9299bb683a71abd954294b49b)

Bug: 17436734
Change-Id: I167fc5d74c49cca7031c5739bc53fdf3bde71887
ignal_test.cpp
28ea229bb29f3ee82991ca8b5ac5f7a9b7b89fdc 04-Sep-2014 Elliott Hughes <enh@google.com> Don't mask out SA_RESTORER from sa_flags.

glibc doesn't do this, and we probably shouldn't either.

Bug: 16703540
Bug: 17436734

(cherry picked from commit afe58ad9892de27a7acb0aaded6312ee0f958314)

Change-Id: Iada5d0ae814f438cb276f056b2b5e3675f0e3666
ignal_test.cpp
8eb8c3929974060e0d8b5063886d6ed250198d41 26-Sep-2014 Pavel Chupin <pavel.v.chupin@intel.com> [x86,x86_64] Fix libgcc unwinding through signal

This change provides __restore/__restore_rt on x86 and __restore_rt on
x86_64 with unwinding information to be able to unwind through signal
frame via libgcc provided unwinding interface. See comments inlined for
more details.

Also remove the test that had a dependency on
__attribute__((cleanup(foo_cleanup))). It doesn't provide us with any
better test coverage than we have from the newer tests, and it doesn't
work well across a variety architectures (presumably because no one uses
this attribute in the real world).

Tested this on host via bionic-unit-tests-run-on-host on both x86 and
x86-64.

Bug: 17436734
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

(cherry picked from commit 50321e2e66f19998970e59d666bc9af387345b3a)

Change-Id: Iba90e36958b00c7cc7db5eeebf888dc89ce4d619
ndroid.mk
copedSignalHandler.h
tack_unwinding_test.cpp
tack_unwinding_test_impl.c
190dce9e56c750be6b8d113ffdd32a9c20c19e3d 18-Sep-2014 Elliott Hughes <enh@google.com> Stack unwinding unit tests.

Bug: 17436734

(cherry picked from commit bee1993a14b47bc7acda544242f405ae45e42566)

Change-Id: I7205a862ba2c3b474e287f5e9c8982cef4610af9
ndroid.mk
tack_unwinding_test.cpp
tack_unwinding_test_impl.c
50321e2e66f19998970e59d666bc9af387345b3a 26-Sep-2014 Pavel Chupin <pavel.v.chupin@intel.com> [x86,x86_64] Fix libgcc unwinding through signal

This change provides __restore/__restore_rt on x86 and __restore_rt on
x86_64 with unwinding information to be able to unwind through signal
frame via libgcc provided unwinding interface. See comments inlined for
more details.

Also remove the test that had a dependency on
__attribute__((cleanup(foo_cleanup))). It doesn't provide us with any
better test coverage than we have from the newer tests, and it doesn't
work well across a variety architectures (presumably because no one uses
this attribute in the real world).

Tested this on host via bionic-unit-tests-run-on-host on both x86 and
x86-64.

Bug: 17436734
Change-Id: I2f06814e82c8faa732cb4f5648868dc0fd2e5fe4
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ndroid.mk
copedSignalHandler.h
tack_unwinding_test.cpp
tack_unwinding_test_impl.c
ed29e858d09906bc28e79d919af1d09f0538a464 27-Oct-2014 Elliott Hughes <enh@google.com> pthread_setname_np appears in glibc 2.12.

And our emulator kernels are now new enough to not require a workaround.

Change-Id: Id56c983dbfd8abc69f72a78411a5502391941dfc
thread_test.cpp
095636e6adb5d73e7727596786d4b8dbdb0a6b03 25-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Fix *tests-run-on-host target

Change-Id: Id0e5060977a2df91c47b5a916989eb7e2e3f8153
ndroid.mk
4199695657e9500db14ab40392e3715db1826002 25-Sep-2014 Derek Xue <derek.xue@linaro.org> bionic tests: migrate test for mutex type from system/extras

Migrate the test about pthread mutex type in file
system/extras/tests/bionic/libc/bionic/test_mutex.c
to the new place
bionic/tests/pthread_test.cpp
in the gtest format.

Change-Id: I6aab10170ccad5b9a4892d52dba2403876c86659
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
thread_test.cpp
57c5a5562b08007dbe6379a4b68ca3a0225747c0 24-Oct-2014 Chih-Hung Hsieh <chh@google.com> Merge "Disable clang compilation due to lack of ifunc."
b08629862968772c35418698c7d6d99a5110f3f7 24-Oct-2014 Chih-Hung Hsieh <chh@google.com> Disable clang compilation due to lack of ifunc.

BUG: 18055309
Change-Id: I0f36011cf7872a20ddd36a6c3c607eb96f0a8ec2
ibs/Android.mk
1e8ebdc3754178b68bbb0ac15ec9569738f5fc02 24-Oct-2014 Elliott Hughes <enh@google.com> Make the netdb unit tests work on the host.

Bug: 18111005
Change-Id: I79c6929c3827716e19b44d7469db69740f4b449c
ndroid.mk
a4c0b7567190968d263bedd1073ea633510f9a45 24-Oct-2014 Elliott Hughes <enh@google.com> Merge "Add mkfifoat(3)."
ca8e84c6ff55640aef94d25a86a25778a542bfc2 24-Oct-2014 Elliott Hughes <enh@google.com> Add mkfifoat(3).

Looks like I missed one of the *at functions when I added the rest.

Change-Id: If16de82dbf6f9a3ea7bfdcba406ca1c74a3f2279
ys_stat_test.cpp
566f2bc623dbd1d6e8bcf3a6c6e7a6fffe7f68fd 23-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Fix relocation to look for symbols in local group"
cfa97f172dc1b10d650fefbb6ccffd88ce72a5fb 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Fix relocation to look for symbols in local group

The local group is a sequence of libraries in default (breadth-first)
order. It allows RTLD_LOCALLY loaded library to correctly relocate
symbols within its group (see test-cases).

Local group lookup is performed after main executable and ld_preloads.

Bug: 2643900
Bug: 15432753
Change-Id: I9bb013b46d17dbb5cbdfb8fef26f552748385541
lfcn_test.cpp
ibs/Android.build.dlopen_check_order_dlsym.mk
ibs/Android.build.dlopen_check_order_reloc_main_executable.mk
ibs/Android.build.dlopen_check_order_reloc_siblings.mk
ibs/Android.mk
ibs/dlopen_check_order_dlsym_answer.cpp
ibs/dlopen_check_order_reloc_answer.cpp
ibs/dlopen_check_order_reloc_answer_impl.cpp
ibs/dlopen_check_order_reloc_nephew_answer.cpp
ibs/dlopen_check_order_reloc_root_answer.cpp
ibs/dlopen_check_order_reloc_root_answer_impl.cpp
ibs/dlopen_testlib_answer.cpp
ba811120ae10ddca1ffc8855bf1d83e99b08bcd9 13-Aug-2014 Derek Xue <derek.xue@linaro.org> Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).

This change is to migrate the getaddrinfo tests defined in the old file
system/extras/tests/bionic/libc/common/test_getaddrinfo.c
to the new place bionic/tests/netdb_test.cpp.

The test here is more thorough, and catches a bug in getservbyname(3)
that was breaking getaddrinfo(3)'s ability to look up services by name
without a hint that would cause it to ask for a specific protocol.

Change-Id: Ief5ebd0869496d1bc6a97861dfefa04bdf24bab1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
etdb_test.cpp
4912fc7d152236cb496aec01eb5800cfd1b757c7 13-Aug-2014 Derek Xue <derek.xue@linaro.org> bionic/tests: migrate gethostbyname bionic test from system/extra to bionic/tests

this change migrate the gethostbyname test defined in the old file
system/extras/tests/bionic/libc/common/test_gethostbyname.c
to the new place bionic/tests/netdb_test.cpp

Change-Id: I342171090f681581fb54d68ea4a09adf61f52081
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
etdb_test.cpp
62d84b19359a8ddd3df5b6293d1b05ef5281f532 21-Oct-2014 Christopher Ferris <cferris@google.com> Fix race condition in timer disarm/delete.

When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.

Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.

Modify the repeat test to finish more quickly than before.

Refactor the Counter implementation a bit.

Bug: 18039727

(cherry pick from commit 0724132c3263145f2a667f453a199d313a5b3d9f)

Change-Id: I135726ea4038a47920a6c511708813b1a9996c42
ime_test.cpp
9b7b0d82eb288f5d36f91c52a7bb91bc916fdcaf 22-Oct-2014 Christopher Ferris <cferris@google.com> Merge "Fix race condition in timer disarm/delete." into lmp-mr1-dev
702ab5b37e77684ee352300d32b078606ee388d0 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Rename library_offset to library_fd_offset

replace lseek() and use pread() instead
add test for library_fd_offset > file_size case

Bug: 17762003

(cherry picked from commit a6c1279098f24a675d0df74ce1946f5d534b425e)

Change-Id: Ie117c745081ee33d07db5341115ff6c8e98b0dec
lext_test.cpp
3c5c720b0b46ecd801329c09d23bb6e7098d76d3 09-Oct-2014 Ying Wang <wangying@google.com> Build dlext_testzip as custom module.

Use $(BUILD_SYSTEM)/base_rules to build it as custom module, so that
it's exposed to utilities like mm/mmma etc.

Bug: 17887283
Bug: 17762003

(cherry picked from commit 667853d47770fbdb54aaf0b3261b0d4882725770)

Change-Id: I405797d16f20dc09e5d84b93b6727b634db2fc2c
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
0724132c3263145f2a667f453a199d313a5b3d9f 21-Oct-2014 Christopher Ferris <cferris@google.com> Fix race condition in timer disarm/delete.

When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.

Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.

Modify the repeat test to finish more quickly than before.

Refactor the Counter implementation a bit.

Bug: 18039727
Change-Id: I73192c915cdacf608521b1792c54e5af14a34907
ime_test.cpp
54d76360ebfb79b57177a81632901ebe1c8fc11f 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Rename library_offset to library_fd_offset"
de01780f46e4e4540c7a1ea7d0302f460c880e9d 04-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Add file_offset parameter to android_extinfo

Bug: 17762003

(cherry picked from commit 07e5bc152d8a3ad4c50808bb86f3c0f2c5e2f514)

Change-Id: I72d527831384ff5dde013a4c8dfe639fbec165f5
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
ibs/Android.mk
a6c1279098f24a675d0df74ce1946f5d534b425e 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Rename library_offset to library_fd_offset

replace lseek() and use pread() instead
add test for library_fd_offset > file_size case

Bug: 17762003
Change-Id: I4555f0be635124efe849c1f226985bcba72ffcbd
lext_test.cpp
5ba672ebcb0bbb77f22bbc6c98ec03867ac1711d 17-Oct-2014 Dan Albert <danalbert@google.com> Never use ASAN.

Unless we completely redo how we build bionic (so that the object
files for libc.so get built separately from libc.a), we can't enable
ASAN here, as libc.a gets linked into static executables.

Change-Id: I2ce4f51248bd51c4213a555ff481b6faabbf53f8
ndroid.build.mk
4a9e1937c56511aef579312bf39ab345f9179230 17-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Correct way to specify additional dependencies

Previous one was not covering all the targets

Bug: 17548097
Change-Id: I425e0f8d6e5a43feabd29dcb327049b82754d249
ndroid.build.mk
ndroid.mk
ibs/Android.mk
18160256840e9bb097f17422ea47d54fabbc9f3f 12-Oct-2014 Haruki Hasegawa <h6a.h4i.0@gmail.com> Add clock_settime and clock_nanosleep.

Add the missing prototypes, fix the existing prototypes to use clockid_t
rather than int, fix clock_nanosleep's failure behavior, and add simple
tests.

Bug: 17644443
Bug: https://code.google.com/p/android/issues/detail?id=77372
Change-Id: I03fba369939403918abcabae9551a7123953d780
Signed-off-by: Haruki Hasegawa <h6a.h4i.0@gmail.com>
ime_test.cpp
667853d47770fbdb54aaf0b3261b0d4882725770 09-Oct-2014 Ying Wang <wangying@google.com> Build dlext_testzip as custom module.

Use $(BUILD_SYSTEM)/base_rules to build it as custom module, so that
it's exposed to utilities like mm/mmma etc.

Bug: 17887283
Change-Id: Idd7b62d08e4d56331a3ff15da6aa46eae8c41898
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
ac3c94d031c16a0299471a593cdc6248494e539d 09-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Fix mma build: 'cd bionic && mma' case"
51166d3aa2e9c002c123f2a08832deca23100975 08-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Fix mma build: 'cd bionic && mma' case

Bug: 17887283
Change-Id: If2015f2361348eac8c53aed3f8715077b79ce2f5
ibs/Android.build.dlext_testzip.mk
3ea4d56ed4fa59a3c3c5c30a2cca2df623b6a560 08-Oct-2014 Elliott Hughes <enh@google.com> Use ln(1) rather than cp(1) to set up host /system for testing.

The trouble with cp is that if you're running a command directly (because
you're using gdb, say), you need to make sure you've copied the linker
and shell again if you've done a rebuild that caused a change there.

Change-Id: I312da30c0f92b515967e854e0faba272c961ecc7
ndroid.mk
b4b15c63a17e74f5f6229f7b8ed034cf72e52cf4 08-Oct-2014 Elliott Hughes <enh@google.com> Fix compile-time tests for LP64.

Change-Id: Ib9bec5c6c77c55679d64c2bc15ab70979c40e66c
ortify_sprintf_warnings.cpp
2fbb1b653ee46b6dee715ae7c085f094f505390d 08-Oct-2014 Dan Albert <danalbert@google.com> Add basic compile time tests for sn?printf.

Bug: 17782583
Change-Id: I6443537c643d1cc6b4a8f2dab5c364f2fbc1faa3
ndroid.mk
ortify_sprintf_warnings.cpp
ce92b41a00fb86656055eceab9648a858721c3b1 06-Oct-2014 Nick Kralevich <nnk@google.com> cdefs.h: add artificial attribute to FORTIFY_SOURCE functions

Otherwise the gcc compiler warning doesn't show up.

Add -Wno-error to fortify related tests. Fortify related tests
are expected to be examples of bad programs, and in many
cases shouldn't compile cleanly. Rewriting them to compile
cleanly isn't feasible nor desirable.

Bug: 17784968

(cherry picked from commit 1aaa17802c92d99ae170245c2b2f15a6c27b133e)

Change-Id: Ib6df1a3f44b55b1fff222e78395c10c51cd39817
ndroid.mk
75d66dd9a7d6add031f4c2206751c45c937fc139 07-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Fix 2nd arch prefix application

Bug: 17887283
Change-Id: I7b3b2332212fe416d6b5f5c2e5c1e07605ba09aa
ibs/Android.mk
b5cba6081bc9179d3ea2aa1bfd77dd8de1c88525 07-Oct-2014 Nick Kralevich <nnk@google.com> Merge "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"
1aaa17802c92d99ae170245c2b2f15a6c27b133e 06-Oct-2014 Nick Kralevich <nnk@google.com> cdefs.h: add artificial attribute to FORTIFY_SOURCE functions

Otherwise the gcc compiler warning doesn't show up.

Add -Wno-error to fortify related tests. Fortify related tests
are expected to be examples of bad programs, and in many
cases shouldn't compile cleanly. Rewriting them to compile
cleanly isn't feasible nor desirable.

Bug: 17784968
Change-Id: I93bececa7444d965f18c7c27d46e7abce5c49a02
ndroid.mk
9969fecad23edebcbc4f32a50dc65a2876a2478f 06-Oct-2014 Dan Albert <danalbert@google.com> Merge "Add compile time test infrastructure for bionic."
f04a8bc2266e4a51e1ccfb18c24ff0ae25d98d8a 03-Oct-2014 Dan Albert <danalbert@google.com> Add compile time test infrastructure for bionic.

Actual tests to follow...

Bug: 17782583
Change-Id: I22857f19899c3b39dbc2e5473ad3be1a8a291139
ndroid.mk
ile-check-cxx
6d569b92012543a297dccf2dfeaa648d07b3c133 06-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add file_offset parameter to android_extinfo"
07e5bc152d8a3ad4c50808bb86f3c0f2c5e2f514 04-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Add file_offset parameter to android_extinfo

Bug: 17762003
Change-Id: I8fb267a3155acef3dba534038cf5d1ef00d7154b
lext_test.cpp
ibs/Android.build.dlext_testzip.mk
ibs/Android.mk
884a3de60f442748a1d15c6a219f7058e03e38e2 06-Oct-2014 Nick Kralevich <nnk@google.com> Revert "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"

Broke the build.

In file included from frameworks/rs/cpu_ref/rsCpuCore.cpp:36:
system/core/include/cutils/properties.h:118:1: error: unknown attribute '__artificial__' ignored [-Werror,-Wunknown-attributes]
__BIONIC_FORTIFY_INLINE
^
bionic/libc/include/sys/cdefs.h:537:110: note: expanded from macro '__BIONIC_FORTIFY_INLINE'
#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__))
^
1 error generated.
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libRSCpuRef_intermediates/rsCpuCore.o] Error 1
This reverts commit 9b543ffeac216189cc8125f7624da9a8cbcbe2e4.

Change-Id: I6a1198747505dcb402b722887c1bfbc3a628a8b8
ortify_test.cpp
9b543ffeac216189cc8125f7624da9a8cbcbe2e4 05-Oct-2014 Nick Kralevich <nnk@google.com> cdefs.h: add artificial attribute to FORTIFY_SOURCE functions

Otherwise the gcc compiler warning doesn't show up.

Delete some unittests. These unittests no longer compile cleanly
using -Wall -Werror, and rewriting them to compile cleanly
isn't feasible.

Bug: 17784968
Change-Id: I9bbdc7b6a1c2ac75754f5d0f90782e0dfae66721
ortify_test.cpp
8d0b2dbf2154d5da17ff09b1d4f864d281362ad2 26-Sep-2014 Alex Van Brunt <avanbrunt@nvidia.com> Reimplement clock(3) using clock_gettime(3)

Unlike times(), clock_gettime() is implemented as a vDSO on many architectures.
So, using clock_gettime() will return a more accurate time and do so with less
overhead because it does have the overhead of calling into the kernel.

It is also significantly more accurate because it measures the actual time in
nanoseconds rather than the number of ticks (typically 1 millisecond or more).

Bug: 17814435
Change-Id: Id4945d9f387330518f78669809639952e9227ed9
ime_test.cpp
d5df4124bbbb30411ef19f7c2fbb3987d0eb9630 02-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add RTLD_NODELETE flag support"
1cd0c6777f35b531c9ce78397d0915aa521b3e87 02-Oct-2014 Dmitriy Ivanov <dimitry@google.com> L-MR1 specific fixes

Reset soinfo version to 0.
Disable ifunc test for arm64 because of old toolchain
in lmp-mr1-dev branch

Note: this commit should be reverted in -plus-aosp branch.

Change-Id: I2d6d996d43bc35d5d4975c745779f43a988b31e6
lfcn_test.cpp
ibs/Android.mk
7d971ec14b80cac442aeea8d88e9eb2e3ab6f214 09-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Fix unload of recursively linked library

Expanded test for recursive libs. Fixed bug with unnecessary
soinfo_free of already loaded library.

(cherry picked from commit a6ac54a215d6b64f5cc5a59b66c1dbfbb41ea9f5)

Change-Id: I6907c723d9fbdf6b2777f3f236b1e29b0843edd6
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_invalid.cpp
f4cb6313645ef65cc0eea0a439e51b6788cd3439 12-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Add IFUNC support for arm64 and IRELATIVE reloc

There are number of changes in the way IFUNC related relocations are done:
1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
2. IFUNC relocations are now relying on static linker to generate
them in correct order - this removes necessety of additional
relocation pass for ifuncs.
3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
4. Ifunc are resolved on symbol lookup this approach allowed to avoid
mprotect(PROT_WRITE) call on r-x program segments.

Bug: 17399706
Bug: 17177284

(cherry picked from commit 9aea164457c269c475592da36b4655d45f55c7bc)

Change-Id: Ie19d900fc203beb93faf8943b0d06d534a6de4ad
ndroid.build.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_ifunc.c
ef1306d77718cc74a8df5673a15649dea317571d 09-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Refactoring: C++11 style DISABLE_ bionic marcos

Enable the -std=gnu++11 flag for libstdc++ static and
dynamic libs.

ScopeGuard uses DISABLE_ macros instead of '= delete';

(cherry picked from commit d9ff7226613014056c9edd79a68dc5af939107a0)

Change-Id: If2573d080770e18b36b56106f2369f7bb682cd3c
lfcn_test.cpp
ath_test.cpp
thread_test.cpp
61c4147fa8c8abb33ae6fecb85dd1ae1b60e1ed6 04-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Reset enviroment for math_tests

Bug: 17390824

(cherry picked from commit 7b956ede3f0f40bd8a085a8ad3729bb3e0e030f2)

Change-Id: I5d804ceb5e69533584161bfed6787529cd8296fb
ath_test.cpp
tring_test.cpp
ae69a9584baf8dd6a28065538ca09d1924ebd9e4 06-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Load libraries in breadth-first order

This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Attempt: 2

(cherry picked from commit 14669a939d113214a4a20b9318fca0992d5453f0)

Change-Id: Id87540c96a2242220967b6fa5d84ddcd829e2b97
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_answer.cpp
niqueptr_test.cpp
c0133a73b6f37b88afc8dafb6f63af03cbb708f6 05-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Load libraries in breadth-first order"

This reverts commit a3ad450a2e3fb6b3fe359683b247eba20896f646.

(cherry picked from commit 498eb18b82a425f9f30132e4832f327b2ee0e545)

Change-Id: Iec7eab83d0c0ed1604e1e8ea3f9e9d0ce1d29680
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_answer.cpp
niqueptr_test.cpp
8de1ddece0d0b85eafeb86c06cf3a734dadf2b55 05-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Fix order of soinfo links (repairs libcxx tests).

(cherry picked from commit b2a30ee8d209154efc367db11b4167a5d6db605f)

Change-Id: I59c5333bc050cbbea14051cea9220be2f64ee383
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_relo_check_dt_needed_order.cpp
ibs/dlopen_testlib_relo_check_dt_needed_order_1.cpp
ibs/dlopen_testlib_relo_check_dt_needed_order_2.cpp
59c12a652794273da22907a374222f4fa7d975c6 29-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Load libraries in breadth-first order

This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255

(cherry picked from commit a3ad450a2e3fb6b3fe359683b247eba20896f646)

Change-Id: I1125de10272c84e4f075cbc72859c1f6b3e89943
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_answer.cpp
niqueptr_test.cpp
93c3f4203c92ece8b97d770af9b675f5ffb90c67 26-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Enable __cxa_atexit && __cxa_finalize for linker

This allows adding destructors to classes used
for global variables.

(cherry picked from commit 14241402de0faa4b244b1bd6b1f0799ce169b880)

Change-Id: I1d8776130d1e01a8c53d23a2949f5010f4c96b16
ndroid.mk
bd321c1106ed30a71d55d5c365335dfe552b0883 21-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Run constructors before resolving ifunc functions

Bug: 17177284

(cherry picked from commit 9598b8c415e2fa9f240508185fe8c964b83f538d)

Change-Id: I2c9631ee1cd77f8cf95ec0216a35b605c8786454
ndroid.mk
lfcn_test.cpp
ibs/dlopen_testlib_ifunc.c
31b88da8431096a6df276705046ca7a012fa3530 23-Jul-2014 Brigid Smith <brigidsmith@google.com> Added test for ifunc support in dynamic linker.

ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.

Bug:6657325
(cherry picked from commit c5a13efa9bc4264be0a9a9e37c00633af01584ed)

Change-Id: I321d780bc2f9bd1baa749e1acacd2683aefe827b
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_ifunc.c
1b20dafdbe65e43b9f4c95057e8482380833ea91 20-May-2014 Dmitriy Ivanov <dimitry@google.com> Add RTLD_NODELETE flag support

Bug: https://code.google.com/p/android/issues/detail?id=64069
Change-Id: Ie5f90482feae86391172be4b32d6cb7d76f446fb
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_nodelete_1.cpp
ibs/dlopen_nodelete_2.cpp
ibs/dlopen_nodelete_dt_flags_1.cpp
252c1ac9738ff6187354f243ef118eac962b65dc 01-Oct-2014 Elliott Hughes <enh@google.com> Merge "Update our FreeBSD realpath(3) to upstream head."
31e072fc9bcf6517d763c7af6d872efd1784629e 01-Oct-2014 Elliott Hughes <enh@google.com> Update our FreeBSD realpath(3) to upstream head.

Change-Id: I8c89728184ecd2c1a28a05cefa84a5037d28b552
tdlib_test.cpp
c4bcc75f094206f3a6af767a5f6033ad44253b70 30-Sep-2014 Dan Albert <danalbert@google.com> Clean up the pthread key tests.

The previous pthread_key_create_many test was really
pthread_key_create_all, which has proven very difficult to test
correctly (because it is affected by any other parts of the system using
pthread keys, and that can vary with test ordering). It also tested
expected values of PTHREAD_KEYS_MAX and the associated sysconf() value,
rather than those being in their own test.

Instead, split this test into a few distinct tests:

* pthread.pthread_keys_max
* pthread._SC_THREAD_KEYS_MAX_big_enough_for_POSIX
* pthread.pthread_key_many_distinct
* We actually didn't have a test to ensure that the keys we were
creating were distinct.
* pthread.pthread_key_EAGAIN
* Make sure pthread_key_create() will _eventually_ fail with
EAGAIN, not at a (sometimes incorrectly) predetermined maximum.

Change-Id: Iff1e4fdcc02404094bde0418122c64c227cf1702
thread_test.cpp
3a5aeba4bda8b0977678021deed7aebeaa63ded1 27-Sep-2014 Dan Albert <danalbert@google.com> Switch benchmarks and tests to libc++.

Change-Id: I3b9c8f8c14a1e227e67ae1977cc29b0e8fccef5d
ndroid.build.mk
ndroid.mk
tdatomic_test.cpp
d9898c5b8292b9eecc40a7819bfedb4e1a4fe041 30-Sep-2014 Dan Albert <danalbert@google.com> Ignore multiple symbol definition errors.

libc and libc++ both define std::nothrow. libc's is a private symbol,
but this still causes issues when linking libc.a and libc++.a, since
private isn't effective until it has been linked. To fix this, just
allow multiple symbol definitions for the static tests.

Change-Id: Idbf19fefda47298c39360e3f5b6242b0b1a52fcc
ndroid.mk
528ad742c671f17a9f8731ad8de4bcc931631bc9 25-Sep-2014 Christopher Ferris <cferris@google.com> Fix sys_stat.mkfifo when not run as root.

It's not allowed for a shell user to create a fifo in /data/local/tmp.
Make the test do nothing if not run as root.

Bug: 17646702

(cherry picked from commit 6c69afdb6ddd56e011b59e3060f12a5bdffb5f5c)

Change-Id: Ia3a862ed4586413b7bb393557ab57e0a7141d888
ys_stat_test.cpp
6c69afdb6ddd56e011b59e3060f12a5bdffb5f5c 25-Sep-2014 Christopher Ferris <cferris@google.com> Fix sys_stat.mkfifo when not run as root.

It's not allowed for a shell user to create a fifo in /data/local/tmp.
Make the test do nothing if not run as root.

Bug: 17646702
Change-Id: I932262fa233eae8b5dd607a2398a47c50a208701
ys_stat_test.cpp
31165edf5733dae8fbe79551b18cbc0e56c8d808 24-Sep-2014 Elliott Hughes <enh@google.com> CLOEXEC support in fdopen, freopen, and mkostemp/mkostemps.

Change-Id: I74ea88e0d4973d6ab3c57da7d8bb643c31592b14
emporaryFile.h
tw_test.cpp
tdio_test.cpp
tdlib_test.cpp
b05ec5ae933987e6b4a4f6a318cb13e035ad33e9 23-Sep-2014 Elliott Hughes <enh@google.com> Pull in upstream fixes to reject invalid bases.

Also add tests to make sure the full set works correctly.

Change-Id: I3e7f237f12c9c93e1185a97c9717803e7e55a73c
nttypes_test.cpp
tdlib_test.cpp
char_test.cpp
34c987a6dd6816eff98bc25f627659550c2338dc 23-Sep-2014 Elliott Hughes <enh@google.com> Test pthread_cleanup_push(3)/pthread_cleanup_pop(3).

Change-Id: I5a623fa1e1da55f11d51f3a9bdfa0627698c486f
thread_test.cpp
d9cb0ed281f0301ec2ca6828f0acc1ed08dceb8a 22-Sep-2014 Elliott Hughes <enh@google.com> Merge "Unit test for abort(3)."
60452a211c19e8cd09d4111fa733c64ecd1200f0 22-Sep-2014 Elliott Hughes <enh@google.com> Unit test for abort(3).

Change-Id: I021604b977572801f228a193741624df26e76d72
nistd_test.cpp
04303f5a8ab9a992f3671d46b6ee2171582cbd61 19-Sep-2014 Elliott Hughes <enh@google.com> Add semaphore tests, fix sem_destroy.

Bug: https://code.google.com/p/android/issues/detail?id=76088
Change-Id: I4a0561b23e90312384d40a1c804ca64ee98f4066
ndroid.mk
emaphore_test.cpp
ime_test.cpp
755318548d787c7ca36901be064c69efba41c6cf 18-Sep-2014 Elliott Hughes <enh@google.com> Fix lgamma_r/lgammaf_r/lgammal_r for -0.

Upstream has implemented lgammal/lgammal_r for ld128, and fixed the
sign problem we reported with all the lgamma*_r functions and -0.

Bug: 17471883
Change-Id: Ibb175d9cab67efae75f1010796fd44c9ba6ce4fc
ath_test.cpp
82e71085c23d11030e9950d8d08e30ef249fd73b 18-Sep-2014 Elliott Hughes <enh@google.com> Merge "The nextafter functions use the wrong next representable value"
90be6c5fc541fb83699b949e26e6eb9044a2d096 18-Sep-2014 Jingwei Zhang <jingwei.zhang@intel.com> The nextafter functions use the wrong next representable value

From C99 standard: “The nextafter functions determine the next representable value, in the type of the function,
after x in the direction of y, where x and y are first converted to the type of the function”.
The next representable value of 0.0 in direction of -1.0 is -4.9406564584124654e-324, not 0.0.

Similar thing holds for nextafterf, nextafterl, nexttowardf, nexttoward, and nexttowardl.
The tests pass either way, since the error is within the tolerance, but how it is written is wrong.

Change-Id: I1338eeffe3de8031a48f46e1b07146bc07dc2f0a
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
ath_test.cpp
bee1993a14b47bc7acda544242f405ae45e42566 18-Sep-2014 Elliott Hughes <enh@google.com> Stack unwinding unit tests.

Bug: 17436734
Change-Id: I1e98da7eaeab646b448fb3f2b683973dddc319b0
ndroid.mk
tack_unwinding_test.cpp
tack_unwinding_test_impl.c
bf50e2645d84bec481cb42da5f2ff4096061cbf8 18-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Add Android*.mk files to additional dependencies

Bug: 17548097
Change-Id: Ie0d9c8f33459320008f561217c54eba42d283b47
ndroid.mk
ibs/Android.mk
e8ba50fe0d51fbefee1a8f5bb62bf51d841512c8 16-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Fix dlsym() to take into account RTLD_GLOBAL/LOCAL

Symbols from libraries opened with RTLD_LOCAL (default)
should not be visible via dlsym(RLTD_DEFAULT/RTLD_NEXT, .)

Bug: 17512583
Change-Id: I1758943081a67cf3d49ba5808e061b8251a91964
lfcn_test.cpp
ibs/dlopen_testlib_simple.cpp
eb27bbae8f0edc6b62ca2db73256c7fb53b9e9bf 15-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Add dlfcn_test to glibc test suite.

Change-Id: I955e4f7dfcc23ea5c767f967b3532dc31663b876
ndroid.mk
lfcn_test.cpp
ibs/Android.build.testlib.mk
ibs/Android.mk
ibs/dlopen_testlib_simple.cpp
8fb639ca9118a6522723d0bc09db59b432a803a9 12-Sep-2014 Elliott Hughes <enh@google.com> Add a test for pthread_gettid_np.

Bug: 17475191
Change-Id: I8c6a2f4ceba2d24a77ae9a21269edce523aea421
thread_test.cpp
d74aa580354037b9972524e9d654c0a336974838 12-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Fix unload of recursively linked library"
66bbf1595c0fc25d4bc47457d8020b11e135996d 12-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Refactoring: C++11 style DISABLE_ bionic marcos"
a6ac54a215d6b64f5cc5a59b66c1dbfbb41ea9f5 09-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Fix unload of recursively linked library

Expanded test for recursive libs. Fixed bug with unnecessary
soinfo_free of already loaded library.

Change-Id: I2cc19f2650c8b12a35feeac127ef608ebba44d88
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_invalid.cpp
6487f0d8341b00b476995e0174dc92e5ae8efbbe 12-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add IFUNC support for arm64 and IRELATIVE reloc"
9aea164457c269c475592da36b4655d45f55c7bc 12-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Add IFUNC support for arm64 and IRELATIVE reloc

There are number of changes in the way IFUNC related relocations are done:
1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
2. IFUNC relocations are now relying on static linker to generate
them in correct order - this removes necessety of additional
relocation pass for ifuncs.
3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
4. Ifunc are resolved on symbol lookup this approach allowed to avoid
mprotect(PROT_WRITE) call on r-x program segments.

Bug: 17399706
Bug: 17177284
Change-Id: I414dd3e82bd47cc03442c5dfc7c279949aec51ed
ndroid.build.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_ifunc.c
b587f339db269abf08a2c311a7263dd218cb23d3 11-Sep-2014 Elliott Hughes <enh@google.com> Add posix_fadvise(3).

(cherry-pick of 00008263782e484020420c606f7d145fe7d0a4d8.)

Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
cntl_test.cpp
00008263782e484020420c606f7d145fe7d0a4d8 11-Sep-2014 Elliott Hughes <enh@google.com> Add posix_fadvise(3).

Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
cntl_test.cpp
d9ff7226613014056c9edd79a68dc5af939107a0 09-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Refactoring: C++11 style DISABLE_ bionic marcos

Enable the -std=gnu++11 flag for libstdc++ static and
dynamic libs.

ScopeGuard uses DISABLE_ macros instead of '= delete';

Change-Id: I07e21b306f95fffd49345f7fa136cfdac61e0225
lfcn_test.cpp
ath_test.cpp
thread_test.cpp
3c3624f3df14590e7213d35c3b39a0a11c7d2d34 09-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Load libraries in breadth-first order"
cf5fc80c3eb710cb5a1985837156cb2758c87a5b 06-Sep-2014 Elliott Hughes <enh@google.com> Don't expose non-standard basename_r and dirname_r in LP64.

(cherry-pick of f0e9458ea596227720fa745df15f5357f6c0c8f6.)

Bug: 17407423
Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
ibgen_test.cpp
14669a939d113214a4a20b9318fca0992d5453f0 06-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Load libraries in breadth-first order

This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: If1ba5c807322409faa914e27ecb675e2c4541f0d
Attempt: 2
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_answer.cpp
niqueptr_test.cpp
498eb18b82a425f9f30132e4832f327b2ee0e545 05-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Load libraries in breadth-first order"

This reverts commit a3ad450a2e3fb6b3fe359683b247eba20896f646.

Change-Id: Ia2b838ad2159c643b80c514849582f4b4f4f40e5
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_answer.cpp
niqueptr_test.cpp
f0e9458ea596227720fa745df15f5357f6c0c8f6 06-Sep-2014 Elliott Hughes <enh@google.com> Don't expose non-standard basename_r and dirname_r in LP64.

Bug: 17407423
Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
ibgen_test.cpp
b2a30ee8d209154efc367db11b4167a5d6db605f 05-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Fix order of soinfo links (repairs libcxx tests).

Change-Id: Iee9de09657351cd6a7512784ca797e4b84cdd98b
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_relo_check_dt_needed_order.cpp
ibs/dlopen_testlib_relo_check_dt_needed_order_1.cpp
ibs/dlopen_testlib_relo_check_dt_needed_order_2.cpp
5beddb7d642524ecb6655ab2823caf2add679917 05-Sep-2014 Elliott Hughes <enh@google.com> Fix pthread_attr_getstack__main_thread.

There were two problems here:

* This would fail when run with unlimited stack, because it didn't know
that bionic reports unlimited stacks as 8MiB.

* This would leave RLIMIT_STACK small, causing failures to exec (so the
popen and system tests would fail).

(cherry-pick of 27a9aed81978af792cb06035a1619c8141a5fb5b plus the
new ScopeGuard.h from a3ad450a2e3fb6b3fe359683b247eba20896f646.)

Bug: 17394276
Change-Id: I5b92dc64ca089400223b2d9a3743e9b9d57c1bc2
thread_test.cpp
001815ed197280409d08e9622890e7462c6e6831 05-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Reset enviroment for math_tests"
7b956ede3f0f40bd8a085a8ad3729bb3e0e030f2 04-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Reset enviroment for math_tests

Bug: 17390824
Change-Id: I42f4c8d9199a2efe7641f0b0e64580cacb5695da
ath_test.cpp
tring_test.cpp
27a9aed81978af792cb06035a1619c8141a5fb5b 05-Sep-2014 Elliott Hughes <enh@google.com> Fix pthread_attr_getstack__main_thread.

There were two problems here:

* This would fail when run with unlimited stack, because it didn't know
that bionic reports unlimited stacks as 8MiB.

* This would leave RLIMIT_STACK small, causing failures to exec (so the
popen and system tests would fail).

Change-Id: I5b92dc64ca089400223b2d9a3743e9b9d57c1bc2
thread_test.cpp
aa13e839f06231b9299bb683a71abd954294b49b 05-Sep-2014 Elliott Hughes <enh@google.com> Fix mips signed/unsigned signal_test.cpp build breakage.

Change-Id: I045ce017c0c51e1843193759a2eb6fc5b93e3867
ignal_test.cpp
afe58ad9892de27a7acb0aaded6312ee0f958314 04-Sep-2014 Elliott Hughes <enh@google.com> Don't mask out SA_RESTORER from sa_flags.

glibc doesn't do this, and we probably shouldn't either.

Bug: 16703540
Change-Id: Id5b93c3782e34024a9916463348e8f3caff191bf
ignal_test.cpp
1737b159374468a21859d97d8be70a726af0ec9e 04-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Load libraries in breadth-first order"
8da304b997bc0f81ebb30fadc79249fafc1c6fce 04-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Make string tests check all alignment combinations"
a3ad450a2e3fb6b3fe359683b247eba20896f646 29-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Load libraries in breadth-first order

This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: I4cf84c70dbaabe99310230dfda12385ae5401859
ndroid.mk
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_answer.cpp
niqueptr_test.cpp
69fb9f3f408b7d7f85522e3848a8ab5b87d6e377 03-Sep-2014 Dan Albert <danalbert@google.com> Don't fail a test just because we aren't root.

If the tests are not being run as root, emit a message and don't
continue with the test.

Change-Id: I352e1a4162caaeb18b81b8daf44797009756dcd9
lext_test.cpp
3b10ba6f1b743ddced32474891ff6d1cb83c027a 03-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add some missing dlclose(.)"
319356e39cc91b4eb94b1974756f1cfc0a137351 03-Sep-2014 Dmitriy Ivanov <dimitry@google.com> Add some missing dlclose(.)

Bug: 17358010
Change-Id: I9e427b7681f1a8fe890b0b47812d9e65ab95c792
lfcn_test.cpp
6676a7d4eea4cb042eed87fad06369765f074cec 03-Sep-2014 Dan Albert <danalbert@google.com> Start math tests with a clean fenv.

We always want the default floating point environment when running these
tests.

Bug: 17358010
Change-Id: I6ca2552e9f2d3e07d7b9dcaf0aec66905401c466
ath_cos_test.cpp
ath_cosf_test.cpp
ath_exp_test.cpp
ath_expf_test.cpp
ath_log_test.cpp
ath_logf_test.cpp
ath_pow_test.cpp
ath_powf_test.cpp
ath_sin_test.cpp
ath_sincos_test.cpp
ath_sincosf_test.cpp
ath_sinf_test.cpp
ath_tan_test.cpp
ath_tanf_test.cpp
1d53ae2a01df5c85d23b01e44880103e118712f3 03-Sep-2014 Dan Albert <danalbert@google.com> Prevent a few test pthread keys from leaking.

Bug: 17358010
Change-Id: Ie718dc215ddfd431650295a1630c1b1716760c3d
thread_test.cpp
9ac60bf82b1f0e316666b862e9924f90caa60342 29-Aug-2014 Hans Boehm <hboehm@google.com> Make stdatomic.h work with gcc4.6 host compiler

This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea364501b3b0abe58dae461136159df1e356 there.

It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.

Specifically fixes:

We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.

The __sync implementation was not defining the LOCK_FREE macros.

ATOMIC_VAR_INIT was using named field initializations. These are a
C, not C++, feature, that is not supported by g++ 4.6.

The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation. Don't run that piece
with 4.6.

In L, this is a prerequisite for fixing:

Bug:16880454
Bug:16513433

Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
(cherry picked from commit 32429606bf696d3b2ca555f132a0d60c566d0bd0)
tdatomic_test.cpp
c8cf3513ecb265ba3aadc846aa2113290a504c44 20-Aug-2014 Hans Boehm <hboehm@google.com> Fix, generalize stdatomic.h; improve test.

We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing. This generalizes the bionic header so that it
can be used directly as the prebuilt header as well. So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Prerequisite for fixing b/16880454 and

Bug:16513433

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
(cherry picked from commit 00aaea364501b3b0abe58dae461136159df1e356)
ndroid.mk
tdatomic_test.cpp
32429606bf696d3b2ca555f132a0d60c566d0bd0 29-Aug-2014 Hans Boehm <hboehm@google.com> Make stdatomic.h work with gcc4.6 host compiler

This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea364501b3b0abe58dae461136159df1e356 there.

It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.

Specifically fixes:

We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.

The __sync implementation was not defining the LOCK_FREE macros.

ATOMIC_VAR_INIT was using named field initializations. These are a
C, not C++, feature, that is not supported by g++ 4.6.

The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation. Don't run that piece
with 4.6.

In L, this is a prerequisite for fixing:

Bug:16880454
Bug:16513433

Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
tdatomic_test.cpp
f6824b26ae06cc4e9964dd0d803676731ae7dbe0 29-Aug-2014 Elliott Hughes <enh@google.com> The host prebuilt glibc is 2.11, so remove workarounds for 2.9.

Change-Id: I1072fcebc8b3018580a9d069fe6eca9c4e74e865
ys_socket_test.cpp
416d7ddaff0946d480b6aa945a741b3eeaca5569 19-Aug-2014 Elliott Hughes <enh@google.com> 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
ndroid.mk
ibc_logging_test.cpp
tring_posix_strerror_r_test.cpp
tring_test.cpp
67f1f3b171ecd5f68f51465bbe4b8c8440bb6b2e 28-Aug-2014 Elliott Hughes <enh@google.com> Have pthread_attr_getstack for the main thread report RLIMIT_STACK...

...rather than just what's already mapped in. This seems somewhat
contrary to POSIX's "All pages within the stack described by stackaddr
and stacksize shall be both readable and writable by the thread", but
it's what glibc does.

Bug: 17111575

(cherry picked from commit 9e4ffa7032eaab308876b8e3da86b05c3c613878)

Change-Id: I73f219a569917b2e4546c09436d7ef5231facc07
thread_test.cpp
a0eeb0b69fb3840125329026f2172d3fbe177e99 28-Aug-2014 Elliott Hughes <enh@google.com> Merge "Fix pthread_getattr_np for the main thread." into lmp-dev
9e4ffa7032eaab308876b8e3da86b05c3c613878 28-Aug-2014 Elliott Hughes <enh@google.com> Have pthread_attr_getstack for the main thread report RLIMIT_STACK...

...rather than just what's already mapped in. This seems somewhat
contrary to POSIX's "All pages within the stack described by stackaddr
and stacksize shall be both readable and writable by the thread", but
it's what glibc does.

Bug: 17111575
Change-Id: If9e2dfad9a603c0d0615a8123aacda4946e95b2c
thread_test.cpp
34da32e7dd00270e98b845f8a810a6f12ffffb9b 27-Aug-2014 Chih-Hung Hsieh <chh@google.com> Merge "Add missing type casts before comparison."
a2c6ae6f841d088b79a2a7bbd73847b8b199a521 27-Aug-2014 Chih-Hung Hsieh <chh@google.com> Add missing type casts before comparison.

BUG: 17300548
Change-Id: Ice9868f36c8fa8cd40bb13741b0e33c8f8d354fd
lext_test.cpp
a40fdbd565785dfaf59c471ff08c14ed0ad35238 26-Aug-2014 Wally Yau <wyau@google.com> call uselocale() before freelocale() to make sure that g_local_key has a valid locale.

For tests that call uselocale(), the locale is stored in the
g_userlocale_key thread-specific key. If freelocale() is called later,
then g_uselocal_key points to a deleted pointer. CTS eventually calls
vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX
accesses the deleted locale stored in g_uselocale_key, causing unpredictable
errors.

Fixed the tests by calling uselocale() with the old locale before
calling freelocale.

(cherry-pick of 8a46cf0fcf82b8c76e05be7e066ec854f974603a.)

Bug: 17299565
Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
ocale_test.cpp
tdio_test.cpp
8a46cf0fcf82b8c76e05be7e066ec854f974603a 26-Aug-2014 Wally Yau <wyau@google.com> call uselocale() before freelocale() to make sure that g_local_key has a valid locale.

For tests that call uselocale(), the locale is stored in the
g_userlocale_key thread-specific key. If freelocale() is called later,
then g_uselocal_key points to a deleted pointer. CTS eventually calls
vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX
accesses the deleted locale stored in g_uselocale_key, causing unpredictable
errors.

Fixed the tests by calling uselocale() with the old locale before
calling freelocale.

Bug: 17299565
Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
ocale_test.cpp
tdio_test.cpp
14241402de0faa4b244b1bd6b1f0799ce169b880 26-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Enable __cxa_atexit && __cxa_finalize for linker

This allows adding destructors to classes used
for global variables.

Change-Id: I5e1cd63fe3bf8f66de88cc4f7437cafb350f49b5
ndroid.mk
642182341018b282148280a7bdb771493e15bd7d 26-Aug-2014 Elliott Hughes <enh@google.com> Fix pthread_getattr_np for the main thread.

On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>

(cherry picked from commit 57b7a6110e7e8b446fc23cce4765ff625ee0a105)

Change-Id: I87e679ee1c0db8092f2d1221c8e7c1461545c5a4
lfcn_test.cpp
thread_test.cpp
57b7a6110e7e8b446fc23cce4765ff625ee0a105 26-Aug-2014 Elliott Hughes <enh@google.com> Fix pthread_getattr_np for the main thread.

On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158
lfcn_test.cpp
thread_test.cpp
a4a8c4feb8cf3cebf8aceace70e699e128095b5c 23-Aug-2014 Hans Boehm <hboehm@google.com> Merge "Fix, generalize stdatomic.h; improve test."
00aaea364501b3b0abe58dae461136159df1e356 20-Aug-2014 Hans Boehm <hboehm@google.com> Fix, generalize stdatomic.h; improve test.

We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing. This generalizes the bionic header so that it
can be used directly as the prebuilt header as well. So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
ndroid.mk
tdatomic_test.cpp
4756afe3d5017b50c89761c47f0da17a6799c81e 22-Aug-2014 Dan Albert <danalbert@google.com> Merge "Implement malloc_info(3)."
4caa1f09770ea3e5ca22afbe8aa0900810a0dbfe 20-Aug-2014 Dan Albert <danalbert@google.com> Implement malloc_info(3).

Expose jemalloc stats through the malloc_info(3) interface.

Bug: 16874689
Change-Id: I4358ac283002e60ff161107028d1a3fb1e9afb0a
ndroid.mk
alloc_test.cpp
2b3b2ecee8df54a25e9f5e0968761dbac4761e6c 22-Aug-2014 Elliott Hughes <enh@google.com> Fix unistd.getpid_caching_and_clone.

This test only works if you're root (strictly: if you have permission to
CLONE_NEWNS), so it's useful to us when we're doing ad hoc testing (since
that's usually done as root), but it's not useful as part of CTS or when
running the tests on the host.

(cherry-pick of 84d0683a824fa02dbaa6d1b56a79223804b54e80.)

Bug: 16705621
Bug: 17170200
Change-Id: Ia92c871b15f7e45fc174bb59bc95540fd00ae745
nistd_test.cpp
84d0683a824fa02dbaa6d1b56a79223804b54e80 22-Aug-2014 Elliott Hughes <enh@google.com> Fix unistd.getpid_caching_and_clone.

This test only works if you're root (strictly: if you have permission to
CLONE_NEWNS), so it's useful to us when we're doing ad hoc testing (since
that's usually done as root), but it's not useful as part of CTS or when
running the tests on the host.

Bug: 16705621
Bug: 17170200
Change-Id: Ia92c871b15f7e45fc174bb59bc95540fd00ae745
nistd_test.cpp
9598b8c415e2fa9f240508185fe8c964b83f538d 21-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Run constructors before resolving ifunc functions

Bug: 17177284
Change-Id: I5714b9bc2d1ca8f8711806bfb68da3d524213e99
ndroid.mk
lfcn_test.cpp
ibs/dlopen_testlib_ifunc.c
6b841db2baa24ffcf2a4e5f975d1d07f1699b918 21-Aug-2014 Elliott Hughes <enh@google.com> Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream.

Bug: 17164505
Change-Id: I59e28a08ff8b6ab632230b11a5807cfd5278aeb5
tdio_test.cpp
char_test.cpp
9419420919ea846bbad5510850c7aaec95021648 19-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Add support for protected local symbol lookup."

This reverts commit d97e9f546ea195686a78e539315b273393609b9e.

Bug: 17107521
Change-Id: I2b81ce2b5a4a2d166133a2626e49d81b6aef3672
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_local_symbol.map
ibs/dlsym_local_symbol_private.cpp
ibs/dlsym_local_symbol_public.cpp
2b021e10664c3938249eb18b48eeac253cbb3e20 20-Aug-2014 Elliott Hughes <enh@google.com> Add <stdio_ext.h> for elfutils.

Bug: 17139679
Change-Id: I1605ac382dbb6f23b2d874dbb9769f3cde4a6a99
ndroid.mk
tdio_ext_test.cpp
09c39d6df0e952620f8c1751377b559a04e023aa 19-Aug-2014 Elliott Hughes <enh@google.com> Implement the GNU basename(3) in addition to the POSIX one.

Code like perf(1) needs this.

Bug: 11860789
Change-Id: I907eb448052a7b165e4012d74303330d32328cb2
ibgen_test.cpp
tring_test.cpp
f4c948a9e9b616c4f133f9495dacb105e51b3e49 19-Aug-2014 Elliott Hughes <enh@google.com> Move the meat of <features.h> into <sys/cdefs.h>.

This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).

Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
etauxval_test.cpp
ime_test.cpp
char_test.cpp
02aa70589d22fa9b65da43de705d6de2715870c6 19-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Add support for protected local symbol lookup."

This reverts commit d97e9f546ea195686a78e539315b273393609b9e.

Bug: 17107521
(cherry picked from commit 9419420919ea846bbad5510850c7aaec95021648)

Change-Id: I1a6df946ac8075699e77d68ffa6ac4a21b88e4bf
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_local_symbol.map
ibs/dlsym_local_symbol_private.cpp
ibs/dlsym_local_symbol_public.cpp
5f5cc45cf0e027f6ca503dc229a4890fc7164b66 19-Aug-2014 Elliott Hughes <enh@google.com> Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).

<features.h> is supposed to take user-settable stuff like _GNU_SOURCE
and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in
the C library headers. Instead, bionic used to unconditionally define
_BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header
files (which makes no sense whatsoever).

Bug: 14659579
Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987
ath_sincos_test.cpp
4571f31bd49e4951c9f1e0ff642c74fd79fe740a 15-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Add atexit test for attributed c-tor/d-tor

1. Add test for __attribute__((constructor/destructor))
and static constructor

2. Compile C++ testlibs with -std=gnu++11

Change-Id: I67f9308144a0c638a51f111fcba8e1933fe0ba41
texit_test.cpp
ibs/Android.mk
ibs/atexit_testlib.cpp
1467dfe3e89975f0d4905e31a27ac06257c097cf 13-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Make string tests check all alignment combinations

Reduce randomization of the test by (1) replacing random() & 255
with hard-coded char and (2) by making State *Iteration function
visit every possible alignment combination instead of 10 random ones.

Change-Id: I0ff0b4ca817ba9fbbcce53e09b25eb10a1a853c2
tring_test.cpp
c5a13efa9bc4264be0a9a9e37c00633af01584ed 23-Jul-2014 Brigid Smith <brigidsmith@google.com> Added test for ifunc support in dynamic linker.

ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.

Bug:6657325
Change-Id: Ic0c48b1b0a76cb90f36c20c79f68294cc3fd44a1
lfcn_test.cpp
ibs/Android.mk
ibs/dlopen_testlib_ifunc.c
3e7b8e2a8bd16a37cecdae1135a5e7fc6e64c762 07-Aug-2014 Christopher Ferris <cferris@google.com> Merge "Do a second key cleanup in pthread_exit." into lmp-dev
18d93f2793fad393b6aa6eae6afe1054958339d5 06-Aug-2014 Christopher Ferris <cferris@google.com> Do a second key cleanup in pthread_exit.

During pthread_exit, the keys are cleaned. Unfortunately, a call to
free occurs after the cleanup and the memory for some of the keys
is recreated when using jemalloc. The solution is to do the key
cleanup twice.

Also, modify the pthread_detach__leak test to be less flaky
when run on a jemalloc system.

Bug: 16513133
Change-Id: Ic17e8344bdc1ba053c4f5b6d827a4c19c57860c1
thread_test.cpp
e380960813bbb6e05d820eb75885556a1c4bf6ac 06-Aug-2014 Christopher Ferris <cferris@google.com> Do a second key cleanup in pthread_exit.

During pthread_exit, the keys are cleaned. Unfortunately, a call to
free occurs after the cleanup and the memory for some of the keys
is recreated when using jemalloc. The solution is to do the key
cleanup twice.

Also, modify the pthread_detach__leak test to be less flaky
when run on a jemalloc system.

Bug: 16513133

(cherry picked from commit 18d93f2793fad393b6aa6eae6afe1054958339d5)

Change-Id: Idb32e7f9b09e2c088d256ed9eb881df80c81ff8e
thread_test.cpp
bc0d65c114f3ead6d89f8e92622bc941d731b01c 06-Aug-2014 Dan Albert <danalbert@google.com> Merge "Proper MB_CUR_MAX." into lmp-dev
6035e6cc8317600c3100fdf1070890c3e42715a7 30-Jul-2014 Dan Albert <danalbert@google.com> Proper MB_CUR_MAX.

Previously this was hard coded to 4. This is only the case for UTF-8
locales.

As a side effect, this properly reports C.UTF-8 as the default locale
instead of C.

Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc
(cherry picked from commit 1aec7c1a35b2d03038b194967d5ebdc8e2c24b80)
ocale_test.cpp
tdio_test.cpp
938a8008a61ecb6e975aa974dbf30ea7e1f298e2 31-Jul-2014 Dan Albert <danalbert@google.com> Fix mbsrtowcs(3) src param for finished string.

A mistake I made while cleaning this up the first time through.
mbstrtowcs(3) sets the src param to null if it finishes the string.

Change-Id: I6263646e25d9537043b7025fd1dd6ae195f365e2
(cherry picked from commit b6cc8e00cd562bd0f81fe44a6bc646540a862f32)
char_test.cpp
db7a17d4ff56a05af01ee2fee1f3c55245bfc630 05-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Revert "Fix dlsym(3) to do breadth first search.""

This reverts commit 1b1966d9448e979d1503a3d8843708bfa8880dc6.

Change-Id: I05d6d3481aaf8f3e260d2e5e950248519a1d347f
lfcn_test.cpp
ibs/Android.mk
1b1966d9448e979d1503a3d8843708bfa8880dc6 04-Aug-2014 Dmitriy Ivanov <dimitry@google.com> Revert "Fix dlsym(3) to do breadth first search."

This reverts commit 422106a24d620af4be58e8d92a2e9b7b6167b72d.

Change-Id: I9e26a6933d10eb30438b521450f2010997ca5aee
lfcn_test.cpp
ibs/Android.mk
61833de613990f2fdaf357bb3d854d72a4980890 31-Jul-2014 Christopher Ferris <cferris@google.com> Fix memchr with a zero length.

The memchr implementation for 64 bit fails if these conditions occur:

- The buffer is 32 byte aligned.
- The buffer contains the character in the first byte.
- The count sent in is zero.

The function should return NULL, but it's not.

Bug: 16676625

(cherry picked from commit e03e1eac0b7682884b6628df1305d34299680cb4)

Change-Id: Ie4cca2c445127a0936ee2b96651a8e7204fbaffd
tring_test.cpp
11bf8a3025a7b5aee891c521255a7db1860e5b12 30-Jul-2014 Elliott Hughes <enh@google.com> Only wipe TLS for user-supplied stacks.

Bug: 16667988

(cherry picked from commit 40a521744825b6060960c296d5fb3da4c6593d94)

Change-Id: I7550fa47b76e643323aa3e2a53529e393c829e47
thread_test.cpp
b6cc8e00cd562bd0f81fe44a6bc646540a862f32 31-Jul-2014 Dan Albert <danalbert@google.com> Fix mbsrtowcs(3) src param for finished string.

A mistake I made while cleaning this up the first time through.
mbstrtowcs(3) sets the src param to null if it finishes the string.

Change-Id: I6263646e25d9537043b7025fd1dd6ae195f365e2
char_test.cpp
1aec7c1a35b2d03038b194967d5ebdc8e2c24b80 30-Jul-2014 Dan Albert <danalbert@google.com> Proper MB_CUR_MAX.

Previously this was hard coded to 4. This is only the case for UTF-8
locales.

As a side effect, this properly reports C.UTF-8 as the default locale
instead of C.

Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc
ocale_test.cpp
tdio_test.cpp
0f7ed163cf6c1fe6d71a1d7e5fb6d0989213be85 31-Jul-2014 Christopher Ferris <cferris@google.com> Merge "Fix memchr with a zero length."
e03e1eac0b7682884b6628df1305d34299680cb4 31-Jul-2014 Christopher Ferris <cferris@google.com> Fix memchr with a zero length.

The memchr implementation for 64 bit fails if these conditions occur:

- The buffer is 32 byte aligned.
- The buffer contains the character in the first byte.
- The count sent in is zero.

The function should return NULL, but it's not.

Bug: 16676625
Change-Id: Iab33cc7a8b79920350c72f054dff0e0a3cde69ce
tring_test.cpp
aa0f2bdbc22d4b7aec5d3f8f5f01eaeaa13414c2 29-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Fix dlsym(3) to do breadth first search.

dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs
breadth first search through the dependency tree.

Bug: 16653281
Change-Id: I017a6975d1a62abb0218a7eb59ae4deba458e324
lfcn_test.cpp
ibs/Android.mk
a7dc7600fe1be1f3fd61856b407bb7065307e711 29-Jul-2014 Elliott Hughes <enh@google.com> Merge "Fix linkage of grantpt(3)."
4916706cfe590eb06c9b5bd4bd402ce056034d51 26-Jul-2014 Elliott Hughes <enh@google.com> Fix linkage of grantpt(3).

Also clean up the implementation of all the pty functions, add tests,
and fix the stub implementations of ttyname(3) and ttyname_r(3).

Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: I0fb36438cd1abf8d4e87c29415f03db9ba13c3c2
tdlib_test.cpp
a1a813da8184153606bfcf8ffcce557eda09a5ba 30-Jul-2014 Dan Albert <danalbert@google.com> Merge "Fix mbsrtowcs(3)'s handling of len parameter." into lmp-dev
4e5860958767ecc7bc455d2a5e1d2a2096a1c79f 20-Jul-2014 Dan Albert <danalbert@google.com> Fix mbsrtowcs(3)'s handling of len parameter.

The len parameter is a _maximum_ length. The previous code was treating
it as an exact length, causing the following typical call to fail:

mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in)

Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc
(cherry picked from commit 6b55ba54eff4657cffe053b71e1c9cce2944a8a9)
char_test.cpp
2ea0a58e01c1ed6db1da9dd0314ee053f5a32026 26-Jul-2014 Elliott Hughes <enh@google.com> Fix linkage of grantpt(3).

Also clean up the implementation of all the pty functions, add tests,
and fix the stub implementations of ttyname(3) and ttyname_r(3).

Bug: https://code.google.com/p/android/issues/detail?id=58888

(cherry picked from commit 4916706cfe590eb06c9b5bd4bd402ce056034d51)

Change-Id: I5cb7a1c17b156456e4c4818e65f256eb8d045424
tdlib_test.cpp
78e4f8fed2c162f8ada55180e48487ef2180cf93 28-Jul-2014 Elliott Hughes <enh@google.com> syscall(3)'s return type should be long.

This doesn't require us to change any of the syscall implementations
because (a) the LP32 ones have sizeof(int) == sizeof(long) anyway,
which is how we never noticed this bug before and (b) the LP64 ones
all use a 64-bit register for the result (and for the syscall number
too).

Bug: https://code.google.com/p/android/issues/detail?id=73952
Bug: 16568314

(cherry picked from commit 21972b61ec0572395c5684eebc6cc7b3a4c9e3be)

Change-Id: Ifbc424be29e5650ec72a24df25dd35f24fdd5b3c
nistd_test.cpp
b1b60c30bf321c0fc02264b953b5c16c49d34457 26-Jul-2014 Elliott Hughes <enh@google.com> Use vsnprintf(3) in syslog(3).

It seemed like a clever trick to use the internal log message formatting
code in syslog(3), but on reflection that means you can't (for example)
format floating point numbers. This patch switches us over to using good
old vsnprintf(3), even though that requires us to jump through a few hoops.

There's no obvious way to unit test this, so I wrote a little program and
ran that.

Bug: 14292866
Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5
ibc_logging_test.cpp
708c11205443cda14cfb21138d441106aa77a5f9 25-Jul-2014 Elliott Hughes <enh@google.com> Start hiding "private/bionic_time.h".

Bug: 15765976

(cherry picked from commit 905e6d58aaf515bf237e62078f8a321920fe4c6b)

Change-Id: Ic7435308e8b521886f42ac7bf59531924921ea67
ime_test.cpp
422106a24d620af4be58e8d92a2e9b7b6167b72d 29-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Fix dlsym(3) to do breadth first search.

dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs
breadth first search through the dependency tree.

Bug: 16653281

(cherry picked from commit aa0f2bdbc22d4b7aec5d3f8f5f01eaeaa13414c2)

Change-Id: I0ba8c2034ab341f8a279cdb4e2e7e47f1aef7897
lfcn_test.cpp
ibs/Android.mk
34b258dd692951ab2236e134e5520367cda60125 25-Jul-2014 Raghu Gandham <raghu.gandham@imgtec.com> [MIPS] Fix atomic_is_lock_free test for mips32.
On 32-bit MIPS, 64-bit atomic ops are achieved through locks.
So allow the test to fail for atomic_intmax_t on 32-bit MIPS.

(cherry picked from commit f1837377d215a6eda294b6ac7552b226deee91ce)

Change-Id: I973d999c31c9ab89b5a7b709beff6486b93408f2
tdatomic_test.cpp
b902641d7303d2ea24c10f6d6e7ff49e7ee75611 24-Jul-2014 Elliott Hughes <enh@google.com> Implement twalk(3), add unit tests.

I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD
ones are currently broken for non-circular lists).

I've not added the three hash table functions that should be in this header
because they operate on a single global hash table and thus aren't likely
to be useful.

Bug: https://code.google.com/p/android/issues/detail?id=73719

(cherry picked from commit 3e424d0a241f8ae5194514dabc4ad899f5a5416d)

Change-Id: I5882a6b48c80fea8ac6b9c27e7b9de10b202b4ff
ndroid.mk
earch_test.cpp
905e6d58aaf515bf237e62078f8a321920fe4c6b 25-Jul-2014 Elliott Hughes <enh@google.com> Start hiding "private/bionic_time.h".

Bug: 15765976
Change-Id: Ibd9cf07067ec8dffe9fda6c3d498d4ab90708220
ime_test.cpp
92d8b2320a4c3911452227f560ae4a39e83b0abf 23-Jul-2014 Nick Kralevich <nnk@google.com> debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping

PR_GET_DUMPABLE is used by an application to indicate whether or
not core dumps / PTRACE_ATTACH should work.

Security sensitive applications often set PR_SET_DUMPABLE to 0 to
disable core dumps, to avoid leaking sensitive memory to persistent
storage. Similarly, they also set PR_SET_DUMPABLE to zero to prevent
PTRACE_ATTACH from working, again to avoid leaking the contents
of sensitive memory.

Honor PR_GET_DUMPABLE when connecting to debuggerd. If an application
has said it doesn't want its memory dumped, then we shouldn't
ask debuggerd to dump memory on its behalf.

FORTIFY_SOURCE tests: Modify the fortify_source tests to set
PR_SET_DUMPABLE=0. This reduces the total runtime of
/data/nativetest/bionic-unit-tests/bionic-unit-tests32 from approx
53 seconds to 25 seconds. There's no need to connect to debuggerd
when running these tests.

Bug: 16513137

(cherry picked from commit be0e43b77676338fd5e6a82c9cc2b6302d579de2)

Change-Id: I6e1a9bce564e94fc19893d639b15f38c549cabfa
ortify_test.cpp
40a521744825b6060960c296d5fb3da4c6593d94 30-Jul-2014 Elliott Hughes <enh@google.com> Only wipe TLS for user-supplied stacks.

Bug: 16667988
Change-Id: Id180ab2bc6713e1612386120a306db5bbf1d6046
thread_test.cpp
f1837377d215a6eda294b6ac7552b226deee91ce 25-Jul-2014 Raghu Gandham <raghu.gandham@imgtec.com> [MIPS] Fix atomic_is_lock_free test for mips32.
On 32-bit MIPS, 64-bit atomic ops are achieved through locks.
So allow the test to fail for atomic_intmax_t on 32-bit MIPS.

Change-Id: I78e7807e50f899a0fea0d5b388d9ebb53228aaa0
tdatomic_test.cpp
d6f614a4e16b0fcf4a4fba748bf21fc0017d3619 25-Jul-2014 Elliott Hughes <enh@google.com> Merge "Implement twalk(3), add unit tests."
3e424d0a241f8ae5194514dabc4ad899f5a5416d 24-Jul-2014 Elliott Hughes <enh@google.com> Implement twalk(3), add unit tests.

I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD
ones are currently broken for non-circular lists).

I've not added the three hash table functions that should be in this header
because they operate on a single global hash table and thus aren't likely
to be useful.

Bug: https://code.google.com/p/android/issues/detail?id=73719
Change-Id: I97397a7b921e2e860fd9c8032cafd9097380498a
ndroid.mk
earch_test.cpp
21972b61ec0572395c5684eebc6cc7b3a4c9e3be 28-Jul-2014 Elliott Hughes <enh@google.com> syscall(3)'s return type should be long.

This doesn't require us to change any of the syscall implementations
because (a) the LP32 ones have sizeof(int) == sizeof(long) anyway,
which is how we never noticed this bug before and (b) the LP64 ones
all use a 64-bit register for the result (and for the syscall number
too).

Bug: https://code.google.com/p/android/issues/detail?id=73952
Change-Id: I9866c3579a7a94de27bfbe80ad7a822c3183c7fb
nistd_test.cpp
f1e83cc34a58761fc7bc5178c6f283db85d6057a 26-Jul-2014 Elliott Hughes <enh@google.com> Use vsnprintf(3) in syslog(3).

It seemed like a clever trick to use the internal log message formatting
code in syslog(3), but on reflection that means you can't (for example)
format floating point numbers. This patch switches us over to using good
old vsnprintf(3), even though that requires us to jump through a few hoops.

There's no obvious way to unit test this, so I wrote a little program and
ran that.

(cherry-pick of b1b60c30bf321c0fc02264b953b5c16c49d34457.)

Bug: 14292866
Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5
ibc_logging_test.cpp
be0e43b77676338fd5e6a82c9cc2b6302d579de2 23-Jul-2014 Nick Kralevich <nnk@google.com> debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping

PR_GET_DUMPABLE is used by an application to indicate whether or
not core dumps / PTRACE_ATTACH should work.

Security sensitive applications often set PR_SET_DUMPABLE to 0 to
disable core dumps, to avoid leaking sensitive memory to persistent
storage. Similarly, they also set PR_SET_DUMPABLE to zero to prevent
PTRACE_ATTACH from working, again to avoid leaking the contents
of sensitive memory.

Honor PR_GET_DUMPABLE when connecting to debuggerd. If an application
has said it doesn't want its memory dumped, then we shouldn't
ask debuggerd to dump memory on its behalf.

FORTIFY_SOURCE tests: Modify the fortify_source tests to set
PR_SET_DUMPABLE=0. This reduces the total runtime of
/data/nativetest/bionic-unit-tests/bionic-unit-tests32 from approx
53 seconds to 25 seconds. There's no need to connect to debuggerd
when running these tests.

Bug: 16513137
Change-Id: Idc7857b089f3545758f4d9b436b783d580fb653f
ortify_test.cpp
b76613627d045acd3bdb7294f424f14c21584872 22-Jul-2014 Elliott Hughes <enh@google.com> Rewrite syslog(3) to use Android logging.

Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866

(cherry picked from commit 3ad8ecb64e9dd5614169232b84a93eb3b8aa32d7)

Change-Id: I3038855ca4f22532bf6d2c45d3f8028b866975f9
ibc_logging_test.cpp
3ad8ecb64e9dd5614169232b84a93eb3b8aa32d7 22-Jul-2014 Elliott Hughes <enh@google.com> Rewrite syslog(3) to use Android logging.

Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866
Change-Id: Icee7f088b97f88ccbdaf471b98cbac7f19f9210a
ibc_logging_test.cpp
6b55ba54eff4657cffe053b71e1c9cce2944a8a9 20-Jul-2014 Dan Albert <danalbert@google.com> Fix mbsrtowcs(3)'s handling of len parameter.

The len parameter is a _maximum_ length. The previous code was treating
it as an exact length, causing the following typical call to fail:

mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in)

Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc
char_test.cpp
3002131da33401cf1b45abbdbec58b7c751fc43a 16-Jul-2014 Elliott Hughes <enh@google.com> Use VDSO for clock_gettime(2) and gettimeofday(2).

Bug: 15387103

(cherry picked from commit 625993dfbb085a3cde7492eda8ec1cdc1ee39a78)

Change-Id: I0e156d7049ba1495902259071a96936592e74025
ys_time_test.cpp
ime_test.cpp
625993dfbb085a3cde7492eda8ec1cdc1ee39a78 16-Jul-2014 Elliott Hughes <enh@google.com> Use VDSO for clock_gettime(2) and gettimeofday(2).

Bug: 15387103
Change-Id: Ifc3608ea65060c1dc38120b10b6e79874f182a36
ys_time_test.cpp
ime_test.cpp
99ae0983c0fd22e34e4d2aa61942b04e347447ee 14-Jul-2014 Elliott Hughes <enh@google.com> Implement rand/srand in terms of random/srandom.

Code developed for glibc or older versions of bionic might expect more
randomness than the BSD implementation provides.

Bug: 15829381

(cherry picked from commit 76c241b091b4d9d9a9237d40e814e52ce2917f47)

Change-Id: If721b3f16efdb21cb67df5ec5034c0ba905bd029
tdlib_test.cpp
76c241b091b4d9d9a9237d40e814e52ce2917f47 14-Jul-2014 Elliott Hughes <enh@google.com> Implement rand/srand in terms of random/srandom.

Code developed for glibc or older versions of bionic might expect more
randomness than the BSD implementation provides.

Bug: 15829381
Change-Id: Ia5a908a816e0a5f0639f514107a6384a51ec157e
tdlib_test.cpp
8e32b7b3543eadbb58a92443fb57d60aac92ef88 11-Jul-2014 Christopher Ferris <cferris@google.com> Make jemalloc the default choice.

Change-Id: I5ff0cf0c396b7ae6278e6fcd5a0d50f8b966fb54
ndroid.mk
6cdd0cfd2f279dfb20b9f7cccc963eb9ee91c666 09-Jul-2014 Ying Wang <wangying@google.com> Merge "TARGET_OUT_DATA_NATIVE_TESTS now points to $(TARGET_OUT_DATA)/nativetest64 in 64-bit target"
dc42e20d54f17cbcabb2e8584398566eb66c47c3 09-Jul-2014 Ying Wang <wangying@google.com> TARGET_OUT_DATA_NATIVE_TESTS now points to $(TARGET_OUT_DATA)/nativetest64 in 64-bit target

Change-Id: I9a562e79de7ec0f065c90de9ae1b72cbcd7d8c6b
ndroid.build.mk
f8846a45878faa9eb51fab3a2b347e9a36ecd250 09-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Add test for constructor function.

Change-Id: I0ad26d617f00cdd6c2241d613be39a1d16918612
lfcn_test.cpp
950a435fc0dffc22a816194af175420176b86908 03-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Load library using file handle."
04dc91ae763adc403a14c88b4c46f77b3d2d71a3 01-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Load library using file handle.

* This patch enables dlopen by file descriptor
instead of path/name.

Bug: 15984217
Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
ndroid.build.mk
lext_test.cpp
ibs/Android.mk
d06ee1d6db6165126161044fb662301bf9f04b3a 02-Jul-2014 Elliott Hughes <enh@google.com> Build all bionic test files -Werror and fix our one warning.

Change-Id: I62bb0528fd1bcb9aa4c61e44c78158a592690fc7
ndroid.mk
lfcn_test.cpp
ce0ba3c70634d5fe64b9a298d8a305d85bd1e6ac 02-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Disable local/protected symbol test for lp64

* Static linker optimizes protected local symbol
out of existence, which leads to test failure.
Disabling it for now.

Change-Id: I8de327e5073f98b64639f7a0bba3a273aa419884
lfcn_test.cpp
fcac81ef04ade6f31eddb71bfc9a30a1ecf47840 02-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Native tests are now multilib=both by default

Change-Id: I788ac0b871703c137727a65e017c4466127c0190
ndroid.build.mk
ndroid.mk
d97e9f546ea195686a78e539315b273393609b9e 29-Jun-2014 Dmitriy Ivanov <dimitry@google.com> Add support for protected local symbol lookup.

Bug: http://code.google.com/p/android/issues/detail?id=66048
Change-Id: Ib334223df27adad9477fb241ab099c5e26df4a7d
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_local_symbol.map
ibs/dlsym_local_symbol_private.cpp
ibs/dlsym_local_symbol_public.cpp
3a657d01eca1529ba7002cbee44e149988834c9d 27-Jun-2014 Christopher Ferris <cferris@google.com> Add extra strchr testing.

Change-Id: Idd0a779eb3388e402cfcb4e0df40872320f8e155
tring_test.cpp
ebb770f90d9a8d7f75a9d8b0e6a96ded96c617af 25-Jun-2014 Elliott Hughes <enh@google.com> Add a new pthread_key_delete test.

Bug: https://code.google.com/p/android/issues/detail?id=66813
Change-Id: Ida87bc1fb15a73a08c223a7099456d9f049cd3c5
thread_test.cpp
3f525d41c2acde2ae3309cf839d83d7f41ab2fe6 25-Jun-2014 Elliott Hughes <enh@google.com> Add splice, tee, and vmsplice.

Change-Id: I5f43380b88d776a8bb607b47dbbc5db5a2fe6163
cntl_test.cpp
fa9e16efaf0e885f6044e725eb759ef6de10f7ef 24-Jun-2014 Elliott Hughes <enh@google.com> Fix getpid caching across a clone.

If you make clone, fork, or vfork system calls directly, you're still
on your own, but we now do the right thing for the clone wrapper.
With this implementation, children lose the getpid caching, but we've
no reason to think that that covers any significant use cases.

Bug: 15387103
Change-Id: Icfab6b63c708fea830960742ec92aeba8ce7680d
nistd_test.cpp
7086ad6919feb2415c6027163f5c63323bcca27c 20-Jun-2014 Elliott Hughes <enh@google.com> Cache getpid.

In practice, with this implementation we never need to make a system call.
We get the main thread's tid (which is the same as our pid) back from
the set_tid_address system call we have to make during initialization.
A new pthread will have the same pid as its parent, and a fork child's
main (and only) thread will have a pid equal to its tid, which we get for
free from the kernel before clone returns.

The only time we'd actually have to make a getpid system call now is if
we take a signal during fork and the signal handler calls getpid. (That,
or we call getpid in the dynamic linker while it's still dealing with its
own relocations and hasn't even set up the main thread yet.)

Bug: 15387103
Change-Id: I6d4718ed0a5c912fc75b5f738c49a023dbed5189
nistd_test.cpp
ce44166c737b6737c3a0820bef10b074a5e36cf8 18-Jun-2014 Dmitriy Ivanov <dimitry@google.com> Fix weak function lookups

* Linker now correctly resolves function defined
with __attribute__((weak)).

Bug: https://code.google.com/p/android/issues/detail?id=70206
Change-Id: I82efb905676c25fefb1b11a13f5fecb0f1384657
lfcn_test.cpp
ibs/Android.mk
ibs/dlsym_weak_function.cpp
1f5e1a3cbc564c593fe1090894ecdb070f36e20c 03-Jun-2014 Dmitriy Ivanov <dimitry@google.com> Move libraries for unit-tests to separate folder

Change-Id: I1653f3f2fd63ba25525369bc725c8f7438ecf021
ndroid.build.mk
ndroid.mk
texit_testlib.cpp
lext_test_library.cpp
lopen_testlib_simple.cpp
mpty.cpp
ibs/Android.mk
ibs/atexit_testlib.cpp
ibs/dlext_test_library.cpp
ibs/dlopen_testlib_simple.cpp
ibs/empty.cpp
636196438180fd37027bf7b7119a436169b6923e 17-Jun-2014 Christopher Ferris <cferris@google.com> Use a separate config.h for config like defines.

This allows an easier way to share config parameters between unit tests
and the bionic code.

It also fixes a problem where the 32 bit bionic tests based on glibc, or
the cts list executable did not have the pvalloc,valloc tests.

Change-Id: Ib47942cb8a278252faa7498a6ef23e9578db544f
alloc_test.cpp
e5fdaa4f9d102461a4d8a865e6ca84666893b9e7 14-Jun-2014 Dan Albert <danalbert@google.com> Revert "Backing this one out since the counterpart needs to be sent upstream."

This reverts commit a04d2bc28e7d7fcaf34ad71e4a6608a13cf84197.

Change-Id: I1b49165ca5d4bafdba7948818256a6167a363aca
ndroid.mk
alloc_test.cpp
tring_test.cpp
a04d2bc28e7d7fcaf34ad71e4a6608a13cf84197 14-Jun-2014 Dan Albert <danalbert@google.com> Backing this one out since the counterpart needs to be sent upstream.

This reverts commit 5ee320dd35fafc11eaf90c62198e08c6670e35b4.

Change-Id: I1a9c6b06c3aca595f01c629f7649be743dc48e77
ndroid.mk
alloc_test.cpp
tring_test.cpp
5ee320dd35fafc11eaf90c62198e08c6670e35b4 12-Jun-2014 Dan Albert <danalbert@google.com> Hides valloc(3)/pvalloc(3) on LP64.

These were removed from POSIX 2004. Hides the header declarations for all
targets, and hides the symbols for LP64.

Bug: 13935372
Change-Id: Id592f67e9b7051517a05f536e1373b30162e669c
ndroid.mk
alloc_test.cpp
tring_test.cpp
5d25d5480ab1e02d8f1e39f5936a3180e84a842c 13-Jun-2014 Elliott Hughes <enh@google.com> Merge "Remove __memcmp16 from bionic."
24614b4729a4c8665193f5793b93019b37f779b1 13-Jun-2014 Elliott Hughes <enh@google.com> Remove __memcmp16 from bionic.

Change-Id: I2486d667d96c8900dd368d855f37c1327161efb7
tring_test.cpp
29ddd78c21b15117bc7d4fc196f3a503f3aab3e2 13-Jun-2014 Christopher Ferris <cferris@google.com> Merge "Put all allocation functions into dispatch table."
a403780538ac9d1a260e064df6599663f8cc4166 10-Jun-2014 Christopher Ferris <cferris@google.com> Put all allocation functions into dispatch table.

Implement these new functions for all of the debug malloc types.

Fix a number of bugs in the debug malloc functions related to overflow
conditions.
Fix a bug in dlpvalloc due to an overflow condition.

Fix various other bugs in the debug malloc functions.

Add new tests for malloc functions.

Bug: 11225066

Change-Id: Idf50f389603e2157645565bc15cd9365eec2e9dd
alloc_test.cpp
346fa721ca20e481a624930425d823d452e11dfe 12-Jun-2014 Elliott Hughes <enh@google.com> Merge "Get the full set of PRNG functions in <stdlib.h>"
a0beeeabbc8735bc830544cbbb1d920122b8d958 12-Jun-2014 Elliott Hughes <enh@google.com> Get the full set of PRNG functions in <stdlib.h>

Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: I435250bdae302e8bd7e29977d0fde7b9afbfca5e
tdlib_test.cpp
3d5e0b2045f899e27a071dc228dafc9378e90798 12-Jun-2014 Christopher Ferris <cferris@google.com> Merge "Add/Remove mmap tests."
eda26bc1ffc60dc722a375095b9de4fd86959a1d 12-Jun-2014 Christopher Ferris <cferris@google.com> Add/Remove mmap tests.

Remove the incorrect tests that use a negative offset for mmap without
a fd.

Add a small set of tests for mmap.

Bug: 15436969

Change-Id: Id537d33cd4cdc26dee6cdfa9bf9cf35754bce335
emporaryFile.h
ys_mman_test.cpp
37b845f9e410e326f24fa8c820774d92eafa4dd3 12-Jun-2014 Dan Albert <danalbert@google.com> Merge "Remove declaration for putw(3)/getw(3)."
8e613cf342b369f7985135dbe11ebdbf8c736157 11-Jun-2014 Dan Albert <danalbert@google.com> Remove declaration for putw(3)/getw(3).

These were both removed from POSIX 2004, and we don't define an
implementation for getw(3). Keep the definition of put(3) on LP32 for
binary compatibility.

Bug: 13935372
Change-Id: Iba384b45093ac6d2d7c2d81f7980cd7701dd6f56
tdio_test.cpp
e9f7a9c340a3af11de720042fdc5061b65dc9b78 11-Jun-2014 Christopher Ferris <cferris@google.com> Allow bionic-unit-tests-glibc to be built again.

When we switched to 64 bit host build be default, we no longer build
the glibc unit tests. Fix that, and also set all host targets to build
multilib.

This change also changes the name of bionic-unit-tests-glibc to add
the suffix of 32 or 64 depending on the host type built.

Change-Id: Ife13f9d80f351750ff02825b086d44bb0c2df828
ndroid.build.mk
ndroid.mk
68b01665b35849859f26f58f3044618b626abc2b 11-Jun-2014 Alexander Ivchenko <alexander.ivchenko@intel.com> Fix mbrtoc32 test from tests/uchar_test.cpp for x86.

Without that fix the test fails with:
"error: comparison between signed and unsigned integer expressions" on x86,
due to the fact that char is signed on x86.

Change-Id: I44462d67c15c7e9b730ad5da52eb9c05e207d34b
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
char_test.cpp
2aca7fe8214d9b4f421499a6f07579c888313649 10-Jun-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Fix memcmp16() test

__memcmp16() should return an integer less than, equal to, or greater than
zero. However the tests looks for a specific value.

Change-Id: I06052f58f9ccc67146a3df9abb349c4bc19f090e
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
tring_test.cpp
199e8638df12eb6373771ebb59a1f5a83c6de1cc 10-Jun-2014 Ying Wang <wangying@google.com> Merge "Use PRIVATE_POST_INSTALL_CMD to create symlink."
7f722b366aad52000465818ffbdc880676be9aae 10-Jun-2014 Ying Wang <wangying@google.com> Use PRIVATE_POST_INSTALL_CMD to create symlink.

Bug: 15520908
Change-Id: Ib3349f7adb6def81abf07bfb9d37093e4a599d09
ndroid.mk
18b17e97757a59718a23f8128dfc91c016df08b1 07-Jun-2014 Elliott Hughes <enh@google.com> Add a regression test for two libm bugs we didn't have.

Reported on the OpenBSD list, but we already had the fix for one from FreeBSD,
and I think the other only affected ld80 anyway. Worth having tests thuogh.

Change-Id: Ic4bbeb2384fd578a3ef13e4907be83deda50815f
ath_test.cpp
c3bdc792be78d788663ff9b5e019b4af852dc6f7 06-Jun-2014 Elliott Hughes <enh@google.com> Merge "Fix the printf family for non-ASCII."
69f05d291d848de654c72e5278de8ca06fbf5d2f 06-Jun-2014 Elliott Hughes <enh@google.com> Fix the printf family for non-ASCII.

The bug here turned out to be that we hadn't increased the constant
corresponding to the maximum number of bytes in a character to match
our new implementation, so any character requiring more than a byte
in UTF-8 would break our printf family.

Bug: 15439554
Change-Id: I693e5e6eb11c640b5886e848502908ec5fff53b1
tdio_test.cpp
char_test.cpp
fce861498c8c4720c6ad2475a73bb4c3e55d6948 26-May-2014 Varvara Rainchik <varvara.rainchik@intel.com> Fix for slm-tuned memmove (both 32- and 64-bit).

Introduce a test for memmove that catches a fault.
Fix both 32- and 64-bit versions of slm-tuned memmove.

Change-Id: Ib416def2610a0972e32c3b9b6055b54967643dc3
Signed-off-by: Varvara Rainchik <varvara.rainchik@intel.com>
tring_test.cpp
001f8f041bf21c53d4a0b919ef2c859b047bac0a 04-Jun-2014 Dan Albert <danalbert@google.com> Removes wcswcs from bionic for LP64.

Bug: 13935372
Change-Id: I0deb15e769da4fa81bb65a87f3c86db5163a5796
char_test.cpp
452e09130010b641904e7411e0c539590a654022 04-Jun-2014 Dan Albert <danalbert@google.com> Merge "Adds functionality specified by uchar.h"
7a7f9952c12b216fbf91fc4cdbb97045e8861115 02-Jun-2014 Dan Albert <danalbert@google.com> Adds functionality specified by uchar.h

mbrtoc32 and c32rtomb get their implementations from mbrtowc and wcrtomb. The
wc functions now simply call the c32 functions.

Bug: 14646575
Change-Id: I49d4b95fed0f9d790260c996c4d0f8bfd1686324
ndroid.mk
char_test.cpp
d286796fce1e6fff407b719a53eb2afbeb96c327 04-Jun-2014 Elliott Hughes <enh@google.com> Turn on -Wunused and fix the mistakes it uncovers.

Change-Id: I023d2d8b547fbc21d4124bb7510d42b06a0dc501
ndroid.mk
214e64135ee22e8aa7f71e56e0f5662dc6746ad0 31-May-2014 Dmitriy Ivanov <dimitry@google.com> Make atexit.dlclose work for glibc

* build libtest_atexit.so
* remove atexit(NULL) - glibc segfaults on it

Bug: 15350494
Change-Id: I27d79130c32c5691b0e8790a57d92f9710f5bf4a
ndroid.mk
texit_test.cpp
texit_testlib.cpp
39036f655aee275f307b9557270e1364b0c6ef36 30-May-2014 Christopher Ferris <cferris@google.com> Do not run dlclose test on glibc.

The support library for this test is not built for host by default.
Even if the support library is built, the test segfaults on glibc.

Change-Id: I9cb7a364c59b55d4bf5d8634293037cd9bae020b
texit_test.cpp
d178c83d45ef5ff5caa6f8e92d461ada72c37bd2 30-May-2014 Christopher Ferris <cferris@google.com> Fix unwinding_through_signal_frame test.

I accidentally removed the compilcation of the test implementation file
with special flags needed for the test to work. This change creates the
impl as a library with those flags back.

Bug: 14819262
Change-Id: Ib84fd26a7f4d40a0267d3ed686185b0abc5a3706
ndroid.mk
8bf50d5b72193d342f2c784ecbc5068d6baee114 30-May-2014 Christopher Ferris <cferris@google.com> Fix wmemmove test.

I accidentally copied over the nul terminator with the test.

Change-Id: I24a9aa05d4fba4f383fa38a3041bb6a6b179130c
char_test.cpp
9e01ea63a7517fe0c811ced3b822cf6e855ee62b 29-May-2014 Christopher Ferris <cferris@google.com> Fix dprintf test.

Change-Id: Ied783d545b6a35a70a158249f3957a9d00971627
tdio_test.cpp
1a57de713adfb81842cb2ebdfc051ecb9afa55f1 29-May-2014 Christopher Ferris <cferris@google.com> Merge "Fix overflow testing in sbrk."
738b0cc5e95a9a650e9621603f4dd8dd16b07568 22-May-2014 Christopher Ferris <cferris@google.com> Fix overflow testing in sbrk.

Modify the overflow testing for sbrk.

Bug: 15188366

Change-Id: Ia83f85f7c1789454d872279bd41f38f1ce6b8a34
nistd_test.cpp
6b3beb23d666b722deeb81672166766ad28e7340 29-May-2014 Dan Albert <danalbert@google.com> Fixes stdatomic.h test to match C11 spec

C11 defines the expected value to atomic_compare_exchange_* as being non-atomic
types. Using an atomic type is a syntax error in clang.

http://en.cppreference.com/w/c/atomic/atomic_compare_exchange

Change-Id: I74de1061fa1fc50d835451792d902000f368200e
tdatomic_test.cpp
8a405b027a9c8b3a614016f4824a03fa252e9e1e 28-May-2014 Christopher Ferris <cferris@google.com> Merge "Add optimized AArch64 versions of bcopy and wmemmove based on memmove"
e6c57fcb05b0dcbfa8129bb6f7d99093f4819370 24-May-2014 Elliott Hughes <enh@google.com> Add C11 <stdatomic.h>.

Bug: 14903517
Change-Id: I631dbfdaa698cf7fea8e3b5e18a32586383e62a5
ndroid.mk
tdatomic_test.cpp
6f2bde344123d8503cd60f3ecd3420f39aa24eb9 23-May-2014 Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> Add optimized AArch64 versions of bcopy and wmemmove based on memmove

Add optimized versions of bcopy and wmemmove for AArch64 based on the
memmove implementation

Change-Id: I82fbe8a7221ce224c567ffcfed7a94a53640fca8
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
char_test.cpp
fd0ce866ce46ed62aa17dc2959a085cb3bf5755d 24-May-2014 Christopher Ferris <cferris@google.com> Revert "Add optimized AArch64 versions of bcopy and wmemmove based on memmove"

This reverts commit 8167dd7cb98e87ffe9b40e4993c330b244ca2234.

For some reason I thought the bcopy change was bzero. The bcopy code doesn't pass our tests, so reverting until I can figure out what's wrong.

Change-Id: Id89fe959ea5105cd58dff6bba8d91a30cc4bcb07
char_test.cpp
8167dd7cb98e87ffe9b40e4993c330b244ca2234 23-May-2014 Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> Add optimized AArch64 versions of bcopy and wmemmove based on memmove

Add optimized versions of bcopy and wmemmove for AArch64 based on the
memmove implementation

Change-Id: Ie43d0ff4f8ec4edba5b4fb5ccacd941f81ac6557
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
char_test.cpp
92687e41bcf108957944dafa80a9bfda219bfb0f 22-May-2014 Calin Juravle <calin@google.com> Cleaned up pthread rwlocks implementation.

- used underscore_style_for_vars
- extracted time related functionality into a function
- cleaned up style
- removed unused fields from pthread_rwlock_t on LP64
- changed reservation in pthread_rwlock_t so that the size of the
structure equals glibc version

Bug: 8133149

Change-Id: I84ad3918678dc7f5e6b3db9b7e9b0899d3abe9cd
thread_test.cpp
44adf93b8eddb3a7965a3e9abc189408a1f5a7ea 22-May-2014 Dmitriy Ivanov <dimitry@google.com> Fix dlsym_failure NULL handle test

* RTLD_DEFAULT != (void*)0 only for bionic32

Change-Id: I3b3758835cf4085b0f899e2b62861591411aec13
lfcn_test.cpp
eea59ea21e04806fff48fdf4ad5ba117dcb0babb 22-May-2014 Calin Juravle <calin@google.com> Merge "Add dprintf test"
3eb9f1f6bade8085520d9b0ec35d84d69563ebe1 22-May-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Removed dlsym handle != NULL check for lp64"
6afb2a9a9729bbfd70ace602342b0173f3bad328 22-May-2014 Calin Juravle <calin@google.com> Add dprintf test

Change-Id: I0fe1b4d45c1312cf01deed6ce5db032d5513e908
tdio_test.cpp
172167163af5412c316a8be2f29ca8622984df32 22-May-2014 Calin Juravle <calin@google.com> Merge "Mutex-free implementation of pthread_rwlock"
76f352eec12d8938101e5ae33429c72797c3aa23 19-May-2014 Calin Juravle <calin@google.com> Mutex-free implementation of pthread_rwlock

Bug: 8133149
Change-Id: Id6775010d95f2634b173daa55d87a59a3cf4131b
thread_test.cpp
ca1c80220e9b16fde7a761ca1c2c63dbe8071e0f 22-May-2014 Dmitriy Ivanov <dimitry@google.com> Removed dlsym handle != NULL check for lp64

* Removed unnecessary NULL check in dlsym
* Fixed dlsym_failure test to account for
correct RTLD_DEFAULT value
* Added temporary check for legacy RTLD_DEFAULT
value for non-yet-recompiled binaries

Bug: 15146875
Change-Id: I089fa673762629f5724b6e4fbca019d9cfc39905
lfcn_test.cpp
72bbd423579bb971dc06cdd3c06201faf3fe95e6 08-May-2014 Christopher Ferris <cferris@google.com> Support for jemalloc to replace dlmalloc.

To use jemalloc, add MALLOC_IMPL = jemalloc in a board config file
and you get the new version automatically.

Update the pthread_create_key tests since jemalloc uses a few keys.
Add a new test to verify memalign works as expected.

Bug: 981363

Change-Id: I16eb152b291a95bd2499e90492fc6b4bd7053836
ndroid.mk
alloc_test.cpp
afb89c2a01089bb247456634a15a58f111bb55a6 20-May-2014 Christopher Ferris <cferris@google.com> Merge "denver: optimize memmove"
6c80ccdeed9d9b30e961f68229fe8171d79c5d14 12-May-2014 Shu Zhang <chazhang@nvidia.com> denver: optimize memmove

Optimize 32-bit denver memmove with reversal memcpy.

Change-Id: Iaad0a9475248cdd7e4f50d58bea9db1b767abc88
tring_test.cpp
b648a8a57ee42533a5bf127225a252f73ca2cbbc 20-May-2014 Dmitriy Ivanov <dimitry@google.com> Add RTLD_NOLOAD support and some related changes.

* Aligned RTLD_ values with glibc for lp64
* dlopen supports RTLD_NOLOAD flag
* soinfo_unload calls find_library(.., RTLD_NOLOAD)
instead of naive find_loaded_library_by_name()
* dlopen changed to add child to caller soinfo instead
of somain.

Bug: https://code.google.com/p/android/issues/detail?id=64069
Change-Id: I1a65f2c34f3e0edc6d2c41a2e408b58195feb640
ndroid.mk
lfcn_test.cpp
lopen_testlib_simple.cpp
de9ac710534626e6796ea885f8480fc4cfd64158 20-May-2014 Elliott Hughes <enh@google.com> Use -fvisibility=hidden to build libm.

Bug: 11156955
Change-Id: I77b7772a44313a1eb3970f5d2c8e2af63690efa4
ath_test.cpp
77338a2969c4b5d6de5200c326ef67d6a82e95b2 20-May-2014 Ben Cheng <bccheng@google.com> Merge "Address additional warnings found by GCC 4.9."
caff5f2e1a1c23f70ecf529a84d4d75d2445a44a 19-May-2014 Ben Cheng <bccheng@google.com> Address additional warnings found by GCC 4.9.

Change-Id: If668a6eb98a6ce7b2872f528b8e3527638814f68
char_test.cpp
568d64dc6213b137e43d65e007cc2c60adc16071 14-May-2014 Jingwei Zhang <jingwei.zhang@intel.com> Accuracy tests for libm

This patch adds tests for 14 math functions to address coverage
issue of math functions discussed in:
https://android-review.googlesource.com/#/c/49653/

Change-Id: Ia7200b93d4f5c7928a3fb827ca6932226384a116
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
ndroid.mk
ath_cos_test.cpp
ath_cosf_test.cpp
ath_exp_test.cpp
ath_expf_test.cpp
ath_log_test.cpp
ath_logf_test.cpp
ath_pow_test.cpp
ath_powf_test.cpp
ath_sin_test.cpp
ath_sincos_test.cpp
ath_sincosf_test.cpp
ath_sinf_test.cpp
ath_tan_test.cpp
ath_tanf_test.cpp
86bc436e20621656cd76b653ae3396c6584259e5 15-May-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Improve detection of already loaded libraries"
9b95ea936a72532c3124963312d348c6ee453d78 14-May-2014 Calin Juravle <calin@google.com> Document a known test issue in stdio_test.cpp.

Bug: 13077905
Change-Id: Iab7fc7be0737c732e26cc07ecd7884b3087b51bb
tdio_test.cpp
d59e50063ad708509f3ad83350be33f5612c4f54 09-May-2014 Dmitriy Ivanov <dimitry@google.com> Improve detection of already loaded libraries

Linker is now able to resolve symlinked libraries correctly.

soinfo is extended to save the graph of dependencies during
load/unload. Dependencies are used only in CallConstructor.

Bug: 9741592
Change-Id: Id9c48a74c46aa89bcdf3d54ec2f8ba3d398130b1
ndroid.mk
c9244bdac1ae254bdbb9687da9cdbb4c3f4cb432 14-May-2014 Elliott Hughes <enh@google.com> Add tests for fprintf behavior when the underlying fd is bad.

Bug: 7229520
Change-Id: Ie878e0c13fdcda7b9131fa56208b84ed88125be7
tdio_test.cpp
e77f38f14a01be7d0e1f2ca055047579ec42ffb7 14-May-2014 Elliott Hughes <enh@google.com> Add a unit test for already-fixed printf -0.0 formatting.

This was fixed by the upgrade to upstream head.

Bug: 5084292
Change-Id: Ia3bda1c0bbe38f428e22213b8bdbdf1a16caccf2
tdio_test.cpp
3694ec6c4b644064f7e00b898cd11e138e4f6c09 14-May-2014 Elliott Hughes <enh@google.com> Add a regression test for a long-fixed pthread_once bug.

Bug: 1934122
Change-Id: Iae09baedc2c6ed4036521e51718fe9d015bc56b9
thread_test.cpp
1728b2396591853345507a063ed6075dfd251706 14-May-2014 Elliott Hughes <enh@google.com> Switch to g_ for globals.

That's what the Google style guide recommends, and we're starting
to get a mix.

Change-Id: Ib0c53a890bb5deed5c679e887541a715faea91fc
lfcn_test.cpp
thread_test.cpp
ignal_test.cpp
nistd_test.cpp
5c8c88dd8d0a371d30096aa107297ebc23e96a45 14-May-2014 Elliott Hughes <enh@google.com> Use the NetBSD inet_ntop until the OpenBSD bug is fixed.

Stupidly I found this bug by accident when writing the existing
tests, but I didn't think any real code would hit it. It turns
out that libcore always uses an INET6_ADDRSTRLEN-sized buffer
even when working with AF_INET addresses.

Change-Id: Ieffc8e4bbe9b66b49b033e3e7101c896e097e6f8
rpa_inet_test.cpp
6a41b0fb0e589c4afc4ecbcf7c425f0aa40eaea4 14-May-2014 Elliott Hughes <enh@google.com> Flesh out <arpa/inet.h>.

Use the upstream OpenBSD implementations of these functions.

Also ensure we have symbols for htonl, htons, ntohl, and ntohs.
gtest doesn't like us using the macro versions in ASSERT_EQ.

Bug: 14840760
Change-Id: I68720e9aca14838df457d2bb27b999d5818ac2b5
ndroid.mk
rpa_inet_test.cpp
063525c61d24776094d76971f33920e2a2079530 13-May-2014 Elliott Hughes <enh@google.com> Consistently use #if defined(__BIONIC__) in tests.

I've also switched some tests to be positive rather than negative,
because !defined is slightly harder to reason about and there are
only two cases: bionic and glibc.

Change-Id: I8d3ac40420ca5aead3e88c69cf293f267273c8ef
lfcn_test.cpp
cntl_test.cpp
ortify_test.cpp
ocale_test.cpp
egex_test.cpp
ched_test.cpp
tdio_test.cpp
tdlib_test.cpp
ys_resource_test.cpp
nistd_test.cpp
char_test.cpp
eb664e24c074b88539b743668109d8b4eaa925bd 13-May-2014 Elliott Hughes <enh@google.com> Add getmntent_r to our collection of <mntent.h> compatibility stubs.

This helps build 'external/flo' out of the box.

Bug: 14841211
Change-Id: I30dde77239cceaf1f5743163744eb3604d27a266
ndroid.mk
ntent_test.cpp
03e4ebee8d1579fbbc6157c1e9be4537bcad0c62 08-May-2014 Calin Juravle <calin@google.com> Add fpos_t tests.

Bug: 13077905

Change-Id: I86bb0ee95660f69f9971231c6f828a3a067d1ac8
tdio_test.cpp
15a6310e4b745add324b07a5d3d297aa95a56f59 08-May-2014 Calin Juravle <calin@google.com> Support mb sequences across calls to mb*to*wcs* functions

Bug: 13077905
Change-Id: I5abdc7cc3c27c109b7900c94b112f18a95c35763
char_test.cpp
20f8aec8976b17ad4d9da6be265594d924f368e1 13-May-2014 Elliott Hughes <enh@google.com> Fix use-after-free errors in stdio_test.

fclose(3) frees the passed-in FILE*. We should close(2) the underlying fd,
not fclose(3) the stream, if we want to test what happens with a stream
we can't read from.

Bug: 14466691
Change-Id: I99fed5904b0266b9c6ae05d0b9cf2e926446c064
tdio_test.cpp
4d695bf5606f2cf4029a7ff4e6dd61073407d3b0 12-May-2014 Calin Juravle <calin@google.com> Merge "Align struct passwd definition with other variations of libc"
c768874c667794bee278b9fbf207b5ca5df4e7a6 09-May-2014 Calin Juravle <calin@google.com> Align struct passwd definition with other variations of libc

Add pg_gecos ("real name") field to struct passwd.

Bug: 14679430
Bug: 12875898
Change-Id: I833ec2c46f6a6259b7232a8e3f7942968ef0b50d
tubs_test.cpp
55b4c8a4a15723f7c5f68b9ab167fbdea0c4e610 09-May-2014 Elliott Hughes <enh@google.com> Merge "Hide the __bionic_clone and __bionic_clone_entry implementation details."
954cf0d4e2669f91194b45f484152e47efa4f6c7 09-May-2014 Elliott Hughes <enh@google.com> Hide the __bionic_clone and __bionic_clone_entry implementation details.

clone(2) is the public symbol.

Also switch a test from __bionic_clone to clone; testing public API
means the test now works on glibc too.

Change-Id: If59def26a00c3afadb8a6cf9442094c35a59ffde
thread_test.cpp
ched_test.cpp
29d10e3de8f5258fec25174eb5f55eb19577859e 09-May-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Test dlopen with symlinked .so files"
170daa042cb0ef3e5d7839f79d052a683b3c670f 09-May-2014 Elliott Hughes <enh@google.com> Merge "wchar_test.cpp: fix error between comparison signed and unsigned integer"
7db180919c335287b201e859faa8ee0dbe281cde 08-May-2014 Dmitriy Ivanov <dimitry@google.com> Test dlopen with symlinked .so files

Bug: 9741592
Change-Id: I68c59d6f4e690136395c3dc3de13f99ce38de528
ndroid.mk
lfcn_test.cpp
a5c6b2ecb55afd75630cbe38dd2b88172cfa304d 08-May-2014 Yongqin Liu <yongqin.liu@linaro.org> wchar_test.cpp: fix error between comparison signed and unsigned integer

when compile the cts package with aarch64 gcc4.9, will get following error:
bionic/tests/wchar_test.cpp:253:3: required from here
external/gtest/include/gtest/gtest.h:1448:16:
error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

this change fix it by using static_cast<wchar_t> as suggested by Calin Juravle

Change-Id: I7fb9506e7b84b8a12b9d003458d4f0e78554c3cd
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
char_test.cpp
3b968032848426c12185fe1c0f20e5bc882ed388 08-May-2014 Elliott Hughes <enh@google.com> Merge "Add basic tests for fsync/fdatasync."
a62a28d1d9c8df7cb77e4bca19814922729b5291 07-May-2014 Elliott Hughes <enh@google.com> Add basic tests for fsync/fdatasync.

Bug: 14613980
Change-Id: Ie8002c2a1abae07295b7bdb33772764767c03d37
nistd_test.cpp
f837cbdc27a0f024bdc9898177a8ac05817441a7 07-May-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Add missing test for atexit test suite."
6396da98cb3313048ae9a8147523ed61f675fd50 06-May-2014 Dmitriy Ivanov <dimitry@google.com> Add missing test for atexit test suite.

Change-Id: I3d14d7df1da53ccef534c106633593551ab6a7cb
ndroid.mk
texit_test.cpp
texit_testlib.cpp
837abf04667c29db178fd28f500537429a18be30 07-May-2014 Calin Juravle <calin@google.com> Merge "Fix bionic-unit-tests-glibc-run target"
0e9d7fccb9c3b688992f2ef9ac1cfd1f456b1ed7 07-May-2014 Calin Juravle <calin@google.com> Fix bionic-unit-tests-glibc-run target

Configure multilib for bionic-unit-tests-glibc-run target (the path to
the host executable was already patched to support multilib build but
the multilib itself wasn't configured).

Change-Id: If533fbdb19bc737e543cf85a0787505458f24579
ndroid.mk
35cff760dfc5d9d1432955503ffff02286ac20ef 07-May-2014 Torne (Richard Coles) <torne@google.com> Merge "Test that relro sharing actually saves memory."
100168abff75f41c0179a77777f0aef622f7ed9f 06-May-2014 Elliott Hughes <enh@google.com> Merge "Fix <math.h> to quieten most of our warnings."
26052616915fe2324755687c7db73d69c521b34d 02-May-2014 Torne (Richard Coles) <torne@google.com> Test that relro sharing actually saves memory.

Spawn 20 child processes, have them all load the library, and compare
the total PSS used in the case where we use dlopen() and the case where
we use android_dlopen_ext() with relro sharing. We assume we will save
at least 10% of the memory; in practise this example saves 40% or more
so this should be a reasonable threshold.

Bug: 14299541
Change-Id: Idccf6b8b0eb137abae2200f1ce68fb76b3cbdd75
ndroid.mk
lext_test.cpp
9b5ee4aa85cf55467eb9a749b6602f6f2ba1cfc6 06-May-2014 Torne (Richard Coles) <torne@google.com> Merge "Handle empty relro segment or incorrectly sized file."
9a5a3e8e74e2c6d7850ab29711189acf0f7378a2 06-May-2014 Elliott Hughes <enh@google.com> Fix <math.h> to quieten most of our warnings.

I've reported the wcsftime bug upstream, but we really just want to use -D
to ensure the buggy code isn't built. (I've also brought our strftime a bit
closer to upstream now we have the right define.)

I don't think upstream is likely to fix all their sign-compare and
uninitialized warnings, so let's just silence them.

As for libm, again upstream isn't likely to fix all their warnings, and
silencing those made the ones that were our fault stand out. I've fixed
our <math.h> to fix the warnings caused by our lack of definitions for
the non-imprecise long-double functions. I checked the C99 standard, and
all these functions are there.

Change-Id: Iee8e1182c1db375058fb2c451eceb212bab47a37
ath_test.cpp
9ded07cff6c73bd3ea1bbc874180139d3a5d6f0c 25-Feb-2014 Philip Hatcher <philip.hatcher@intel.com> bionic: make epoll_event structure packed

Description: In the kernel the epoll_event structure is packed
in 64 bit kernel builds to allow the structure to be more easily
compatible with 32 bit user space. As a result, when user space
is 64-bit the structure must be packed as well.

Add unit test to show the ptr alignment issue.

Change-Id: I2c4848d5e38a357219091f350f9b6e3da05090da
Signed-off-by: Philip Hatcher <philip.hatcher@intel.com>
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Reviewed-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
Tested-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
ys_epoll_test.cpp
ad534985ec3e01d37d46c50caa562f6482f48347 05-May-2014 Elliott Hughes <enh@google.com> Merge "Disable %n in printf and vfwprintf."
e2341d08fa4a4e0c22056c410fd34d3f93e06017 03-May-2014 Elliott Hughes <enh@google.com> Disable %n in printf and vfwprintf.

Bug: 14492135
Change-Id: If190bede29e5f68a65043ddbe8e878c660933d03
tdio_test.cpp
8ec21d9ded4c05744b3f9388bf824a508d7c95c2 05-May-2014 Elliott Hughes <enh@google.com> Merge "Switch to current upstream OpenBSD wsetup.c."
53b24382f5299931af5d08c933a765334a092c56 03-May-2014 Elliott Hughes <enh@google.com> Switch to current upstream OpenBSD wsetup.c.

Change-Id: I2c1123f3e1d3c4af7fd7bf354e763934a39b78c0
tdio_test.cpp
580b246917d58fafc757daaf097b6bd20b17970a 05-May-2014 Dmitriy Ivanov <dimitry@google.com> Merge "Fixes for __cxa_finalize"
6b56691a678420477595a531b2d2829980eb51c0 29-Apr-2014 Dmitriy Ivanov <dimitry@google.com> Fixes for __cxa_finalize

* Ability to register atexit handler from atexit handler
* Correct way to handle both forms of atexit handler

Bug: https://code.google.com/p/android/issues/detail?id=66595
Bug: 4998315
Change-Id: I39529afaef97b6e1469c21389d54c0d7d175da28
ndroid.mk
texit_test.cpp
texit_testlib.cpp
efaa461bd67cfdfcbc2b4c6b69805bc5b929ae05 03-May-2014 Elliott Hughes <enh@google.com> Use the OpenBSD wcsftime.

Change-Id: I81929355d245ba1e58b4a464ca6cf45915e0238e
char_test.cpp
26ec9679ff01fb155ae21015f31cc95bed24f670 30-Apr-2014 Torne (Richard Coles) <torne@google.com> Handle empty relro segment or incorrectly sized file.

If the file has no relro segment, the generated relro file will have
length 0, which caused mmap to fail. If the relro file has nonzero size,
but is too short (e.g. because it's for the wrong version of the
library), the linker would segfault while comparing the data. Fix both
these issues: don't try to map a zero length file, and don't try to
compare data that would be beyond the end of the file.

Improve test to explicitly generate two versions of the library: one
with -z relro, and one with -z norelro, so we can test both cases; also
explicitly test the case where the relro file has length 0.

Bug: 14299541
Change-Id: Id8b95585edda90e8bb5de452a35b70ed2d224934
ndroid.mk
lext_test.cpp
f83e644e2c8ea041d5864c25d0aa40cff579d2f7 02-May-2014 Elliott Hughes <enh@google.com> Fix wchar.cpp MIPS narrowing conversion build failure.

Change-Id: Id9103c78958d60337dbdb807b11256c1b31c632a
char_test.cpp
5a0aa3dee247a313f04252cf45608097695d5953 01-May-2014 Elliott Hughes <enh@google.com> Switch to a working UTF-8 mb/wc implementation.

Although glibc gets by with an 8-byte mbstate_t, OpenBSD uses 12 bytes (of
the 128 bytes it reserves!).

We can actually implement UTF-8 encoding/decoding with a 0-byte mbstate_t
which means we can make things work on LP32 too, as long as we accept the
limitation that the caller needs to present us with a complete sequence
before we'll process it.

Our behavior is fine when going from characters to bytes; we just
update the source wchar_t** to say how far through the input we got.

I'll come back and use the 4 bytes we do have to cope with byte sequences
split across multiple input buffers. The fact that we don't support
UTF-8 sequences longer than 4 bytes plus the fact that the first byte of
a UTF-8 sequence encodes the length means we shouldn't need the other
fields OpenBSD used (at the cost of some recomputation in cases where a
sequence is split across buffers).

This patch also makes the minimal changes necessary to setlocale(3) to
make us behave like glibc when an app requests UTF-8. (The difference
being that our "C" locale is the same as our "C.UTF-8" locale.)

Change-Id: Ied327a8c4643744b3611bf6bb005a9b389ba4c2f
char_test.cpp
9fb53dd4dbaa7633c234d9da8417827fa3d3c32f 30-Apr-2014 Elliott Hughes <enh@google.com> Merge "Make SIGRTMIN hide the real-time signals we use internally."
2d36750c3ad8fd91cf52cb0ed8f38ecfd88b0f13 30-Apr-2014 Elliott Hughes <enh@google.com> Fix the CPU_*_S tests.

Change-Id: Id67c48b9c12a20b01309490670438bfcd9163465
ched_test.cpp
0990d4fda898ada86e557f872f5cb7d16b138e3c 30-Apr-2014 Elliott Hughes <enh@google.com> Make SIGRTMIN hide the real-time signals we use internally.

__SIGRTMIN will continue to tell the truth. This matches glibc's
behavior (as evidenced by the fact that we don't need a special case
in the strsignal test now).

Change-Id: I1abe1681d516577afa8cd39c837ef12467f68dd2
ignal_test.cpp
tring_test.cpp
77473e408504a7e298816b4071cd6902065b03d8 30-Apr-2014 Calin Juravle <calin@google.com> Merge "Fix cpu_set_t"
b743790ccabd9b0b93355ff693066478d10dae0d 29-Apr-2014 Calin Juravle <calin@google.com> Fix cpu_set_t

- extend CPU_SETSIZE for LP64
- fix CPU_(AND|OR|XOR) macros
- fix CPU_OP_S macro
- fix __sched_cpucount
- tidy up the code

Change-Id: I741afff4d0c473e8a1ee6b4141981dc24467e0d4
ched_test.cpp
b8425c549a0bfe08b01b5906b95603d8523c1b16 30-Apr-2014 Dan Albert <danalbert@google.com> Adds quick_exit(3) and at_quick_exit(3) from freebsd

Change-Id: I4fe88abd8f7b8aa45e58aeb2529d59a8d555d338
ndroid.mk
tdlib_test.cpp
01ae00f3170ad0e36c1657f6ff8c89dfa730fd37 30-Apr-2014 Elliott Hughes <enh@google.com> Switch to the OpenBSD implementations of the wide scanf functions.

This also gets us the C99 wcstoimax and wcstoumax, and a working fgetwc and
ungetwc, all of which are needed in the implementation.

This also brings several other files closer to upstream.

Change-Id: I23b025a8237a6dbb9aa50d2a96765ea729a85579
nttypes_test.cpp
55cd82762f3173247dc7e0eae2826aa24d22213a 30-Apr-2014 Elliott Hughes <enh@google.com> Merge "Switch to the OpenBSD wcsto* functions."
3d7a0d9b08ecab054b2dff8332507644de3690b0 29-Apr-2014 Elliott Hughes <enh@google.com> Switch to the OpenBSD wcsto* functions.

This replaces a partial set of non-functional functions with a complete
set of functions, all of which actually work.

This requires us to implement mbsnrtowcs and wcsnrtombs which completes
the set of what we need for libc++.

The mbsnrtowcs is basically a copy & paste of wcsnrtombs, but I'm going
to go straight to looking at using the OpenBSD UTF-8 implementation rather
than keep polishing our home-grown turd.

(This patch also opportunistically switches us over to upstream btowc,
mbrlen, and wctob, since they're all trivially expressed in terms of
other functions.)

Change-Id: I0f81443840de0f1aa73b96f0b51988976793a323
ndroid.mk
nistd_test.cpp
char_test.cpp
7fdab460a9790959ce6c4201476a3ea982eb148e 29-Apr-2014 Christopher Ferris <cferris@google.com> Merge "Fix potential makefile bug."
5090964da02c956f099a49b5a3eb732c0085c58b 29-Apr-2014 Christopher Ferris <cferris@google.com> Fix potential makefile bug.

Since multilib is not set every time, it needs to be per module or
there is a change that another target will use the multilib value set
previously.

Change-Id: I5c30e18d5111705cb3f6e3d4cd9ef8a28c9b746c
ndroid.build.mk
ndroid.mk
0a5e26da1eae6b75a89695faf2e057c5c4717721 29-Apr-2014 Elliott Hughes <enh@google.com> Add mbtowc and fix mbrtowc.

Change-Id: I48786cd82587e61188d40f6fd6e11ac05e857ae9
char_test.cpp
d299bcfdad959a3a0adf1683605b15a1c3b3ab66 29-Apr-2014 Elliott Hughes <enh@google.com> Replace our broken wcswcs with the working upstream one.

Change-Id: I2952684df5674d10f0564d92c2cd42597725c0e3
char_test.cpp
329103d3e2f42d3e35a060c3e0d326d6476eb2ef 26-Apr-2014 Elliott Hughes <enh@google.com> Don't use so much stack in tzcode.

Bug: 14313703
Bug: https://code.google.com/p/android/issues/detail?id=61130
Change-Id: Id9b240fce20d4a6f2660792070e02b2b5f287655
ime_test.cpp
533dde4dbf87d6615952be3654fc74e5ff2e1003 26-Apr-2014 Elliott Hughes <enh@google.com> Fix brk/sbrk error checking.

Note that the kernel returns the current break on error or if the requested
break is smaller than the minimum break, or the new break. I don't know where
we got the idea that the kernel could return -1.

Also optimizes the query case.

Also hides an accidentally-exported symbol for LP64.

Change-Id: I0fd6b8b14ddf1ae82935c0c3fc610da5cc74932e
nistd_test.cpp
ae77f74bcf51cb4199c9f7e87ec9c751fdd1842b 24-Apr-2014 Calin Juravle <calin@google.com> Merge "Clean-up _fpmath and fake_long_doubles"
409588cdae447a0e58bf136a9ea3a9b8d321fbf3 24-Apr-2014 Elliott Hughes <enh@google.com> Fix fallout from host GCC upgrade.

I'll raise a bug for the FD_ISSET fortification; we should do better too.

Change-Id: Id2bf277890ad06b010dc952e270d746714c2bea7
ortify_test.cpp
1abc9ff6a5b5f8a9925f1b8d9d333bc5bc7d407f 17-Apr-2014 Calin Juravle <calin@google.com> Clean-up _fpmath and fake_long_doubles

- promoted IEEEld2bits to fpmath since most of the where the same for
diffrent archs
- removed _fpmath
- reinstated weak_references
- moved isfinite and isnormal to libc
- clean up fake_long_doubles
- clean up some useless ifdefs
- added missing nexttoward* tests

Bug: 14134235
Change-Id: I95639c4885653fe47fd7dc0570ee5bb3389bbc6b
ath_test.cpp
0c567f1e6cfceada98ba10deb4bac6030c9d20f7 23-Apr-2014 Elliott Hughes <enh@google.com> Fix the glibc tests again.

The glibc tests are just a regular host binary; they don't require
that you're targeting x86 or x86_64. They do seem to pick up the
suffix of the target though, even though they're always 32-bit.

Change-Id: I689ca2a4f8d7b397afa4df722b95b0d7ec904bf6
ndroid.mk
cbf6df0459f05e180d1c50b3f5b36cdd483193c6 17-Sep-2013 Grigoriy Kraynov <grigoriy.kraynov@intel.com> Tests for environment variables utility functions

This is the first patch from the new set of tests for Bionic standard functions.

Change-Id: Ie568788a24832394e597ad33f44a5c71cb33b51f
Signed-off-by: Grigoriy Kraynov <grigoriy.kraynov@intel.com>
nistd_test.cpp
53c884e28166678b2fa40cb3763d1549074628ad 23-Apr-2014 Dmitriy Ivanov <dimitry@google.com> Get ANDROID_DATA dir from enviroment

Change-Id: Ie3675bd27bbc779fc2140f95b930eadd14838753
lext_test.cpp
156c3afcf178b8a6c29b9edc7e8d13999a58d857 23-Apr-2014 Dmitriy Ivanov <dimitry@google.com> Follow up on building tests for both platforms

this makes run-on-host work properly

Change-Id: Iaed93ca9d96359b64bbeff995280ecd70fc9cc60
ndroid.mk
345b49a7c07fde18e9397ffba9079ff81a4c3d74 22-Apr-2014 Christopher Ferris <cferris@google.com> Build 32/64 bit versions of tests/benchmarks.

Change-Id: I4d146377aac6573a214dfaa5cab5cce8b10538b4
ndroid.build.mk
ndroid.mk
c5eea6d386c23bde6f0400a8959ed21081d8365b 22-Apr-2014 Elliott Hughes <enh@google.com> Merge "Fix WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN."
b1bfa7956c56c28b8c914e6606df191e094e7b42 22-Apr-2014 Torne (Richard Coles) <torne@google.com> Merge "Allow sharing the RELRO section via a file."
c363e5dd0a15aac9036b453f655a3a0ae5cd32cd 22-Apr-2014 Torne (Richard Coles) <torne@google.com> Merge "Support loading libraries to a reserved address."
83c07b5e50207458445262ed10b79aa6b2d2d0ce 22-Apr-2014 Elliott Hughes <enh@google.com> Fix WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.

GCC tells us everything we need to know. clang does its usual half-assed job.

Change-Id: Id4d664529b10345274602768cd564d3df717e931
char_test.cpp
1b836ee6f8e5c0f61d67c1f014819a066366ab6f 18-Apr-2014 Elliott Hughes <enh@google.com> Fix a wchar.wcstombs_wcrtombs test failure.

Looks like I screwed up a last-minute refactor and didn't re-run the tests.

Change-Id: I90a710ae66a313a9812859650aa0b4e8c6bc57f9
char_test.cpp
b88da06580a22d9a1ee5a1c573c49e89207bc71b 18-Apr-2014 Elliott Hughes <enh@google.com> Merge "Upgrade to current vfprintf."
f3c73901cb5ca4de2651151cf2c65b31a729466e 18-Apr-2014 Elliott Hughes <enh@google.com> Upgrade our <ctype.h> implementation to OpenBSD head.

Adding the perfunctory <ctype.h> tests showed that we'd accidentally
dropped several symbols. This puts everything back in its proper place
and switches us to upstream head at the same time.

Change-Id: Ib527ad280c9baded81e667fa598698526d93e66f
ndroid.mk
type_test.cpp
0549371bd74ba7c7a5a16c2a7d6cc17dbe0e6f97 18-Apr-2014 Elliott Hughes <enh@google.com> Upgrade to current vfprintf.

This gets us various bug fixes and missing C99 functionality.

Bug: https://code.google.com/p/android/issues/detail?id=64886
Change-Id: Ie9f8ac569e9b5eec1e4a1faacfe2c21662eaf895
tdio_test.cpp
char_test.cpp
183ad9df536ab04ef35a397a1f4724e4e401d11f 27-Feb-2014 Torne (Richard Coles) <torne@google.com> Allow sharing the RELRO section via a file.

Add flags and a file descriptor to android_dlopen_ext() to allow writing
the RELRO section of the loaded library to a file after relocation
processing, and to allow mapping identical pages from the file over the
top of relocated memory in another process. Explicitly comparing the
pages is required in case a page contains a reference to a symbol
defined in another library loaded at a random base address.

Bug: 13005501
Change-Id: Ibb5b2d384edfaa5acf3e97a5f8b6115c10497a1e
lext_test.cpp
12bbb9164578b6512b8b07a3fb093858244b7c7b 06-Feb-2014 Torne (Richard Coles) <torne@google.com> Support loading libraries to a reserved address.

Add flags and parameters to android_dlopen_ext() to allow loading a
library at an already-reserved fixed address. If the library to be
loaded will not fit within the space reserved, then the linker will
either fail, or allocate its own address space as usual, according to
which flag has been specified. This behaviour only applies to the
specific library requested; any other libraries loaded as dependencies
will be loaded in the normal fashion.

There is a new gtest included to cover the functionality added.

Bug: 13005501
Change-Id: I5d1810375b20fc51ba6a9b3191a25f9792c687f1
ndroid.mk
lext_test.cpp
lext_test_library.cpp
4bd97cee28dd815fff54fc97560be60d566c1fa5 11-Apr-2014 Elliott Hughes <enh@google.com> Switch to gdtoa.

This gives us a real strtold for LP64 and fixes various LP64
bugs.

Bug: 13563801
Change-Id: I277858d718ee746e136b6b6308a495ba50dfa488
tdio_test.cpp
26c2bb84dd5cbd9ab43a5f0ebc2635bc3b64be3d 16-Apr-2014 Ben Cheng <bccheng@google.com> Merge "Fix signed vs unsigned comparison."
b760164dd67929789a4732ed3f5df56a4b66c3ae 16-Apr-2014 Ben Cheng <bccheng@google.com> Fix signed vs unsigned comparison.

Otherwise GCC 4.9 complains.

Change-Id: I7cd3c5e8c78fda709130ca88a85fa1512e6fc024
ys_socket_test.cpp
02c78a386739a8a2b3007efeb00a9ca04132100a 12-Apr-2014 Elliott Hughes <enh@google.com> Reimplement isinf/isnan/fpclassify.

Also move isinf and isnan into libc like everyone else.

Also move fpclassify to libc like the BSDs (but unlike glibc). We need
this to be able to upgrade our float/double/long double parsing to gdtoa.

Also add some missing aliases. We now have all of:

isnan, __isnan, isnanf, __isnanf, isnanl, __isnanl,
isinf, __isinf, isinff, __isinff, isinfl, __isinfl,
__fpclassify, __fpclassifyd, __fpclassifyf, __fpclassifyl.

Bug: 13469877
Change-Id: I407ffbac06c765a6c5fffda8106c37d7db04f27d
ath_test.cpp
7823f320b144bc95a34389e7ab709c9e4d3073e1 14-Apr-2014 Elliott Hughes <enh@google.com> Extra tests for printf of NaN and Inf.

Change-Id: I61fc655d9777a03aabf38f6ebd047fe275386f05
tdio_test.cpp
6455ac73da3f8b4ff6aae2acb0442429c8921788 11-Apr-2014 Elliott Hughes <enh@google.com> Improve the <sstream> test.

It looks like libcxx's testing is crap too, and this turned up
another bug in stlport.

Change-Id: I98c93dceaa8225c3cc280166d4bb74adaf94a324
stream_test.cpp
8c42606ae10b59318c9a4ea83854049bab5b9328 10-Apr-2014 Elliott Hughes <enh@google.com> Add a test for external/stlport a6df82320fcb8f26af0d067c7768fedbaeb9ad88.

Change-Id: If4df9f5df41ae5453a3dff6bb032b419819f8703
ndroid.mk
stream_test.cpp
b52a4ab4e281c7adae35b3d7ae8d99b5753b870d 09-Apr-2014 Elliott Hughes <enh@google.com> Merge "Flesh out <locale.h>."
764a99361130dceda62bbc4f8780bbf395dbc424 09-Apr-2014 Elliott Hughes <enh@google.com> Fix build: include what you use.

Change-Id: I12b2d5e434ad3ed38d4451bd470673781e6ca8fe
nistd_test.cpp
c4936e20a3a8772cc393423037be36091e68acc2 09-Apr-2014 Elliott Hughes <enh@google.com> Flesh out <locale.h>.

This is a trivial implementation that only supports the C/POSIX locale.

Change-Id: Ib11cea4249e1862aca96a8b94d58ea9a418cbe75
ocale_test.cpp
9f525644df99cb2f7f81a23ca23840f0a8f82275 09-Apr-2014 Elliott Hughes <enh@google.com> Implement _Exit(3).

Change-Id: Ida6ac844cc87d38c9645b197dd8188bb73e27dbe
tdlib_test.cpp
nistd_test.cpp
5363a45f2b6d4eeb054710d0886bbadea8a15273 08-Apr-2014 Elliott Hughes <enh@google.com> Clean up localeconv(3).

The OpenBSD doesn't support C99, and the extent to which we support
locales is trivial, so just do it ourselves.

Change-Id: If0a06e627ecc593f7b8ea3e9389365782e49b00e
ocale_test.cpp
48501af98f3cdf0115a469ee8d773cf74c42958d 14-Mar-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Fix flock64 for LP64.

On LP64 systems F_GETLK64, F_SETLK64 and F_SETLKW64 definitions should
map onto the F_GETLK, F_SETLK and F_SETLKW definitions, respectively.
LP64 also doesn't have a struct flock64.

Change-Id: Ibdfed9645d9e946999acd6efa8b96ea6238ed5bf
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
cntl_test.cpp
41059d764f347baa28b8da653a88c772daa9b738 08-Apr-2014 Christopher Ferris <cferris@google.com> Merge "Add stpcpy/stpncpy."
b9bb48bf289eec9053c6d7cc77ebbde2b4356c4b 08-Apr-2014 Elliott Hughes <enh@google.com> Merge "Fix the printf issue for 64 bits. The following case:"
950a58e24d1019eb9d814dbb16f111a6b61e3f23 04-Apr-2014 Christopher Ferris <cferris@google.com> Add stpcpy/stpncpy.

Add tests for the above.

Add the fortify implementations of __stpcpy_chk and __stpncpy_chk.

Modify the strncpy test to cover more cases and use this template for
stpncpy.

Add all of the fortify test cases.

Bug: 13746695
Change-Id: I8c0f0d4991a878b8e8734fff12c8b73b07fdd344
ortify_test.cpp
tring_test.cpp
efbdb53f84f4e1faf38f3c1a4cb60a83b9885ef4 08-Apr-2014 Elliott Hughes <enh@google.com> Remove a non-standard turd: strtotimeval.

Change-Id: I1b1e40746cb573e3fb73a5276969b40c5da36d15
ime_test.cpp
77e944fd46728075fe632bcb5211da9daf5b7e68 05-Apr-2014 Elliott Hughes <enh@google.com> Implement wctomb(3) for ltrace.

This is an implementation in the style of the rest: char == byte.

We might want to come back and implement UTF-8, but this is enough for ltrace.

Bug: 13747066
Change-Id: Ib2b63609c9014fdef9a8491e067467c4fc5ae3cc
ndroid.mk
char_test.cpp
eb554998d774c670a169bde1792619789f2f7058 03-Apr-2014 Calin Juravle <calin@google.com> Merge "Fix modf* tests"
d8d6feed3add3965f481dcdd6e1bb259a46f21c2 01-Apr-2014 Calin Juravle <calin@google.com> Fix modf* tests

Use a value that can be exactly represented.

Change-Id: Idf3b1db5e6042fb49c1f591f25f9eee656659ece
ath_test.cpp
edd7c2ec256548702d275b3023f54bd91b4dcfc4 01-Apr-2014 Alexander Ivchenko <alexander.ivchenko@intel.com> Fix the printf issue for 64 bits. The following case:

printf("%1$s %1$s\n", "test");

would print garbage instead of the second "test". The problem is __find_arguments
and the patch is a backport of two patches from OpenBSD that fix the issue:

Author: tedu <tedu@cvs.openbsd.org>
Date: Sat Apr 29 23:00:24 2006 +0000

check mmap for failure. the helper functions using it return -1, but
callers do not yet check since printf() for example is not documented
to return an error.
some formatting cleanups.
mostly ok deraadt millert

Author: millert <millert@cvs.openbsd.org>
Date: Fri May 16 14:28:54 2008 +0000

C99 says that for each va_copy() there must be a matching va_end().
Replace the non-portable hackery in __find_arguments() with a union.
From FreeBSD.

Change-Id: I6ea392ce6fcf4a319ae6a67ec58cc52fe7cbe534
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
tdio_test.cpp
9c9ef0db91c816ca81a22a94c3ddd896a0f0f1bc 02-Apr-2014 Calin Juravle <calin@google.com> Merge "Changed long double literal suffix from 'l' to 'L'."
1021c05f1bef70d78cddff41b151787b8195cac9 02-Apr-2014 Brian Carlstrom <bdc@google.com> Include sys/types.h and sys/wait.h for waitpid

(cherry picked from commit 8b2c6d44cac206b61dffd965863336e6f803fc66)

Change-Id: Ice1f6d956c11aaefd3d846c12121f08613a94446
ys_select_test.cpp
e3bb025b3d963e4aa412ab3eee35ca2187eb0eca 01-Apr-2014 Christopher Ferris <cferris@google.com> Fix transient failure in select_smoke test.

Make sure there is a delay before the file descriptor is written so that
the select/pselect calls do not return immediately.

Change-Id: If9e481b0e2cfae7ef7abd9cba8fff84078e203d3
ys_select_test.cpp
b7afa9df2552c6a6889a43c6a1722e1ce46f1969 01-Apr-2014 Calin Juravle <calin@google.com> Changed long double literal suffix from 'l' to 'L'.

Change-Id: Id569f2d335b0930704d12ad7f388cb98b65f3ab7
ath_test.cpp
108f6dc3168fa492a7ba906466ac65749f5fbda5 31-Mar-2014 Christopher Ferris <cferris@google.com> Move accept4 tests into sys_socket_test.cpp.

In addition, create basic recvmmsg, sendmmsg tests.

Change-Id: Ie9f4954446d98b5eb5e553d3c616c1ee67c3cb66
ndroid.mk
ccept4_test.cpp
ys_socket_test.cpp
9cea3775056d0a8d04d49c3983440b89d82a462b 31-Mar-2014 Christopher Ferris <cferris@google.com> Small accept4 fixes.

Put the accept4 test in the sorted order, and put the accept4 define in
sorted order.

Also add the missing SYS_RECVMMSG and SYS_SENDMMSG defines.

Change-Id: Iba55354975e0d5027dbee53f6de752c2df719493
ndroid.mk
557942ac58f08675473460b1802b43473c467172 31-Mar-2014 Calin Juravle <calin@google.com> Merge "Fix math tests."
50282f72bb9be6b49212a3978faec70786e9f97f 25-Mar-2014 Pavel Chupin <pavel.v.chupin@intel.com> Add lconv declaration and localeconv(3)

lconv is taken from ndk/sources/android/support/include/locale.h and
matches
bsd/glibc upstream.
Keep old declaration for 32-bits for compatibility.
localeconv.c and deps are taken from openbsd upstream.
Changed strtod.c accordingly.

Change-Id: I9fcc4d15f5674d192950d80edf26f36006cd31b4
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ndroid.mk
ocale_test.cpp
c8564f2df2a85a753e25bf48b4eefbf8379fe31a 27-Mar-2014 Calin Juravle <calin@google.com> Fix math tests.

Bug: 13657654
Change-Id: I39b2f13b5b3d3e6897618ac3aed49a0a08458dd0
ath_test.cpp
a58b3f78e14500e7b10fc845ef0a6a8309664663 27-Mar-2014 Christopher Ferris <cferris@google.com> Merge "Add accept4 unit test to bionic."
2f3ba8844ab8ed6be02485c79c1e974a6513b492 18-Feb-2014 Andrei Emeltchenko <andrei.emeltchenko@intel.com> Add accept4 unit test to bionic.

Change-Id: I1cce5fb8dab16f03164fdd288f35a814d7c49c6a
ndroid.mk
ccept4_test.cpp
4bfaf462f0c864473faaca63cc4ba9e1a1b103a8 26-Mar-2014 Calin Juravle <calin@google.com> Added strtotimeval tests.

Change-Id: I3dfd3647a8494490a2d549bdb915968063a7fb99
ime_test.cpp
133bd09334cb28b45cca1ca0e5b4e22a9e5b68e5 25-Mar-2014 Brian Carlstrom <bdc@google.com> Add include of float.h for LDBL_MIN_EXP and LDBL_MANT_DIG

(cherry picked from commit 1711c6ea3a0d891da665325c75738a68bd7d501f)

Change-Id: Ia64676b2b904f042fec678003e3f2cd5bd82b510
ath_test.cpp
989a80b75014eff71600a6a4e1445e710c2f94b4 24-Mar-2014 Calin Juravle <calin@google.com> Merge "Fix LP64 libm for 128-bit long doubles"
4d77c1151c40010d137e4a2fa8629bff4bea72b0 14-Mar-2014 Calin Juravle <calin@google.com> Fix LP64 libm for 128-bit long doubles

* reworked amd64/_fpmath.h and arm64/_fpmath.h to support 128-bit long
doubles.
* improved tests to cover long double cases
* made modfl an alias for LP32

Tests pass on x86, x86_64, arm, arm64 and mips.

Bug: 12921273

Change-Id: Ibe39acde57972447a8950fa45b1e702acc68ebeb
ath_test.cpp
753ad778bc1c3aecc4cd82b8387a7dc8a9b44d34 21-Mar-2014 Christopher Ferris <cferris@google.com> Fix deadlock in timer_delete.

If the callback function for a timer did a timer_delete, the function
would never return. The problem was that the timer_delete function would try
to wait until the timer thread has finished. Waiting for yourself to finish
doesn't work very well.

Bug: 13397340
Change-Id: Ica123a5bafbc8660c8a4a909e5c2dead55ca429d
ime_test.cpp
722706672617d009279a8485b895bd3389de0396 19-Mar-2014 Calin Juravle <calin@google.com> Added a test flag to bionic run-test targets.

It makes it much easier to pass arguments to the tests.

Change-Id: Ia91eba4868627a3cea3f8d2c26ba01af4e860b12
ndroid.mk
f171b34cf045115b82ccb89b57feb56d3cad472b 18-Mar-2014 Christopher Ferris <cferris@google.com> Use the float/double assert macros.

The normal ASSERT_EQ macros don't work quite right for float/double values,
and result in false failures. Use the correct macros instead.

Bug: 13511379
Change-Id: Ic2feee7f3d3569f57b6453b8fa95222846c625cd
tdio_test.cpp
tdlib_test.cpp
603332fc4c2d073f0e197f9ce4517710e9b3a6d0 13-Mar-2014 Elliott Hughes <enh@google.com> Upgrade to current upstream scanf implementation.

Also add a basic test.

Change-Id: Icc0e68a5716b9579244f6eb8bac1ab5a24eda85a
tdio_test.cpp
5a8173860d65182af022be88fed0c5d8d5dcb69d 13-Mar-2014 Elliott Hughes <enh@google.com> Ensure we always have symbols for atof, strtof, strtold.

We'll need a better implementation of strtold for LP64, but all our
long double functions are currently broken for LP64 anyway so this
isn't a regression.

Change-Id: I2bdebac11245d31521d5fa09a16331c03dc4339c
tdlib_test.cpp
40488560c17e41c0980b3a08ef54ec38bb572a41 12-Mar-2014 Elliott Hughes <enh@google.com> Include what you use.

Don't rely on transitive includes. (Even though that works fine in AOSP.)

Change-Id: Ifc06575e4aea383cfff24d6c5c14fc0a7aabdf2b
tdlib_test.cpp
3cdf5739cd34757943a5fff9d26efeb8da04cb09 11-Mar-2014 Elliott Hughes <enh@google.com> Add a basic unit test for system(3).

Change-Id: Ibc5ac21f3663685d89ce261b58d6ea386fc1ff88
tdlib_test.cpp
3e3409af0faa8843078a9e6e7110e69a88210da4 11-Mar-2014 Elliott Hughes <enh@google.com> Add system/extras strftime and strptime tests.

Change-Id: I889c58f6e2e27b99cf6328a8671858d2e5feaa4e
ime_test.cpp
be1d91dedcfb346ced5ac496cd454f5b2e9bc4a9 09-Mar-2014 Brian Carlstrom <bdc@google.com> Add includes for waitpid

(cherry picked from commit f07c5dd9ab63f2e8ba736107bd4b69bbd8829c9f)

Change-Id: I7a765fd7a3a5f8f29a703f6a591c4fd8df4ebf1c
ime_test.cpp
04620a3cd7bdea0d1b421c8772ba3f06839bbe9c 08-Mar-2014 Elliott Hughes <enh@google.com> Fix pthread_detach for already-exited threads.

Change-Id: I2bf7f41234d93b226132a4c51705f4186f4961c3
Reported-by: Paresh Nakhe <pnakhe@codeaurora.org>
thread_test.cpp
4b558f50a42c97d461f1dede5aaaae490ea99e2e 05-Mar-2014 Elliott Hughes <enh@google.com> Rewrite the POSIX timer functions.

This is a much simpler implementation that lets the kernel
do as much as possible.

Co-authored-by: Jörgen Strand <jorgen.strand@sonymobile.com>
Co-authored-by: Snild Dolkow <snild.dolkow@sonymobile.com>
Change-Id: Iad19f155de977667aea09410266d54e63e8a26bf
thread_test.cpp
ime_test.cpp
0e714a5b41451e84c5ded93a42c9a4b0a9440691 04-Mar-2014 Elliott Hughes <enh@google.com> Implement POSIX pthread_mutex_timedlock.

This replaces the non-standard pthread_mutex_lock_timeout_np, which we have
to keep around on LP32 for binary compatibility.

Change-Id: I098dc7cd38369f0c1bec1fac35687fbd27392e00
thread_test.cpp
51e6cb33e3d7c2f44864d356a2a8e66317688f55 03-Mar-2014 Narayan Kamath <narayan@google.com> Implement pthread_condattr_{get,set}clock.

We only support CLOCK_REALTIME and CLOCK_MONOTONIC for now,
so we us a single bit from pthread_cond_t->value to denote
the clock type. Note that this reduces the width of the counter
to 30 bits, but this should be large enough for all practical
purposes.

bug: 13232338

Change-Id: I857e7da64b3ecbb23eeac7c9f3fbd460f60231bd
thread_test.cpp
aedb00d04eb7f0b20b6abde702ba94a46577ca68 03-Mar-2014 Elliott Hughes <enh@google.com> Switch to upstream alarm(3).

The only way the setitimer call can fail is if the unsigned number of seconds is
too large to fit in the kernel's signed number of seconds. If you schedule a
68-year alarm, glibc will fail by returning 0 and BSD will fail by returning -1.

Change-Id: Ic3721b01428f5402d99f31fd7f2ba2cc58805607
nistd_test.cpp
6ff0c75c838e73d2aeccc0102ab58a7b865172ca 10-Feb-2014 Guillaume Ranquet <guillaumex.ranquet@intel.com> Add recvmmsg and sendmmsg syscalls.

Also add the corresponding constant, struct, and function declarations
to <sys/socket.h>, and perfunctory tests so we know that the symbols
actually exist.

Signed-off-by: Guillaume Ranquet <guillaumex.ranquet@intel.com>
Change-Id: Ib0d854239d3716be90ad70973c579aff4895a4f7
ndroid.mk
ys_socket_test.cpp
a92b57c7f8230661d911f2fd6dd67a81e9a90cef 25-Feb-2014 Calin Juravle <calin@google.com> Merge "Added ftw64, nftw64"
7c1efffc249283b47309846abba8795f3fb91555 25-Feb-2014 Calin Juravle <calin@google.com> Merge "Added mkstemp64"
0e44bc3baeb1677e5fbdda87a737b9c508c95132 25-Feb-2014 Elliott Hughes <enh@google.com> Remove <asm/page.h>.

If we have PAGE_SIZE/PAGESIZE, POSIX says they should be in <limits.h>.

Change-Id: I3c2d574ea2aea81f524874a156361411a4ffa18e
ys_mman_test.cpp
d4934a70e69365c97b1378820152e134a0089b5e 24-Feb-2014 Calin Juravle <calin@google.com> Added ftw64, nftw64

Bug: 13076637
Change-Id: I5b926526f935b00bba14c2807b61d85f95089c33
ndroid.mk
emporaryFile.h
tw_test.cpp
fe317a3775e16d466bb884a8e054fd77f7087bb3 21-Feb-2014 Calin Juravle <calin@google.com> Added mkstemp64

Bug: 13076637
Change-Id: I41bf28ab3e6c7325470781e9323eeec023483df5
emporaryFile.h
tdlib_test.cpp
90b0157679a984f1829a72f8c642d17030aa7644 21-Feb-2014 Calin Juravle <calin@google.com> Merge "Fixed int fast types for LP64"
da030de702b756077fec536ed139e7ea38b51022 20-Feb-2014 Calin Juravle <calin@google.com> Fixed int fast types for LP64

Bug: 13110474
Change-Id: Id5591603ad4ba7e149c0852f4abb25e4e5a5d065
ndroid.mk
tdint_test.cpp
5f6f4a956cd630f873fe41058e96262f897f4bc9 19-Feb-2014 Narayan Kamath <narayan@google.com> Fix signbit / infinite / isinf / isnan unit tests.

Turns out stlport isn't broken. <cmath> (included
transitively via gtest in our case) is not required
to make C99 math macros (like signbit) available, nor is
it required to preserve them if they're already defined.
It is only required to make the equivalent functions in
namespace std available.

I couldn't find any documentation of required behaviour for
programs that include both <math.h> and <cmath>.

I've verified experimentally that llvm's libc++ and gnu
stl behave the same as stlport.

bug: 12935307

Change-Id: I9dc5cc0fd9f4f259abc8eefb280177cdd092a94b
ath_test.cpp
1d18e9cc0ab8b2f6d860c4f7d85c33eb5cde4179 19-Feb-2014 Elliott Hughes <enh@google.com> Add missing file from previous change.

Change-Id: Id25000162a9ed76ce756842bdc09fe9afff9528f
ys_vfs_test.cpp
db1ea3474899ebbd783aba872d3005f95a816d0f 18-Jan-2014 Elliott Hughes <enh@google.com> Implement some of the missing LFS64 support.

This gives us:

* <dirent.h>
struct dirent64
readdir64, readdir64_r, alphasort64, scandir64

* <fcntl.h>
creat64, openat64, open64.

* <sys/stat.h>
struct stat64
fstat64, fstatat64, lstat64, stat64.

* <sys/statvfs.h>
struct statvfs64
statvfs64, fstatvfs64.

* <sys/vfs.h>
struct statfs64
statfs64, fstatfs64.

This also removes some of the incorrect #define hacks we've had in the
past (for stat64, for example, which we promised to clean up way back
in bug 8472078).

Bug: 11865851
Bug: 8472078
Change-Id: Ia46443521918519f2dfa64d4621027dfd13ac566
ndroid.mk
irent_test.cpp
cntl_test.cpp
tatvfs_test.cpp
ys_stat_test.cpp
ys_statvfs_test.cpp
915fefb62e1beed3da26fe299a8141645733a925 18-Feb-2014 Elliott Hughes <enh@google.com> Fix x86 build.

Change-Id: Iee6e5884288f7da6c955694cfe32fecfd9c9e263
nistd_test.cpp
3d19a8319b9c27af8aa5cfbf495da0fe7fa62d3e 15-Feb-2014 Colin Cross <ccross@android.com> 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
nistd_test.cpp
671e236d5fd2cae169c2a31d0a35e66c4fcc5556 13-Feb-2014 Elliott Hughes <enh@google.com> Restore sys_signame for LP64.

mksh is using this, and we probably build as much BSD source as glibc source.

Change-Id: I400d255a67f9614ca9e57090e3a2e49d2b10cba4
ignal_test.cpp
aa0ebdafc71e1ceac78e0929b94f3bb117d0c8e9 12-Feb-2014 Elliott Hughes <enh@google.com> Clean up sys_signame and sys_siglist a little.

We don't need quite so much duplication because we already have a way
to get the signal number from its name, and that already copes with the
fact that the mips/mips64 numbers are different from everyone else's.

Also remove sys_signame from LP64. glibc doesn't have this BSD-ism.

Change-Id: I6dc411a3d73589383c85d3b07d9d648311492a10
ignal_test.cpp
f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d 21-Dec-2013 Christopher Ferris <cferris@google.com> Make sure that the same tests are on all platforms.

In order to be able to generate a list of tests for cts, the same set of
tests must exist across all platforms. This CL adds empty tests where a
test was conditionally compiled out.

This CL creates a single library libBionicTests that includes all of
the tests found in bionic-unit-tests-static.

Also fix a few missing include files in some test files.

Tested by running and compiling the tests for every platform and
verifying the same number of tests are on each platform.

Change-Id: I9989d4bfebb0f9c409a0ce7e87169299eac605a2
ndroid.build.mk
ndroid.mk
ventfd_test.cpp
ortify_test.cpp
etauxval_test.cpp
nttypes_test.cpp
ibc_logging_test.cpp
ibgen_test.cpp
ath_test.cpp
thread_test.cpp
tack_protector_test.cpp
tack_unwinding_test.cpp
tdio_test.cpp
tring_test.cpp
tubs_test.cpp
ys_epoll_test.cpp
ys_select_test.cpp
ys_sendfile_test.cpp
ystem_properties_test.cpp
ime_test.cpp
f64b8ea09db3bdd84eed59f7721301743332b3fe 04-Feb-2014 Elliott Hughes <enh@google.com> Add fallocate/fallocate64/posix_fallocate/posix_fallocate64.

Bug: 5287571
Bug: 12612860
Change-Id: I4501b9c6cdf9a830336ce0b3afc4ea716b6a0f6f
cntl_test.cpp
718a5b5495ae7726aabd2f8a748da9f391d12b98 29-Jan-2014 Elliott Hughes <enh@google.com> Fix pthread_test to work with gtest 1.7.0.

Now we're building it correctly configured, gtest takes a couple of
TLS slots for itself.

Change-Id: I1c2c4e9e5f9c6e2e2e6ecd1214cfc16a5af5afed
thread_test.cpp
431166d99519f6794f10c48694913d2fe864b841 28-Jan-2014 Elliott Hughes <enh@google.com> Fix 32-bit mmap/mmap64 handling of negative offsets.

We don't actually need to worry about sign extension if we reject
negative values ourselves. Previously it was possible to come up
with negative but aligned values that we would pass to the kernel;
in the case of mmap (as opposed to mmap64) we'd incorrectly turn
those into large positive offsets.

Change-Id: I2aa583e0f892d59bb77429aea8730b72db32dcb0
ndroid.mk
ys_mman_test.cpp
e2a292d278b94fec3d078b1f1b27c1f89942c276 25-Jan-2014 Elliott Hughes <enh@google.com> Remove __STDC_FORMAT_MACROS and __STDC_LIMIT_MACROS guards (and fix SIZE_MAX for LP64).

The various committees decided that everyone should get all these macros,
all the time.

Bug: 12708004
Change-Id: Ib56010dcba9b0656e5701546fefb7f78dc0bf916
nttypes_test.cpp
d1973ca51325393f304e82a4d79874f33e54ac16 22-Jan-2014 Colin Cross <ccross@android.com> bionic: rename aarch64 target to arm64

Rename aarch64 build targets to arm64. The gcc toolchain is still
aarch64.

Change-Id: Ia92d8a50824e5329cf00fd6f4f92eae112b7f3a3
ndroid.mk
0f461e35f63200641fc53bba222845a84589c024 09-Jan-2014 Elliott Hughes <enh@google.com> Fix <sys/resource.h>.

The situation here is a bit confusing. On 64-bit, rlimit and rlimit64 are
the same, and so getrlimit/getrlimit64, setrlimit/setrlimit64,
and prlimit/prlimit64 are all the same. On 32-bit, rlimit and rlimit64 are
different. 32-bit architectures other than MIPS go one step further by having
an even more limited getrlimit system call, so arm and x86 need to use
ugetrlimit instead of getrlimit. Worse, the 32-bit architectures don't have
64-bit getrlimit- and setrlimit-equivalent system calls, and you have to use
prlimit64 instead. There's no 32-bit prlimit system call, so there's no
easy implementation of that --- what should we do if the result of prlimit64
won't fit in a struct rlimit? Since 32-bit survived without prlimit/prlimit64
for this long, I'm not going to bother implementing prlimit for 32-bit.

We need the rlimit64 functions to be able to build strace 4.8 out of the box.

Change-Id: I1903d913b23016a2fc3b9f452885ac730d71e001
ndroid.mk
ys_resource_test.cpp
5f1322cecf5af4bedfb2d3cf857d18e73a233b9d 07-Jan-2014 Elliott Hughes <enh@google.com> Merge "Pass a valid stack pointer to __bionic_clone in pthread.__bionic_clone"
dd00364807020a244aa8be4f3481f7ec0fefcc79 04-Jan-2014 Chris Dearman <chris.dearman@imgtec.com> Pass a valid stack pointer to __bionic_clone in pthread.__bionic_clone

__bionic_clone modifies the child stack before cloning so the stack
pointer should be valid. The test is expecting an EINVAL error to be
generated from the incorrect flags: CLONE_THREAD set without
CLONE_SIGHAND.

Change-Id: Ic02192081f6f52df6f03d9810efa82d923247a11
thread_test.cpp
894f8cb1395d3409bb995d18abc1b3409c557d01 03-Jan-2014 Elliott Hughes <enh@google.com> Fix dev_t (for LP64).

32-bit Android's dev_t was wrong too. We can't fix that without ABI breakage,
but we can at least fix 64-bit Android. And add tests.

Bug: https://code.google.com/p/android/issues/detail?id=54966
Change-Id: Ie2e42cc042b78b669a1a44e55f959dbd9c52c5c9
ndroid.mk
ys_types_test.cpp
6ad8f76f1f1cbee484c30d723d9d6d1fcf5dc85c 19-Dec-2013 Elliott Hughes <enh@google.com> Don't abort in stdio.getdelim_invalid and stdio.getline_invalid.

Change-Id: Ie1aefed732f4bea77887bddd1be9a0578e247aa3
tdio_test.cpp
e7c59f9e2041812c597ff1c8689d47d1bfd32883 18-Dec-2013 Elliott Hughes <enh@google.com> Fix compilation of crtbegin.c and pthread_debug.cpp.

Because there was no default := for the aarch64 libc_crt_target_cflags,
the += was causing libc_crt_target_cflags to be recursively-defined
variable, which meant that when we were compiling crtbegin.c LOCAL_PATH
would be bionic/tests/ and we'd have -Ibionic/tests/include/ and find
none of our include files.

Also fix linking of pthread_debug.cpp, at least in the disabled mode.
The enabled mode was already broken for all architectures, and continues
to be broken after this change. It's been broken for long enough that
we might want to just remove it...

(aarch64 is using the FSF linker where arm uses the gold linker.)

Change-Id: I7db2e386694f6933db043138e6e97e5ae54d4174
ndroid.mk
e365f9d6543bc6607864ef61257505239dde15d1 10-Oct-2013 Marcus Oakland <marcus.oakland@arm.com> AArch64: Linker64 support for AArch64

Addition of support for AArch64 in the linker64 target.

Change-Id: I8dfd9711278f6706063e91f626b6007ea7a3dd6e
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
ndroid.mk
282e232e2a32cca8a288e81edddfd95f450cfc79 22-Oct-2013 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Add fixes to bionic/tests

This patch adds minor fixes to the bionic unit tests.

Change-Id: Ie10f33c631ed6c10987923d678711d22931ddb05
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
ndroid.mk
1887621de8a48eece8a05f2400ddd783b9833147 12-Dec-2013 Elliott Hughes <enh@google.com> PTHREAD_KEYS_MAX cleanup.

I fixed this bug a while back, but didn't remove it from the list,
could have added a better test, and could have written clearer code
that didn't require a comment.

Change-Id: Iebdf0f9a54537a7d5cbca254a5967b1543061f3d
thread_test.cpp
a84f88f0989e9446686ae76a53dc087ff5788fe6 11-Dec-2013 Colin Cross <ccross@android.com> Merge "bionic: move benchmarks out of tests directory"
bd3efbc9b585e0c9801b0b35f282347cb8692ca8 16-Nov-2013 Colin Cross <ccross@android.com> bionic: move benchmarks out of tests directory

Change-Id: I4d054965198af22c9a9c821d1bc53f4e9ea01248
ndroid.mk
enchmark.h
enchmark_main.cpp
ath_benchmark.cpp
roperty_benchmark.cpp
tring_benchmark.cpp
ime_benchmark.cpp
e5bbb6b6ab662503f06ceb20fa841d2e558d596d 04-Dec-2013 Christopher Ferris <cferris@google.com> Add strcmp/memcmp testing.

Bug: 9797008
Change-Id: I11b1da060d29f7dacbb53f20a3e2082395b5bd8a
uffer_tests.cpp
uffer_tests.h
tring_test.cpp
f00c938c7f5887981d724bf2dd9989ee0af08332 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit '811b0cdb2d6e4a697dbc63a678712759dd0db242' into HEAD

Change-Id: I786944f80fb1a2d502fed51dc2c391ed5db66761
9d70ddc466ed0bdb36908d69b1fe849904150eb7 19-Nov-2013 Narayan Kamath <narayan@google.com> Merge "Add test case for 1^NaN"
303fe0cb38def66aa438b9caac32e5af298f840a 19-Nov-2013 Elliott Hughes <enh@google.com> Merge "Fix pthread_join."
877ec6d90418ff1d6597147d355a2229fdffae7e 16-Nov-2013 Elliott Hughes <enh@google.com> Fix pthread_join.

Let the kernel keep pthread_internal_t::tid updated, including
across forks and for the main thread. This then lets us fix
pthread_join to only return after the thread has really exited.

Also fix the thread attributes of the main thread so we don't
unmap the main thread's stack (which is really owned by the
dynamic linker and contains things like environment variables),
which fixes crashes when joining with an exited main thread
and also fixes problems reported publicly with accessing environment
variables after the main thread exits (for which I've added a new
unit test).

In passing I also fixed a bug where if the clone(2) inside
pthread_create(3) fails, we'd unmap the child's stack and TLS (which
contains the mutex) and then try to unlock the mutex. Boom! It wasn't
until after I'd uploaded the fix for this that I came across a new
public bug reporting this exact failure.

Bug: 8206355
Bug: 11693195
Bug: https://code.google.com/p/android/issues/detail?id=57421
Bug: https://code.google.com/p/android/issues/detail?id=62392
Change-Id: I2af9cf6e8ae510a67256ad93cad891794ed0580b
thread_test.cpp
tdlib_test.cpp
af64dad4796ab4f077e2f2ba1e90cc56b6575d63 18-Nov-2013 Narayan Kamath <narayan@google.com> Add test case for 1^NaN

Should be 1.

Change-Id: I6cf723a419f51d3bda58286a538774b71276c7b5
ath_test.cpp
cbd85b9cc1c5dd0bb1a5691143cd5adcbecdba77 16-Nov-2013 Christopher Ferris <cferris@google.com> Modify tests for another glibc difference.

It turns out that when passing a closed file to getdelim or getline, the
functions in glibc will properly return a failure, but errno might not be
set. Skip the errno check except on bionic.

Change-Id: I8d625f15303d4c2d42e8d28491ea8a368aea4d32
tdio_test.cpp
e39e3a77d6e8cf681718a572bc754fd64dfc87ff 15-Nov-2013 Christopher Ferris <cferris@google.com> Merge "Add new tests for memory/string routines."
70b24b1cc2a1a4436b1fea3f8b76616fdcb27224 15-Nov-2013 Elliott Hughes <enh@google.com> Switch pthread_create over to __bionic_clone.

Bug: 8206355
Bug: 11693195
Change-Id: I04aadbc36c87e1b7e33324b9a930a1e441fbfed6
thread_test.cpp
b687ad3c3491fffe22507cafc9347e10cbf6bd31 07-Nov-2013 Christopher Ferris <cferris@google.com> Add new tests for memory/string routines.

Create a few generic testing functions to allow any memory/string tests
to be created.

Add alignment tests for memcpy/memset/strcat/strcpy/strlen.

Add an overread test for memcpy/strcat/strcpy/strlen. This test attempts
to verify that the functions do not read past the end of their buffers
(src buffer in the case of src/dst functions).

Bug: 9797008

Change-Id: Ib3223ca1b99e729ae8229adc2d03f4dc3103d97c
ndroid.mk
uffer_tests.cpp
uffer_tests.h
tring_test.cpp
6a8f00d49c30107903f2449ae563cfee51b48468 13-Nov-2013 Elliott Hughes <enh@google.com> Add unit tests for pow's behavior with NaNs.

Bug: 11669804
Change-Id: Idfa6527640c8d0c2cf3e5343bf7afe013e237545
ath_test.cpp
e61dc71efca544f4066a93706b639a29b3600229 13-Nov-2013 Elliott Hughes <enh@google.com> Add a unit test for syscall(2).

Change-Id: Ic7d9735d46711af93c3a1747de7b2eb8cebea094
ndroid.mk
ys_syscall_test.cpp
2ed710976cb0ace31aab565c95a42d4e75623894 12-Nov-2013 Elliott Hughes <enh@google.com> Add extra regression tests for an already-fixed dynamic linker bug.

Bug: https://code.google.com/p/android/issues/detail?id=61799
Change-Id: I84af68f8430a06e999297c2e57e06ecb45adf81e
lfcn_test.cpp
062092543fdbd6fa2676e4f5b37a15f7bba94332 07-Nov-2013 Elliott Hughes <enh@google.com> Clean up the 32-bit kernel support, fix LP64 fcntl declaration.

In practice, thanks to all the registers the stubs don't actually change,
but it's confusing to have an incorrect declaration.

I suspect that fcntl remains broken for aarch64; it happens to work for
x86_64 because the first vararg argument gets placed in the right register
anyway, but I have no reason to believe that's true for aarch64.

This patch adds a unit test, though, so we'll be able to tell when we get
as far as running the unit tests.

Change-Id: I58dd0054fe99d7d51d04c22781d8965dff1afbf3
ndroid.mk
cntl_test.cpp
ebd506c69e12b6dcaf5be94cc8ed1b53af299f9f 31-Oct-2013 Sergey Melnikov <sergey.melnikov@intel.com> Fix linker crashes during unknown symbol lookup

Integration of kernel VDSO into internal bionic data structures using
common functions.
Fix for dl_iterate_phdr function: the function provides incorrect
address of object in case of nonzero virtual and base addresses.
Location in address space of a particular program header should be
calculated using the formula: addr = base_addr + virtual_addr.

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: Ie2ab4257fd456242aab8afed0bd5bd6b29e81d6d
lfcn_test.cpp
c3f114037dbf028896310609fd28cf2b3da99c4d 30-Oct-2013 Elliott Hughes <enh@google.com> <pthread.h> fixes and pthread cleanup.

<pthread.h> was missing nonnull attributes, noreturn on pthread_exit,
and had incorrect cv qualifiers for several standard functions.

I've also marked the non-standard stuff (where I count glibc rather
than POSIX as "standard") so we can revisit this cruft for LP64 and
try to ensure we're compatible with glibc.

I've also broken out the pthread_cond* functions into a new file.

I've made the remaining pthread files (plus ptrace) part of the bionic code
and fixed all the warnings.

I've added a few more smoke tests for chunks of untested pthread functionality.

We no longer need the libc_static_common_src_files hack for any of the
pthread implementation because we long since stripped out the rest of
the armv5 support, and this hack was just to ensure that __get_tls in libc.a
went via the kernel if necessary.

This patch also finishes the job of breaking up the pthread.c monolith, and
adds a handful of new tests.

Change-Id: Idc0ae7f5d8aa65989598acd4c01a874fe21582c7
thread_test.cpp
13613137bc4266656bffce464e525eb9ae6371f0 28-Oct-2013 Christopher Ferris <cferris@google.com> Fix up failing glibc tests.

There is a known bug running clone with the CLONE_VM flag, so for host
create an empty test.

Change the expected output of the stdio test for a glibc difference.

Change the pause test to use ScopedSignalHandler to setup/restore the SIGALRM
handler.

After this, running bionic-unit-tests-glibc passes for all tests.

Bug: 11389824

Change-Id: Ib304eae4164115835a54991dfdca5821ecc3db5e
copedSignalHandler.h
ched_test.cpp
ignal_test.cpp
tdio_test.cpp
nistd_test.cpp
27586ebe1a7f2f45651b855a26b3203d63d015d6 28-Oct-2013 Elliott Hughes <enh@google.com> Fix utime/utimes when passed a NULL pointer.

Bug: 11383777
Change-Id: If944a42f3adfa8a6ce91c167c249e009ed63300a
ys_time_test.cpp
b38e4d536f6592cf22b984c143ee6790d6df2351 25-Oct-2013 Christopher Ferris <cferris@google.com> Update running bionic unit tests on host.

Add a bionic-unit-tests-glibc-run target to run the glibc bionic unit tests.

Modify the bionic-unit-tests-run-on-host to make sure that the /system/bin
directory is created properly.

Also remove the EXTERNAL_STORAGE variable which isn't used any more.

Bug: 11234772
Change-Id: I9aea501d05700b29e938f672474d550b1872a78b
ndroid.mk
11952073af22568bba0b661f7a9d4402c443a888 25-Oct-2013 Elliott Hughes <enh@google.com> Remove dependencies on obsolete __ARCH_WANT_SYSCALL_DEPRECATED system calls.

(aarch64 kernels don't have these system calls.)

Change-Id: I6f64075aa412f71520f2df71c3d69b647f91c1ca
ndroid.mk
ignal_test.cpp
ys_epoll_test.cpp
ys_select_test.cpp
nistd_test.cpp
f8fcfbc85a3ce3e195626b90736d3a484331494b 22-Oct-2013 Elliott Hughes <enh@google.com> Move away from the __ARCH_WANT_SYSCALL_NO_AT system calls.

Modern architectures only get the *at(2) system calls. For example,
aarch64 doesn't have open(2), and expects userspace to use openat(2)
instead.

Change-Id: I87b4ed79790cb8a80844f5544ac1a13fda26c7b5
ndroid.mk
ys_time_test.cpp
594b1a4af204aa9de2b4913182f4556e38d71648 22-Oct-2013 Elliott Hughes <enh@google.com> Make sure we have a mkfifo symbol.

Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: Ic0a883a5f30beb82cb7be3c4e81b6d693d5fbb4d
ys_stat_test.cpp
3d305f1d62107d5261bad1c45a0a441d98dc4d41 22-Oct-2013 Elliott Hughes <enh@google.com> Fix statvfs tests for the host.

Using /proc seems like a better idea because it's more similar across devices.
I've switched to ensuring we check the initial and final elements in the struct
too, so we have more reason to believe the whole struct is converted correctly.

Change-Id: Ia23403369485747c1452292f6c9df2bb233c04fb
tatvfs_test.cpp
e4375196d650f68ad486e2202699c98f9342d616 22-Oct-2013 Elliott Hughes <enh@google.com> Fix the system property tests to use $ANDROID_DATA.

This lets them work on the host.

Change-Id: I771ccc67652ae37451b45859c7831116cd830086
ystem_properties_test.cpp
53bfdae4ffdbd43d0c019d1a35af1f8477a272c9 19-Oct-2013 Elliott Hughes <enh@google.com> Fix the x86_64 clone implementation.

Change-Id: Ia75f46dcb4d3222049e9a6a6fabc2b17223b47f7
ndroid.mk
ched_test.cpp
0c40152767188dc718a46e5b4e7e32e937c85bd8 19-Oct-2013 Elliott Hughes <enh@google.com> Fix the time unit tests for systems with 64-bit time_t.

Change-Id: I29df50b25d022c1c00906e71b612defa58e46e81
ime_test.cpp
17558dec7fc60775c940be0e494b42829f35e0b1 17-Oct-2013 Pavel Chupin <pavel.v.chupin@intel.com> x86_64: Fix bionic tests build-and-run

Change-Id: Iab48362893a212afbcbc362fdfaff5bfa5b55259
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ndroid.mk
925753aa1175ae58b24bbfe2d9e38eb4fe3f579d 18-Oct-2013 Elliott Hughes <enh@google.com> Fix some test assumptions that are wrong for __LP64__.

Change-Id: Ic79cd5858ceb611640a76bd03f3da4925d3150d9
emporaryFile.h
ibc_logging_test.cpp
tdio_test.cpp
c7e9b2331771e5e87c34a8ee3dc6cc41d35b02fe 17-Oct-2013 Elliott Hughes <enh@google.com> Fix sigaction(3) for 64-bit.

Also clean up <signal.h> and revert the hacks that were necessary
for 64-bit in linker/debugger.cpp until now.

Change-Id: I3b0554ca8a49ee1c97cda086ce2c1954ebc11892
thread_test.cpp
ignal_test.cpp
6b9321b85875dd8938d0a5064ea3e9fdebe5c623 17-Oct-2013 Elliott Hughes <enh@google.com> am d6e117b6: am 1f29c2f5: Merge "Switch sigpending over to rt_sigpending."

* commit 'd6e117b64bdfbf8d793eb59ea9604b806608ec75':
Switch sigpending over to rt_sigpending.
40d105ccb3e6283566ce54b693b3088f31aa4f26 16-Oct-2013 Elliott Hughes <enh@google.com> Switch sigpending over to rt_sigpending.

Change-Id: I7b28984796b5fb343cfbcc47e0afc3a84293d417
ignal_test.cpp
afaebc3fefe93cbfbaead60212dab7b99bae9d7a 16-Oct-2013 Elliott Hughes <enh@google.com> am 87fc78de: am 608c65f6: Merge "Fix sigsuspend to use rt_sigsuspend on all platforms."

* commit '87fc78de6c869d0403ccdd2e756ec1f5d456f3d3':
Fix sigsuspend to use rt_sigsuspend on all platforms.
1f5af926fa626734981d6b4dcc0ab54e520032a9 16-Oct-2013 Elliott Hughes <enh@google.com> Fix sigsuspend to use rt_sigsuspend on all platforms.

Change-Id: I981c1a66d35480d4457a0a08a1b042dac94daa5b
ignal_test.cpp
4681f8244ee6fd3aec5a5c62e604e2a429d0d00f 15-Oct-2013 Elliott Hughes <enh@google.com> am 5b3f1d8b: am 22b83da4: Merge "Clean up the sigprocmask/pthread_sigmask implementation."

* commit '5b3f1d8b3a6a1caf059dc376e4967a27ddd57dac':
Clean up the sigprocmask/pthread_sigmask implementation.
19e62325c268a668692e2b65fde2284079f369aa 15-Oct-2013 Elliott Hughes <enh@google.com> Clean up the sigprocmask/pthread_sigmask implementation.

Let's have both use rt_sigprocmask, like in glibc. The 64-bit ABIs
can share the same code as the 32-bit ABIs.

Also, let's test the return side of these calls, not just the
setting.

Bug: 11069919
Change-Id: I11da99f85b5b481870943c520d05ec929b15eddb
thread_test.cpp
8161b236891de223b0ebe9b76db57147d50a20f5 12-Oct-2013 Stephen Hines <srhines@google.com> am 4691325d: am abeafbd6: Merge "Wrap sprintf()/snprintf() macros to prevent expansion errors."

* commit '4691325d48406033632fe84a944ac9c3bd2e5097':
Wrap sprintf()/snprintf() macros to prevent expansion errors.
78f6db64fe90e45f1cdb649543feb2d92696802a 12-Oct-2013 Stephen Hines <srhines@google.com> am 36959302: am 8704ada3: Merge "Fix clang warnings in bionic."

* commit '36959302a334499c7d2ddf4a090e2ab7e3a8ae1d':
Fix clang warnings in bionic.
abeafbd6d5e11044dd305e48134bc3d84319a3da 12-Oct-2013 Stephen Hines <srhines@google.com> Merge "Wrap sprintf()/snprintf() macros to prevent expansion errors."
6c7b3cb056509fd8756bc012878a499f6f102114 12-Oct-2013 Stephen Hines <srhines@google.com> Fix clang warnings in bionic.

This fixes a few diverse issues that clang warns on in bionic. First,
it specifies the appropriate converted types for format specifiers.
The "h" and "hh" modifiers specify that the user is passing a short or
char respectively. We were passing int deliberately in both cases and
relying on the compiler to implicitly downcast to the smaller type.
We also remove the non-standard "d" suffix from our double-precision
floating point constant. This is an extension for gcc that clang does
not implement. The third fix is to mark the c1 variable as unused,
since it truly is neither read nor written.

Change-Id: I4793352b9d3e58f1f4cac9e7581ef4b2a70b43c7
ibc_logging_test.cpp
tack_unwinding_test_impl.c
tdio_test.cpp
6e38072addd556e3894284b5bd040ac64fffa72e 11-Oct-2013 Stephen Hines <srhines@google.com> Wrap sprintf()/snprintf() macros to prevent expansion errors.

Previously, FORTIFY_SOURCE used single macros to define these standard
functions for use with clang. This can cause conflicts with other macros used
to call these functions, particularly when those macros expand the number of
arguments to the function. This change wraps our macro definitions, so that
expansion properly takes place for programmer arguments first.

Change-Id: I55929b1fd2a643b9d14a17631c4bcab3b0b712cf
ortify_test.cpp
49bb53c8e20ff37a1965ba4af645464ea4b8f8fa 10-Oct-2013 Nick Kralevich <nnk@google.com> am 95de0df8: am eda2679e: Merge "FORTIFY_SOURCE: fortify read()"

* commit '95de0df8c2daeefca358010f2d15c3346a5284f1':
FORTIFY_SOURCE: fortify read()
b036b5ca36c1e12b075909b3eca6eab73ee611cf 10-Oct-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: fortify read()

Change-Id: Ic7de163fe121db13e00560adb257331bc709814d
ortify_test.cpp
b8771d9fd844fd28b6e5e6fe429ef40c097b32a6 10-Oct-2013 Nick Kralevich <nnk@google.com> am b35ebe3d: am 848efa9d: Merge "Revert "FORTIFY_SOURCE: fortify read()""

* commit 'b35ebe3d7097899fd4498ebb2b93e48fd836ebcf':
Revert "FORTIFY_SOURCE: fortify read()"
8d2532763981d132b02df157e4cc363c39330090 10-Oct-2013 Nick Kralevich <nnk@google.com> Revert "FORTIFY_SOURCE: fortify read()"

This change reverts
* fb3f956d075676c0438f2ee2bf3a5be659dfc04b.
* 65c99de2cb7a569ea17ca35e2f8f1e033421864b

Change-Id: Id5774eeede41130579115cf67a72ee914f2b47d5
ortify_test.cpp
45e3076cdc03efe7d37178fbd4366d5632d50cba 10-Oct-2013 Nick Kralevich <nnk@google.com> am 731ced6b: am c147478c: Merge "FORTIFY_SOURCE: fortify read()"

* commit '731ced6b289629a552b5841561fdcccf08d8c43a':
FORTIFY_SOURCE: fortify read()
65c99de2cb7a569ea17ca35e2f8f1e033421864b 09-Oct-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: fortify read()

Change-Id: I3d7b4ec86d04efb865117ce7629a2e26917f3331
ortify_test.cpp
6f103689268a8f6c6177b9c17d72436776a27b22 04-Oct-2013 Nick Kralevich <nnk@google.com> am 2e819c58: am 2ff3c746: Merge "Check memory size on FD_* functions"

* commit '2e819c58c9396eec3e4311ef2c9bdcadd107f001':
Check memory size on FD_* functions
7943df62f70f686b0c77532f6617b47255d75763 03-Oct-2013 Nick Kralevich <nnk@google.com> Check memory size on FD_* functions

Make sure the buffer we're dealing with has enough room.
Might as well check for memory issues while we're here,
even though I don't imagine they'll happen in practice.

Change-Id: I0ae1f0f06aca9ceb91e58c70183bb14e275b92b5
ortify_test.cpp
fa9fb5cb01986ac77ea4f7c54b2f419ac47989d3 03-Oct-2013 Elliott Hughes <enh@google.com> am 2a3d760e: am 00a816e5: Merge "Fix 32-bit issues in tests, and add a trivial test for the FD_* macros."

* commit '2a3d760e0fc0cbd2cac03754949457c062ced5f5':
Fix 32-bit issues in tests, and add a trivial test for the FD_* macros.
5b9310e502003e584bcb3a028ca3db7aa4d3f01b 03-Oct-2013 Elliott Hughes <enh@google.com> Fix 32-bit issues in tests, and add a trivial test for the FD_* macros.

Change-Id: Ia3f21ce1f0ed9236527fe44d36ccb7de6bf63113
ndroid.mk
ortify_test.cpp
thread_test.cpp
ys_select_test.cpp
5634373320d7dac30fa68feeb4d3b883566461ac 03-Oct-2013 Nick Kralevich <nnk@google.com> am 8598cd68: am f741e1c2: Merge "FORTIFY_SOURCE: Add __FD_* checks"

* commit '8598cd6888366008033286113bd633b44c70b7dd':
FORTIFY_SOURCE: Add __FD_* checks
90201d5eca050414d50a433866ccb580415bb0d4 03-Oct-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: Add __FD_* checks

Add FORTIFY_SOURCE checks for the following macros:

* FD_CLR
* FD_ISSET
* FD_SET

Bug: 11047121
Change-Id: I3c5952136aec9eff3288b91b1318677ff971525c
ortify_test.cpp
944ce989f8d9c4fa1c8211ac5aa46693346e1fe0 02-Oct-2013 Nick Kralevich <nnk@google.com> am f7da611b: am 00d51c9f: Merge "Use alloc_size attribute on *alloc functions"

* commit 'f7da611b3dedaf9951e08b0296daf67eda8228c0':
Use alloc_size attribute on *alloc functions
b91791d71c58d14309cd4d842d222f5d36b3a5a8 02-Oct-2013 Nick Kralevich <nnk@google.com> Use alloc_size attribute on *alloc functions

malloc and family were not declared with __attribute__((alloc_size)).
This was (sometimes) preventing FORTIFY_SOURCE related functions
from knowing the size of the buffer it's dealing with, inhibiting
FORTIFY_SOURCE protections.

Add __attribute__((alloc_size))

Information about the alloc_size attribute can be found
at http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Change-Id: Ia2f0a445f0170a7325f69259b5e7fb35a9f14921
ortify_test.cpp
a59e16bac971db7bb8e65e63d90e895bf4731747 30-Sep-2013 Christopher Ferris <cferris@google.com> am 34c2a9fc: Move stack unwinding test into library.

* commit '34c2a9fc37848d446bf91ce61783884232fffeb1':
Move stack unwinding test into library.
427e8cf90248f7da0a789fb3b4fb9a859c19aacd 27-Sep-2013 Christopher Ferris <cferris@google.com> Fix line that got removed by merge.

(cherry picked from commit f14d71fcf74e755ece4f8ca2ca2b7483424aa432)

Change-Id: Id3dd54d9efd87ef2bbb2c90adae2ce3911695027
ndroid.mk
e83a780600eda88d351fda590079265bcc0d1f56 27-Sep-2013 Conley Owens <cco3@android.com> resolved conflicts for merge of f4af9110 to klp-dev-plus-aosp

Change-Id: I9e499e552b758392dd0c7b8d888944c0150dd22a
9a622f874ceb90431623af140ca9a78eadc96dcb 27-Sep-2013 Nick Kralevich <nnk@google.com> am cc362291: am 8427b745: Merge "libc: fortify recvfrom()"

* commit 'cc362291362f8183431eccb19267c8a625f36006':
libc: fortify recvfrom()
8427b7450fe068db6484d161f7004661c4698858 27-Sep-2013 Nick Kralevich <nnk@google.com> Merge "libc: fortify recvfrom()"
fcdb47d7f5f859e04e9f4d88006e5595a9acf647 26-Sep-2013 Elliott Hughes <enh@google.com> am dbd4dbc0: am a1c1a334: Merge "Add a unit test for %n."

* commit 'dbd4dbc02c969531ff4891c06e66c63ec7a6d75d':
Add a unit test for %n.
7248a2d4d03122efc55637ec77692fbc260b6e4f 25-Sep-2013 Elliott Hughes <enh@google.com> Add a unit test for %n.

Change-Id: I9335e089d66c98d34577f5e1d1a54b8f507b94f6
tdio_test.cpp
60f4f9a5b99a0a66817f50edfc2194a49f8b5146 25-Sep-2013 Nick Kralevich <nnk@google.com> libc: fortify recvfrom()

Fortify calls to recv() and recvfrom().

We use __bos0 to match glibc's behavior, and because I haven't
tested using __bos.

Change-Id: Iad6ae96551a89af17a9c347b80cdefcf2020c505
ortify_test.cpp
a663ebd468b99981b07c1b0dca9aaa5da2cd8d50 24-Sep-2013 Elliott Hughes <enh@google.com> am f8222078: am 43e5badd: Merge "Fix %hhd formats in the printf family."

* commit 'f82220785d20385fa02aa78b02f3fdb98e5aa553':
Fix %hhd formats in the printf family.
1d13c64d781a87dfa3f01e5c179bfa36748786af 24-Sep-2013 Elliott Hughes <enh@google.com> Fix %hhd formats in the printf family.

Found by adapting the simple unit tests for libc logging to test
snprintf too. Fix taken from upstream OpenBSD without updating
the rest of stdio.

Change-Id: Ie339a8e9393a36080147aae4d6665118e5d93647
tdio_test.cpp
34c2a9fc37848d446bf91ce61783884232fffeb1 29-Aug-2013 Christopher Ferris <cferris@google.com> Move stack unwinding test into library.

Bug: 8291716

(cherry picked from commit 8240bed918722944c9985bc0cca89eb44c4f6c91)

Change-Id: I1da2d0757ed304c352229f9818c052925d4e976a
ndroid.mk
f4af911065b1b392085b857b891e5496bc75f478 27-Aug-2013 Christopher Ferris <cferris@google.com> Create bionic unit test library for use with CTS.

Bug: 8291716

(cherry picked from commit 153d92765bb693541abf49a2a1d31335e2c90348)

Change-Id: Ia53b85b95621b7000034e4c6259d6586d0987dee
ndroid.mk
7bfef355b1590cb8ac68d8caa97eaf0018191db8 28-Aug-2013 Christopher Ferris <cferris@google.com> Change hard-coded directory.

The tests are using /data/data which is not accessible to a non-root
user. Change this to /data/local/tmp which is accessible to all users.

Bug: 8291716

(cherry picked from commit 5227bb363dfdd0a4570cfa3d0735744daf7d83c2)

Change-Id: I83bf70aa8edd21b00321363d7ddcb65a5f048ba5
tatvfs_test.cpp
6d1f85dcdcf32117332b48563357d311a2886c30 15-Aug-2013 Christopher Ferris <cferris@google.com> Change hard-coded temporary directory.

The properties tests creates a temporary directory in /data/nativetest,
but this directory might not exist in all circumstances.
Change this to create the temporary directory in /data/local/tmp.

(cherry picked from commit bd6dc6a8864a1997eb8608030ac816740169c463)

Change-Id: I15144ece7ffb5c29eded9a1ef399db630f6af5ab
roperty_benchmark.cpp
ystem_properties_test.cpp
16e185c9081530859c17270fbaf5798f0ea871f8 11-Sep-2013 Christopher Ferris <cferris@google.com> __memcpy_chk: Fix signed cmp of unsigned values.

I accidentally did a signed comparison of the size_t values passed in
for three of the _chk functions. Changing them to unsigned compares.

Add three new tests to verify this failure is fixed.

Bug: 10691831

Merge from internal master.

(cherry-picked from 883ef2499c2ff76605f73b1240f719ca6282e554)

Change-Id: Id9a96b549435f5d9b61dc132cf1082e0e30889f5
ortify_test.cpp
e74f77f92d80f11616da699ac908fd5d1913e996 20-Sep-2013 Elliott Hughes <enh@google.com> am 48a909c9: am aad3c52e: Merge "Ensure we have the off64_t variant of every function that takes an off_t."

* commit '48a909c9fd6dbe9be5655ad172d1083fa69c4107':
Ensure we have the off64_t variant of every function that takes an off_t.
b4f7616fd618875768b8fffc122b58bdb84a9969 20-Sep-2013 Elliott Hughes <enh@google.com> Ensure we have the off64_t variant of every function that takes an off_t.

Change-Id: Ib2eee0cf13162be3b62559b84e90c6dcf5aab1c3
ndroid.mk
emporaryFile.h
ys_sendfile_test.cpp
nistd_test.cpp
1b75f3e07a8d20f45aa8a78578f294ac499529d0 19-Sep-2013 Elliott Hughes <enh@google.com> am fd5f6f19: am d5ddf40e: Merge "Fix host tests that need the shell."

* commit 'fd5f6f192ab6dcc01091b0e36af822dd3480f9b4':
Fix host tests that need the shell.
e60c4f0a6cb5836caa8d0de299cc83fe4b13744c 19-Sep-2013 Elliott Hughes <enh@google.com> Fix host tests that need the shell.

By making the /system/bin/sh available.

Change-Id: I99200c1ddc922a2f6b5cea8ff2da98aedbe70e7b
ndroid.mk
ca0f0662f42a5debe8469e1a9b06ebffb6e492aa 19-Sep-2013 Elliott Hughes <enh@google.com> am 2443358b: am 4a509d89: Merge "Add bionic-unit-tests-run-on-host special target"

* commit '2443358b3717bdce932303bbcbe625f59e1ae380':
Add bionic-unit-tests-run-on-host special target
f22fb68751c4040f3335cb0bd2d47f87c3ee1aac 06-Sep-2013 Pavel Chupin <pavel.v.chupin@intel.com> Add bionic-unit-tests-run-on-host special target

Allows running the tests linked with bionic .so on the host if host and
target are compatible. See more comments and usage limitation inlined.

make bionic-unit-tests-run-on-host should do build and run.

Change-Id: I5946fa72e009d324baa9da18f460294b3c1a615e
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ndroid.mk
2e7a8b44c2691770e917efcca80bc2650d93efaa 11-Sep-2013 Christopher Ferris <cferris@google.com> resolved conflicts for merge of 883ef249 to klp-dev-plus-aosp

Change-Id: I1e2bd03a0cb5a0ab191c525d1574377bc7fd90ab
883ef2499c2ff76605f73b1240f719ca6282e554 11-Sep-2013 Christopher Ferris <cferris@google.com> __memcpy_chk: Fix signed cmp of unsigned values.

I accidentally did a signed comparison of the size_t values passed in
for three of the _chk functions. Changing them to unsigned compares.

Add three new tests to verify this failure is fixed.

Bug: 10691831
Change-Id: Ia831071f7dffd5972a748d888dd506c7cc7ddba3
ortify_test.cpp
7a809829136457bb884e54cce6d1ec29223970c2 29-Aug-2013 Christopher Ferris <cferris@google.com> am fc24bc25: am 99b859cf: Merge "Move stack unwinding test into library."

* commit 'fc24bc2544edad03798a1c69d6a76259e6f1e7dd':
Move stack unwinding test into library.
8240bed918722944c9985bc0cca89eb44c4f6c91 29-Aug-2013 Christopher Ferris <cferris@google.com> Move stack unwinding test into library.

Bug: 8291716
Change-Id: Ia270f074b574a8fe86b5ad435bdef80999c64295
ndroid.mk
2c87c3ff021571e82684a865609a1146830338fb 28-Aug-2013 Nick Kralevich <nnk@google.com> am cfd0d72d: am eb8f3622: Merge "FORTIFY_SOURCE: introduce __strncpy_chk2"

* commit 'cfd0d72da8641087f9c4015ee586614da9f7320a':
FORTIFY_SOURCE: introduce __strncpy_chk2
93501d3ab81156bcef251bb817a49e9ca46a6ec1 28-Aug-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: introduce __strncpy_chk2

This change detects programs reading beyond the end of "src" when
calling strncpy.

Change-Id: Ie1b42de923385d62552b22c27b2d4713ab77ee03
ortify_test.cpp
7c8ebaf6c17c11854ae394ac7fa45c51489de75a 28-Aug-2013 Christopher Ferris <cferris@google.com> am d923b307: am 2557433d: Merge "Change hard-coded directory."

* commit 'd923b3075c9cf9e0749cee7373cabb9afba9420c':
Change hard-coded directory.
3825da5c0734215d179ce613681322fb5be3bfbe 28-Aug-2013 Christopher Ferris <cferris@google.com> am 7a2c2784: am 1f216e30: Merge "Create bionic unit test library for use with CTS."

* commit '7a2c2784a656adfae613b6b53d388988d6f2efa6':
Create bionic unit test library for use with CTS.
5227bb363dfdd0a4570cfa3d0735744daf7d83c2 28-Aug-2013 Christopher Ferris <cferris@google.com> Change hard-coded directory.

The tests are using /data/data which is not accessible to a non-root
user. Change this to /data/local/tmp which is accessible to all users.

Bug: 8291716

Change-Id: I66476bbbaf5d1dc0c103863abf9219405f06a85b
tatvfs_test.cpp
153d92765bb693541abf49a2a1d31335e2c90348 27-Aug-2013 Christopher Ferris <cferris@google.com> Create bionic unit test library for use with CTS.

Bug: 8291716

Change-Id: I46b749348456fae7892eecca6b44aef51a0e4747
ndroid.mk
e9e10c13ff3fdb7104aafd0707b2c851851c9d1f 15-Aug-2013 Jeff Hao <jeffhao@google.com> Fix pthread_getcpuclockid.

clock_gettime was returning EINVAL for the values
produced by pthread_getcpuclockid.

Bug: 10346183

(cherry picked from commit 9b06cc3c1b2c4e2b08582f3fc9393a05aa589766)

Change-Id: Ib81a7024c218a4502f256c3002b9030e2aaa278d
ndroid.mk
thread_test.cpp
6b5eb3134adb3d08c0803228ce79d3a5b14d4fac 22-Aug-2013 Elliott Hughes <enh@google.com> am e5ac43e1: am c44205cf: Merge "Work around tzcode\'s reliance on signed overflow."

* commit 'e5ac43e19afe270c2a70e4fb5d02b4cf056d50d7':
Work around tzcode's reliance on signed overflow.
f0c10a4a16c74f5099cf6b272c0a2f11f454e63c 22-Aug-2013 Elliott Hughes <enh@google.com> Work around tzcode's reliance on signed overflow.

I've mailed the tz list about this, and will switch to whatever upstream
fix comes along as soon as it's available.

Bug: 10310929

(cherry picked from commit 7843d44a594270bcb56e98b130603c054f8a9d38)

Change-Id: I205e2440703444c50cecd91d3458d33613ddbc59
ime_test.cpp
7843d44a594270bcb56e98b130603c054f8a9d38 22-Aug-2013 Elliott Hughes <enh@google.com> Work around tzcode's reliance on signed overflow.

I've mailed the tz list about this, and will switch to whatever upstream
fix comes along as soon as it's available.

Bug: 10310929
Change-Id: I36bf3fcf11f5ac9b88137597bac3487a7bb81b0f
ime_test.cpp
2389a26705a600e69c8c0b24a02bc05522bc68d1 16-Aug-2013 Christopher Ferris <cferris@google.com> am c058154b: am c8039337: Merge "Change hard-coded temporary directory."

* commit 'c058154b747f295c98ad771d3dec4065749ee1a9':
Change hard-coded temporary directory.
e714eb157ea92f3166b6292ed54138f3e092d5da 16-Aug-2013 Elliott Hughes <enh@google.com> am 6b6aaec8: am 4eacb341: Merge "Fix pthread_getcpuclockid."

* commit '6b6aaec892b1f256787fbbf106449f7d7e5888a2':
Fix pthread_getcpuclockid.
c8039337e3ee608e23f8ca6e5ea123d938b08029 16-Aug-2013 Christopher Ferris <cferris@google.com> Merge "Change hard-coded temporary directory."
9b06cc3c1b2c4e2b08582f3fc9393a05aa589766 15-Aug-2013 Jeff Hao <jeffhao@google.com> Fix pthread_getcpuclockid.

clock_gettime was returning EINVAL for the values
produced by pthread_getcpuclockid.

Bug: 10346183
Change-Id: Iabe643d7d46110bb311a0367aa0fc737f653208e
ndroid.mk
thread_test.cpp
bd6dc6a8864a1997eb8608030ac816740169c463 15-Aug-2013 Christopher Ferris <cferris@google.com> Change hard-coded temporary directory.

The properties tests creates a temporary directory in /data/nativetest,
but this directory might not exist in all circumstances.
Change this to create the temporary directory in /data/local/tmp.

Change-Id: I812d3e24fcd084c5d74055c9faa95b1656f255bc
roperty_benchmark.cpp
ystem_properties_test.cpp
840a114eb12773c5af39c0c97675b27aa6dee78c 09-Aug-2013 Elliott Hughes <enh@google.com> Add futimens.

(cherry picked from commit d0be7c8f9a06b3ca8ea7647ea35c8f9dc63f0fe1)

Bug: 10239370
Change-Id: I0087e85a94d83b6ce68ec6a0768c44cbe4bd0132
ndroid.mk
ys_stat_test.cpp
d0be7c8f9a06b3ca8ea7647ea35c8f9dc63f0fe1 09-Aug-2013 Elliott Hughes <enh@google.com> Add futimens.

Bug: 10239370
Change-Id: I518340084103dc339ef8a065d4837d6258a1381d
ndroid.mk
ys_stat_test.cpp
49b24b4efbc95cbff6dc73007583a880f7c01e7e 03-Aug-2013 Elliott Hughes <enh@google.com> am 3287dccf: Merge "Add ssse3 implementation of __memcmp16."

* commit '3287dccf2ecced89bb39b857abc8eba997bc3f51':
Add ssse3 implementation of __memcmp16.
baa91f4f8974b6e9a81fa3aa49f051b3bf823653 26-Jun-2013 Alexander Ivchenko <alexander.ivchenko@intel.com> Add ssse3 implementation of __memcmp16.

__memcmp16 was missing in x86. Also added C-version for backward
compatibility. Added bionic test for __memcmp16 and for wmemcmp.

Change-Id: I33718441e7ee343cdb021d91dbeaf9ce2d4d7eb4
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
tring_test.cpp
993ea1061b99607df0613be609ada257df3f9266 16-Jul-2013 Elliott Hughes <enh@google.com> am 5148661f: am 67750c85: Merge "Fix pthread_getattr_np, pthread_attr_setguardsize, and pthread_attr_setstacksize."

* commit '5148661f8d2be514d0e3c191bc1e489157ae1154':
Fix pthread_getattr_np, pthread_attr_setguardsize, and pthread_attr_setstacksize.
b95cf0d23a1db3b7c37bd98b0c86196796c9b029 15-Jul-2013 Elliott Hughes <enh@google.com> Fix pthread_getattr_np, pthread_attr_setguardsize, and pthread_attr_setstacksize.

pthread_getattr_np was reporting the values supplied to us, not the values we
actually used, which is kinda the whole point of pthread_getattr_np.

pthread_attr_setguardsize and pthread_attr_setstacksize were reporting EINVAL
for any size that wasn't a multiple of the system page size. This is
unnecessary. We can just round like POSIX suggests and glibc already does.

Also improve the error reporting for pthread_create failures.

Change-Id: I7ebc518628a8a1161ec72e111def911d500bba71
thread_test.cpp
d3522051ce506963c5900f4ecbabfaaa62a5fb5d 12-Jul-2013 Elliott Hughes <enh@google.com> am 7e56f462: am 3db1f359: Merge "Add a trivial gmtime(3) test."

* commit '7e56f462ad19791d7b270e297fc994d18df43252':
Add a trivial gmtime(3) test.
ee178bfb794d16d6c5a35f424b28c8ebb83e1581 12-Jul-2013 Elliott Hughes <enh@google.com> Add a trivial gmtime(3) test.

Change-Id: I849f200a455cd6971646fa45766ab22ba19fb866
ime_test.cpp
1087e0df4f542a7640db7709b068751be4752443 11-Jul-2013 Elliott Hughes <enh@google.com> am 731f7c2d: am 9d476716: Merge "Add <sys/statvfs.h>."

* commit '731f7c2d0e531d5e0ecdd771d743053f8d093e16':
Add <sys/statvfs.h>.
06040fd75c1edff9e5ffb2b3d3e2a6e66d57c11d 09-Jul-2013 Elliott Hughes <enh@google.com> Add <sys/statvfs.h>.

Bug: 2512019
Change-Id: I6e7fd3fa281977cc4bc270481a95416b5b2dc351
ndroid.mk
tatvfs_test.cpp
742aad35845b156a34db1d06a50a63f4b7f6d47d 03-Jul-2013 Elliott Hughes <enh@google.com> am 7c808b29: am feec97a7: Merge "Fix inttypes.h PRI?PTR and SCN?PTR macros."

* commit '7c808b29d5cea61e5bda90a1b0f2f0e669ee135e':
Fix inttypes.h PRI?PTR and SCN?PTR macros.
74f0833df6d04d51eb4e554845862ed7279f78b0 03-Jul-2013 Elliott Hughes <enh@google.com> Fix inttypes.h PRI?PTR and SCN?PTR macros.

Our intptr_t and uintptr_t aren't "long". Add a compilation test so we remember
to fix this to cope with 32- and 64-bit later.

Bug: http://code.google.com/p/android/issues/detail?id=57218
Change-Id: I2f816d339edb4f7d57e4418b818fb4c602093f38
ndroid.mk
nttypes_test.cpp
4b17283c9839ddd8c692eb57f657abf3facb73d8 01-Jul-2013 Nick Kralevich <nnk@google.com> am 28d298a6: am 413eef71: Merge "More FORTIFY_SOURCE functions under clang"

* commit '28d298a673da4367f27f428db5e12d7dad3d8e83':
More FORTIFY_SOURCE functions under clang
a6cde392765eb955cb4be5faa6ee62dcf77e8aa5 29-Jun-2013 Nick Kralevich <nnk@google.com> More FORTIFY_SOURCE functions under clang

* bzero
* umask
* strlcat

Change-Id: I65065208e0b8b37e10f6a266d5305de8fa9e59fc
ortify_test.cpp
fda0c066050c26cbb5bb130b5f2c25ccddde2945 28-Jun-2013 Nick Kralevich <nnk@google.com> am 2018cfa8: am 394df35e: Merge "Reorganize FORTIFY_SOURCE tests."

* commit '2018cfa85d4c7f36316376f5b090be5f0d3d13dc':
Reorganize FORTIFY_SOURCE tests.
5bcf39842e8c4b02ae557a2765a84e724f762469 28-Jun-2013 Nick Kralevich <nnk@google.com> Reorganize FORTIFY_SOURCE tests.

Get rid of a lot of the duplication in the various FORTIFY_SOURCE
tests. Instead, we build 4 separate static libraries, with
4 different compile time options, and link them into the final test
binary.

Change-Id: Idb0b7cccc8dd837adb037bf4ddfe8942ae138230
ndroid.mk
ortify1_test.cpp
ortify1_test_clang.cpp
ortify2_test.cpp
ortify2_test_clang.cpp
ortify_test.cpp
9a268a10bb5ceb564aea42f1658d0e83004f3b48 27-Jun-2013 Nick Kralevich <nnk@google.com> am f9ef0106: am 78a7bf99: Merge "stdio.h: enable vs?printf clang FORTIFY_SOURCE"

* commit 'f9ef0106da43d21e6cb68d87b86d806f63b215fd':
stdio.h: enable vs?printf clang FORTIFY_SOURCE
c8ae8bd9418b79f4da85dc12a61ebd82146b7e51 27-Jun-2013 Nick Kralevich <nnk@google.com> stdio.h: enable vs?printf clang FORTIFY_SOURCE

Enable FORTIFY_SOURCE protections under clang for the following
functions:

* vsprintf
* vsnprintf

and add unittests.

Change-Id: I90f8a27f7b202c78b5dd8ebf53050bf9e33496f7
ortify1_test.cpp
ortify1_test_clang.cpp
ortify2_test.cpp
ortify2_test_clang.cpp
d9643a3119264da152b4c9577bfee8b542c8454b 26-Jun-2013 Elliott Hughes <enh@google.com> am d31287d6: am 7d624e9a: Merge "Kernel dso support for \'dl_iterate_phdr\' function"

* commit 'd31287d6017475209cfee2fea0532bdc8c0f4aac':
Kernel dso support for 'dl_iterate_phdr' function
caad18c7d19a7371b1b8514c0f2777ebd00ba043 26-Jun-2013 Nick Kralevich <nnk@google.com> am 71802135: am bfacb603: Merge "libc: enable FORTIFY_SOURCE snprintf under clang"

* commit '7180213557f3120b391053b4f5861037eda6ebb6':
libc: enable FORTIFY_SOURCE snprintf under clang
be30c7a78a1cf4adc8ec9bbdf17e85186fdb05b2 19-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: revert to a single (larger) property area

d329697 is too complicated. Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Change-Id: Icd137669a4f8bc248e9dd2c1e8cc54e9193c9a6d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
roperty_benchmark.cpp
ystem_properties_test.cpp
d5276422ca9f1f4d45e91c189a1655521e91962d 17-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: add hierarchical properties test

Deliberately put items several levels deep in the trie hierarchy to test
the trie traversal

Change-Id: I995a1cdd3b5e74162fb5d25bc0f65140bdf2f719
Signed-off-by: Greg Hackmann <ghackmann@google.com>
ystem_properties_test.cpp
c45087bffa528c0809f0df2e0a3708eba7018b33 25-Jan-2013 Sergey Melnikov <sergey.melnikov@intel.com> Kernel dso support for 'dl_iterate_phdr' function

Kernel provides virtual DSO for stack unwinding/exception handlind info for
signal usage case. Stack unwinding routines use 'dl_iterate_phdr' function
for additional DWARF info gathering from DSOs. Patch enables virtual DSO
enumeration via dl_iterate_phdr function.

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: Ic2882b28f40b456a088bc1e63c50cbfda7e4a102
ndroid.mk
tack_unwinding_test.cpp
tack_unwinding_test_impl.c
621b19dddbfba1cd98c01cb95ce312baa20e0e7c 25-Jun-2013 Nick Kralevich <nnk@google.com> libc: enable FORTIFY_SOURCE snprintf under clang

Change-Id: I8b8059782a720104722b0841994b38f873ed02aa
ortify1_test.cpp
ortify1_test_clang.cpp
ortify2_test.cpp
ortify2_test_clang.cpp
5f7f7fca278c45debe7e2fa80edd859277141f17 25-Jun-2013 Nick Kralevich <nnk@google.com> am 95448039: am 0ea1d5c0: Merge "libc: enable sprintf FORTIFY_SOURCE under clang"

* commit '954480393f4539f62cdc3f6cb83c562050ea4f51':
libc: enable sprintf FORTIFY_SOURCE under clang
890aa0d937ae72473c84cc773e77d45e9288b0bc 25-Jun-2013 Greg Hackmann <ghackmann@google.com> Revert "bionic: add hierarchical properties test"

This reverts commit 0f76e2340ca53ce458a01f91627651dfe0112969.
ystem_properties_test.cpp
fa8cc0629f6227b507434245d237d44d7e119b16 25-Jun-2013 Greg Hackmann <ghackmann@google.com> Revert "bionic: revert to a single (larger) property area"

This reverts commit 5f05348c18286a2cea46eae8acf94ed5b7932fac.
roperty_benchmark.cpp
ystem_properties_test.cpp
1540f601be32bdd4af8e8c13bdf2bc06bdaa76f1 19-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: revert to a single (larger) property area

d329697 is too complicated. Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 5f05348c18286a2cea46eae8acf94ed5b7932fac)

Change-Id: I690704552afc07a4dd410277893ca9c40bc13e5f
roperty_benchmark.cpp
ystem_properties_test.cpp
cb215a7e9ecec9feb5aae9d9a5b1c89f392208e7 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: make property area expandable

The property area is initially one 4K region, automatically expanding as
needed up to 64 regions.

To avoid duplicating code, __system_property_area_init() now allocates
and initializes the first region (previously it was allocated in init's
init_property_area() and initialized in bionic). For testing purposes,
__system_property_set_filename() may be used to override the file used
to map in regions.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit d32969701be070c0161c2643ee3c3df16066bbb8)

Change-Id: I038d451fe8849b0c4863663eec6f57f6521bf4a7
roperty_benchmark.cpp
ystem_properties_test.cpp
5f05348c18286a2cea46eae8acf94ed5b7932fac 19-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: revert to a single (larger) property area

d329697 is too complicated. Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Change-Id: I0ecb27843404f93af5489f15bfe657d65175e4f0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
roperty_benchmark.cpp
ystem_properties_test.cpp
c6eb9854542c115fd9aa87731adcb1b5da57e8ac 24-Jun-2013 Nick Kralevich <nnk@google.com> libc: enable sprintf FORTIFY_SOURCE under clang

clang doesn't support __builtin_va_arg_pack(), so we have
to use #define instead.

Change-Id: I2ee75e6267d60cdf997fee6b9b0547bf68f062a1
ortify1_test.cpp
ortify1_test_clang.cpp
ortify2_test.cpp
ortify2_test_clang.cpp
0f76e2340ca53ce458a01f91627651dfe0112969 17-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: add hierarchical properties test

Deliberately put items several levels deep in the trie hierarchy to test
the trie traversal

Change-Id: Id3cbd2e7d3500216b1ac8025eac70c0939622903
Signed-off-by: Greg Hackmann <ghackmann@google.com>
ystem_properties_test.cpp
33ae76abf32b8f78799e9ebb1de2343dfa10c91a 20-Jun-2013 Nick Kralevich <nnk@google.com> am 5fed0eea: am 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"

* commit '5fed0eeabd88bfe241c416f2c2f44a14b6e447fa':
libc: enable FORTIFY_SOURCE clang strlcpy
8bafa7452ec0892572b0b49f86022ce945c5e908 20-Jun-2013 Nick Kralevich <nnk@google.com> libc: enable FORTIFY_SOURCE clang strlcpy

Change-Id: Idcfe08f5afc3dde592416df9eba83f64e130c7c2
ortify1_test.cpp
ortify1_test_clang.cpp
ortify2_test.cpp
d32969701be070c0161c2643ee3c3df16066bbb8 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: make property area expandable

The property area is initially one 4K region, automatically expanding as
needed up to 64 regions.

To avoid duplicating code, __system_property_area_init() now allocates
and initializes the first region (previously it was allocated in init's
init_property_area() and initialized in bionic). For testing purposes,
__system_property_set_filename() may be used to override the file used
to map in regions.

Change-Id: Ibe00ef52464bfa590953c4699a6d98383b0142b1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
roperty_benchmark.cpp
ystem_properties_test.cpp
02ca0e314219a4c7205a180a414c509651043f13 19-Jun-2013 Nick Kralevich <nnk@google.com> Merge "Fix FORTIFY_SOURCE unittests."
3cd4cac2cedd960e76bb55ce899f8d42bf4dfbfc 19-Jun-2013 Nick Kralevich <nnk@google.com> Fix FORTIFY_SOURCE unittests.

The compiler is too damn smart.

Change-Id: Ibef3ef41ec99f8cd9c06f1dbca535819f9a08197
ortify1_test_clang.cpp
ortify2_test_clang.cpp
c6ff844d75dddfb19fc804b8add2d6a79947b101 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: add __system_property_foreach

find_nth() will be inefficient on a trie. Since find_nth() is only used
internally and only for enumerating properties, we can add a foreach()
function to do this directly.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 577418403d68e663fb33c7b0c8a90d862d9c00cf)

Change-Id: Iaca97d1182ce2c28863ba85241cbb5cf6185eb2f
ystem_properties_test.cpp
dd0880fec3bb8c998680e78aff9e2ddc2bcf6d7a 18-Jun-2013 Nick Kralevich <nnk@google.com> Merge "libc: add limited FORTIFY_SOURCE support for clang"
7d06813d93b3b3745d438c000f596a38cb0efeb4 18-Jun-2013 Colin Cross <ccross@android.com> bionic: fix deleting property arrays in property benchmark

Use delete[] to delete arrays allocated with new []

Change-Id: Icc2a6b23df09049c008f7f1f50ed93a277174308
roperty_benchmark.cpp
7d90cfa6b5b49abb2123b069b81e0b9f4eba6432 18-Jun-2013 Colin Cross <ccross@android.com> bionic: change properties benchmarks to read a single property

The properties benchmarks were reading n properties from a property
area with n properties in it, which was making it hard to compare
the time between runs of different sizes. Change the benchmark
to read a random property per iteration so the numbers between
runs are comparable.

Change-Id: Ib1648ce0948d9038fce76d209608427376cfb8da
roperty_benchmark.cpp
16d1af167f8e36a9aa4a07ae77034ad519b00463 17-Jun-2013 Nick Kralevich <nnk@google.com> libc: add limited FORTIFY_SOURCE support for clang

In 829c089f83ddee37203b52bcb294867a9ae7bdbc, we disabled all
FORTIFY_SOURCE support when compiling under clang. At the time,
we didn't have proper test cases, and couldn't easily create targeted
clang tests.

This change re-enables FORTIFY_SOURCE support under clang for a
limited set of functions, where we have explicit unittests available.
The functions are:

* memcpy
* memmove
* strcpy
* strncpy
* strcat
* strncat
* memset
* strlen (with modifications)
* strchr (with modifications)
* strrchr (with modifications)

It may be possible, in the future, to enable other functions. However,
I need to write unittests first.

For strlen, strchr, and strrchr, clang unconditionally calls the
fortified version of the relevant function. If it doesn't know the
size of the buffer it's dealing with, it passes in ((size_t) -1),
which is the largest possible size_t.

I added two new clang specific unittest files, primarily copied
from fortify?_test.cpp.

I've also rebuild the entire system with these changes, and didn't
observe any obvious problems.

Change-Id: If12a15089bb0ffe93824b485290d05b14355fcaa
ndroid.mk
ortify1_test.cpp
ortify1_test_clang.cpp
ortify2_test.cpp
ortify2_test_clang.cpp
b27e200ad6170ba3163f5ae6ba581bdaabb2e696 29-Jan-2013 Colin Cross <ccross@android.com> bionic: add tests for properties

(cherry picked from commit 37d9f75dde881a0ba1c1b3253b1be19d4096963d)

Change-Id: Iac00ce10a4272032a1cbdbc4204277d6876e3365
ndroid.mk
roperty_benchmark.cpp
ystem_properties_test.cpp
0f020d18b138e24b1fe34074808e07ac412f35a4 06-Jun-2013 msg555 <msg555@gmail.com> Handles spurious wake-ups in pthread_join()

Removed 'join_count' from pthread_internal_t and switched to using the flag
PTHREAD_ATTR_FLAG_JOINED to indicate if a thread is being joined. Combined with
a switch to a while loop in pthread_join, this fixes spurious wake-ups but
prevents a thread from being joined multiple times. This is fine for
two reasons:

1) The pthread_join specification allows for undefined behavior when multiple
threads try to join a single thread.

2) There is no thread safe way to allow multiple threads to join a single
thread with the pthread interface. The second thread calling pthread_join
could be pre-empted until the thread is destroyed and its handle reused for
a different thread. Therefore multi-join is always an error.

Bug: https://code.google.com/p/android/issues/detail?id=52255
Change-Id: I8b6784d47620ffdcdbfb14524e7402e21d46c5f7
thread_test.cpp
fd0325bd98764afaca1dc258960dde060b3c77de 12-Jun-2013 Nick Kralevich <nnk@google.com> fix unittests.

7e6ce1a3c52d8533fed92c143419fedb0c93988a fixed abort() to raise
SIGABRT rather than causing SIGSEGV. However, the unittests were
not updated.

Fix unittests.

Change-Id: I73db194127b9b9e9440358aa94273863765a736b
ortify1_test.cpp
ortify2_test.cpp
tack_protector_test.cpp
885f3b9cad01b8158aadc55c159c17dbf34f622c 22-May-2013 Christopher Ferris <cferris@google.com> Implement malloc_usable_size for debug impls.

- Implemented chk_memalign.
- Fixed a few bugs in leak_memalign.
- Implemented {leak,fill,check,qemu}_malloc_usable_size.
- Make malloc_usable_size update at run time.
- Add malloc_test.cpp as a small set of tests for the
malloc debug routines.
- Fix the qemu routines since it's been broken since it moved to C++.
- Add support for the %u format to the out_vformat in libc_logging.cpp.
This is used by the emulator code.

Tested using the bionic-unit-tests with setprop libc.debug.malloc
set to 1, 5, and 10.

I tested as much as possible on the emulator, but tracing doesn't appear
to be working properly.

Bug: 6143477

Merge change from internal master.

(cherry-picked from commit 3d594c258045783fc9e1956ce7a4d91e302f011e)

Change-Id: I4ae00fffba82315a8c283f35893fd554460722fb
ndroid.mk
alloc_test.cpp
13476deec46d7ba101c1f76b8ddcaab9d0b96b84 03-Jun-2013 Nick Kralevich <nnk@google.com> Add tests for __strcpy_chk()

Change-Id: I5675d04fcd471732c1b87b83879a54fbcd27762e
ortify1_test.cpp
ortify2_test.cpp
tring_test.cpp
cf870199d576bdfc339b7fb016c9f6fe7f2c87ed 31-May-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: strcat / strncat optimize

__strcat_chk and __strncat_chk are slightly inefficient,
because they end up traversing over the same memory region
two times.

This change optimizes __strcat_chk / __strncat_chk so they
only access the memory once. Although I haven't benchmarked these
changes, it should improve the performance of these functions.

__strlen_chk - expose this function, even if -D_FORTIFY_SOURCE
isn't defined. This is needed to compile libc itself without
-D_FORTIFY_SOURCE.

Change-Id: Id2c70dff55a276b47c59db27a03734d659f84b74
ortify1_test.cpp
ortify2_test.cpp
tring_test.cpp
8cc145edf42ff8f0c10d5f2fd82ec99c6752e5ab 30-May-2013 Nick Kralevich <nnk@google.com> Add strncpy FORTIFY_SOURCE tests.

Change-Id: Id108b1d72b44d7e5fb911268e80bbdf896808f60
ortify1_test.cpp
ortify2_test.cpp
4f40e511b0612ea099ab5b0843977fe7a49372fd 20-Apr-2013 Nick Kralevich <nnk@google.com> libc: cleanup strchr

Move strchr to a .cpp file, and change to bionic directory.

Change-Id: I64ade7df326c0a9a714aca4caf5647b6833b1c97
ortify2_test.cpp
tring_test.cpp
277226bf43e01b25e9c573a37ee55ae052e85eb4 02-May-2013 Nick Kralevich <nnk@google.com> keep test names consistent with other tests.

Change-Id: I23dc4d963af40406b270af83cd17f6c8c95f1de3
ortify2_test.cpp
80541922e34f2879806caf1bfbd53ebd311f2f87 01-May-2013 Nick Kralevich <nnk@google.com> add strrchr -D_FORTIFY_SOURCE=2 test.

Change-Id: I1b95bb0086ae9f2f506f3cc90cee834c0ce3b1d8
ortify2_test.cpp
78d6d9888c24c50f65d694dc8283afdcb58db84c 30-Apr-2013 Nick Kralevich <nnk@google.com> libc: upgrade sprintf to _FORTIFY_SOURCE=2

Upgrade sprintf to fortify_source level 2, to catch
additional security bugs.

Change-Id: Ibc957d65e4cb96152de84b3745a04e00fa22659e
ortify1_test.cpp
ortify2_test.cpp
1aae9bd170883805f2e7975cd3dbd2502b083cc1 29-Apr-2013 Nick Kralevich <nnk@google.com> strncpy: implement _FORTIFY_SOURCE=2

Add support for fortify source level 2 to strncpy.
This will enable detection of more areas where strncpy
is used inappropriately. For example, this would have detected
bug 8727221.

Move the fortify_source tests out of string_test.cpp, and
put it into fortify1_test.cpp.

Create a new fortify2_test.cpp file, which copies all
the tests in fortify1_test.cpp, and adds fortify_source level
2 specific tests.

Change-Id: Ica0fba531cc7d0609e4f23b8176739b13f7f7a83
ndroid.mk
ortify1_test.cpp
ortify2_test.cpp
tring_test.cpp
0b25f633a23e575c8a1f9547d1af5dc5b0157a1c 12-Apr-2013 Elliott Hughes <enh@google.com> Switch to current FreeBSD qsort.

Change-Id: Ic46cd0b663dc5fa78c99dd38db0bfe849a25e789
tdlib_test.cpp
6b05c8e28017518fae04a3a601d0d245916561d2 11-Apr-2013 Elliott Hughes <enh@google.com> Start moving to current FreeBSD stdio.

This only touches the easy stuff.

Change-Id: Iecee57f1681dba5c56bff59f0e9a89811a71f0ca
tdio_test.cpp
8baa929d5d3bcf63381cf78ba76168c80c303f5e 03-Apr-2013 Kito Cheng <kito@0xlab.org> Prevent name conflict for eventfd.cpp and eventfd.s when building libc.a

- eventfd.cpp and eventfd.s will output to the same file when building libc.a
out/target/product/*/obj/STATIC_LIBRARIES/libc_intermediates/WHOLE/libc_common_objs/eventfd.o
- And then `eventfd` will undefined when statically linked to libc.

Also add a unit test.

Change-Id: Ib310ade3256712ca617a90539e8eb07459c98505
ndroid.mk
ventfd_test.cpp
a41ba2f0bfc4fce1ce8f06a9c289102c440c929d 22-Mar-2013 Elliott Hughes <enh@google.com> Fix pthread_setname_np's behavior on invalid pthread_ts.

Change-Id: I0a154beaab4d164ac812f2564d12e4d79b80a8e8
thread_test.cpp
8f2a5a0b40fc82126c691d5c30131d908772aab7 15-Mar-2013 Elliott Hughes <enh@google.com> Clean up internal libc logging.

We only need one logging API, and I prefer the one that does no
allocation and is thus safe to use in any context.

Also use O_CLOEXEC when opening the /dev/log files.

Move everything logging-related into one header file.

Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58
ndroid.mk
ebug_format_test.cpp
ibc_logging_test.cpp
e0175ca7e440a87e9d03f249fc8f210063df7908 14-Mar-2013 Elliott Hughes <enh@google.com> Don't search off the end of the index for bad Olson ids.

In the old code, the index was a file to itself, so it made sense to
read until you hit the end of the file. In the new code, the index is
followed by hundreds of KiB of data, so we need to just search the
index.

Bug: 8368791
Change-Id: Icf5f8b5516cf3a93679fa849c9f6cd1cb100e0f1
ndroid.mk
ime_test.cpp
53630c0e5bb6f845ba633e8dedc08b827f7b5d0c 12-Mar-2013 Elliott Hughes <enh@google.com> Merge "Cache the most-recently used timezone for mktime_tz and localtime_tz."
4a05bef4c06dac05f1c9aa8cfc5b7e7dd6642385 12-Mar-2013 Elliott Hughes <enh@google.com> Cache the most-recently used timezone for mktime_tz and localtime_tz.

Normally, the C library implicitly caches your timezone by virtue
of the fact that the prehistoric API assumes a single timezone for
the entire process.

The unfortunate mktime_tz and localtime_tz extensions work around
this, but represent timezones as strings to their callers, so code
that makes heavy use of these needs a cache to be able to perform
acceptably until it can hopefully one day be rewritten to use
java.util.Calendar or icu4c.

Bug: 8270865
Change-Id: I92e3964e86dc33ceac925f819cc5e26ff4203f50
ndroid.mk
ime_benchmark.cpp
b6e22482d4fbf62c23707a9096eecd2082a63ef1 09-Mar-2013 Elliott Hughes <enh@google.com> Let bionic use the correct definition of ssize_t.

Bug: 8253769
Change-Id: I50c7cc20828fc089b83580e039ce9153a6c5a8cc
tdio_test.cpp
6b3f49a5374305ce9690c3c5ca2aadc90f54c521 07-Mar-2013 Elliott Hughes <enh@google.com> Upgrade to current NetBSD popen/pclose.

This gets us back to using vfork now our ARM vfork assembler stub is
fixed, and adds the missing thread safety for the 'pidlist'.

Bug: 5335385
Change-Id: Ib08bfa65b2cb9fa695717aae629ea14816bf988d
tdio_test.cpp
f0777843c03deb26b1f78c8edd17c557041696e9 02-Mar-2013 Elliott Hughes <enh@google.com> Move realpath.c to upstream-freebsd.

This is actually a slightly newer upstream version than the one I
originally pulled. Hopefully now it's in upstream-freebsd it will
be easier to track upstream, though I still need to sit down and
write the necessary scripts at some point.

Bug: 5110679
Change-Id: I87e563f0f95aa8e68b45578e2a8f448bbf827a33
tdlib_test.cpp
e255642dc1178663860104d9da2590056fae8d0b 28-Feb-2013 Elliott Hughes <enh@google.com> Avoid changing the C++ ABI with ssize_t.

Bug: 8253769
Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
tdio_test.cpp
fae89fc4042ee4c360842234dfda7831c313bd44 21-Feb-2013 Elliott Hughes <enh@google.com> Fix raise(3) so it works in signal handlers.

We could special-case raise(3) in non-threaded programs, but the more
conservative course is to make pthread_kill(3) work in signal handlers
at the cost of a race shared by other C libraries.

Change-Id: I59fb23d03bdabf403435e731704b33acdf3e0234
thread_test.cpp
ignal_test.cpp
c641cafbc387849510d7f408e85f72fa3608916d 17-Feb-2013 Thorsten Glaser <tg@mirbsd.org> use architecture-specific ssize_t definition

after change 32822 was rejected, this is the more light-weight
version of the fix: libc/include/sys/types.h already - via
libc/kernel/common/linux/posix_types.h - includes a definition
of __kernel_ssize_t from libc/kernel/arch-*/asm/posix_types.h
which is architecture-specific, toolchain-agnostic and also
gets rid of the gcc -Wformat warning (which it issues correctly,
since this i̲s̲ indeed a bug in bionic)

Change-Id: Ie4503ab16628bc25815a836d07556f665e9795c7
tdio_test.cpp
9d23e04c43dbb8480bea8be28b8a2f37423bec49 16-Feb-2013 Elliott Hughes <enh@google.com> Fix pthreads functions that should return ESRCH.

imgtec pointed out that pthread_kill(3) was broken, but most of the
other functions that ought to return ESRCH for invalid/exited threads
were equally broken.

Change-Id: I96347f6195549aee0c72dc39063e6c5d06d2e01f
thread_test.cpp
40eabe24e4e3ae8ebe437f1f4e43cf39cbba2e9e 15-Feb-2013 Elliott Hughes <enh@google.com> Fix the pthread_setname_np test.

Fix the pthread_setname_np test to take into account that emulator kernels are
so old that they don't support setting the name of other threads.

The CLONE_DETACHED thread is obsolete since 2.5 kernels.

Rename kernel_id to tid.

Fix the signature of __pthread_clone.

Clean up the clone and pthread_setname_np implementations slightly.

Change-Id: I16c2ff8845b67530544bbda9aa6618058603066d
thread_test.cpp
7fd803cdfa873c01138dcbd614ec92418169b1c2 15-Feb-2013 Elliott Hughes <enh@google.com> Fix the stack protector death test.

Now __stack_chk_fail calls abort(3) directly, we terminate with
SIGSEGV rather than SIGABRT. (Because of the workaround for the
debuggerd lossage in the abort(3) implementation, which was the
motivation for switching __stack_chk_fail over to abort(3).)

Also clarify the comment on the weird pthread death test, so it
doesn't get copied and pasted onto real death tests.

Change-Id: Ie832eaded61359c99e7a10db65e28f35e8f63eed
thread_test.cpp
tack_protector_test.cpp
fb7eb5e07f43587c2bedf2aaa53b21fa002417bb 14-Feb-2013 Elliott Hughes <enh@google.com> Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces.

Bug: 2487269
Change-Id: Iec5e470fc22cd9108404f634a9d4baa2c7b7f58f
tack_protector_test.cpp
26a13bcfb894b19ea4c53e4456b07bedd233dda4 14-Feb-2013 Elliott Hughes <enh@google.com> Stop using the local gcc.

Some build servers are still out of date, so we're better off having
the known quanitity of the consistently out-of-date prebuilt host gcc.

Change-Id: Ib6308ae926ffa1ac5d95efbbf32052344c17a6b8
ndroid.mk
73964c592c8d23901e9479893dfbd3d0f25bab04 13-Feb-2013 Elliott Hughes <enh@google.com> Everyone has CLZ.

Even armv5 had CLZ.

Change-Id: I51bc8d1166d09940fd0d3f4c7717edf26977082c
ndroid.mk
trings_test.cpp
d8213bb5738ac778fcb5d696d1294b0f8ddae7f3 13-Feb-2013 Elliott Hughes <enh@google.com> Update getnameinfo.c, remove dead code, and fix error reporting.

Also add a unit test for the salen size checking.

Bug: 1889275
Change-Id: I8ec4107df9e2e9a8571e8915525249c6e44b98ad
etdb_test.cpp
d3b9d11369ee15dc0ce512014284c3c5432f2813 13-Feb-2013 Elliott Hughes <enh@google.com> Add a test that getaddrinfo works when hints are NULL.

Bug: 1827911
Change-Id: I9e1b774c44c10a8c5391bcf3baf1607f50eaf214
ndroid.mk
etdb_test.cpp
5227663d2ffd70dc32f03a7a5b103ef0d3fc0584 13-Feb-2013 Elliott Hughes <enh@google.com> Put the right number of Ls after 64-bit constants.

Change-Id: I9f96259f21e42a84b9ebe20655fe0edb31f41892
ath_test.cpp
9701d4b7018ea50f57601eaec5f8f6731a7c6510 13-Feb-2013 Elliott Hughes <enh@google.com> Give up trying to build the pthread_setname_np tests for glibc.

Looks like using /usr/bin/g++ isn't enough on some of our older
build servers.

Change-Id: Id7681fb164eb6324b10050f6bb237393e95b41e9
thread_test.cpp
3e898476c7230b60a0f76968e64ff25f475b48c0 12-Feb-2013 Elliott Hughes <enh@google.com> Revert "Revert "More pthreads cleanup.""

This reverts commit 6f94de3ca49e4ea147b1c59e5818fa175846518f

(Doesn't try to increase the number of TLS slots; that leads to
an inability to boot. Adds more tests.)

Change-Id: Ia7d25ba3995219ed6e686463dbba80c95cc831ca
ndroid.mk
thread_test.cpp
fcaf4e9f9b735e053469c7ecbf63584e10fd67a7 12-Feb-2013 Elliott Hughes <enh@google.com> Merge "Revert "More pthreads cleanup.""
6f94de3ca49e4ea147b1c59e5818fa175846518f 12-Feb-2013 Elliott Hughes <enh@google.com> Revert "More pthreads cleanup."

This reverts commit 2a1bb4e64677b9abbc17173c79768ed494565047

Change-Id: Ia443d0748015c8e9fc3121e40e68258616767b51
thread_test.cpp
85f491f96da3b79d0d7cc5368bc1f649e1a82340 12-Feb-2013 Elliott Hughes <enh@google.com> Merge "More pthreads cleanup."
5e3fc43ddeada547a155c6f561a12ff0b16e02d3 12-Feb-2013 Elliott Hughes <enh@google.com> Fix __pthread_clone on ARM to set errno on failure.

MIPS and x86 appear to have been correct already.

(Also fix unit tests that ASSERT_EQ with errno so that the
arguments are in the retarded junit order.)

Bug: 3461078
Change-Id: I2418ea98927b56e15b4ba9cfec97f5e7094c6291
irent_test.cpp
etcwd_test.cpp
thread_test.cpp
tdio_test.cpp
tubs_test.cpp
2a1bb4e64677b9abbc17173c79768ed494565047 11-Feb-2013 Elliott Hughes <enh@google.com> More pthreads cleanup.

POSIX says pthread_create returns EAGAIN, not ENOMEM.

Also pull pthread_attr_t functions into their own file.

Also pull pthread_setname_np into its own file.

Also remove unnecessary #includes from pthread_key.cpp.

Also account for those pthread keys used internally by bionic,
so they don't count against the number of keys available to user
code. (They do with glibc, but glibc's limit is the much more
generous 1024.)

Also factor out the common errno-restoring idiom to reduce gotos.

Bug: 6702535
Change-Id: I555e66efffcf2c1b5a2873569e91489156efca42
thread_test.cpp
44b53ad6818de344e0b499ad8fdbb21fcb0ff2b6 11-Feb-2013 Elliott Hughes <enh@google.com> Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""

This reverts commit 6260553d48f6fd87ca220270bea8bafdde5726ec

(Removing the accidental libm/Android.mk change.)

Change-Id: I6cddd9857c31facc05636e8221505b3d2344cb75
thread_test.cpp
6260553d48f6fd87ca220270bea8bafdde5726ec 11-Feb-2013 Elliott Hughes <enh@google.com> Revert "Pull the pthread_key_t functions out of pthread.c."

This reverts commit ad59322ae432d11ff36dcf046016af8cfe45fbe4

somehow my unfinished libm/Android.mk change got into here.

Change-Id: I46be626c5269d60fb1ced9862f2ebaa380b4e0af
thread_test.cpp
ad59322ae432d11ff36dcf046016af8cfe45fbe4 09-Feb-2013 Elliott Hughes <enh@google.com> Pull the pthread_key_t functions out of pthread.c.

This was originally motivated by noticing that we were setting the
wrong bits for the well-known tls entries. That was a harmless bug
because none of the well-known tls entries has a destructor, but
it's best not to leave land mines lying around.

Also add some missing POSIX constants, a new test, and fix
pthread_key_create's return value when we hit the limit.

Change-Id: Ife26ea2f4b40865308e8410ec803b20bcc3e0ed1
thread_test.cpp
d3920b3a996b358e48232f417aa0a1e44a60f155 08-Feb-2013 Elliott Hughes <enh@google.com> Switch to using AT_RANDOM for the stack guards.

Bug: 7959813
Change-Id: I8db4b8912ba649bfe668c6f22aa44690ddd401a2
tack_protector_test.cpp
9edb3e004b487e08cbbb54f2af18b15241550513 07-Feb-2013 Elliott Hughes <enh@google.com> Improve benchmarking tool, add a few math benchmarks.

Change-Id: I641305dd0e4ac0705381e735ed1604c5be7aa536
ndroid.mk
enchmark.h
enchmark_main.cpp
ath_benchmark.cpp
tring_benchmark.cpp
428f5567be25b8090e3dd72e2d3d337c305b514e 06-Feb-2013 Elliott Hughes <enh@google.com> Remove bogus extra alignment from sbrk.

Bug: https://code.google.com/p/android/issues/detail?id=37349
Change-Id: I970c7b6be7bb7fbe6bbbe2c332f05816aeb0e09f
nistd_test.cpp
b16b72248bd109b6073df6a45aeffaa69e38cfc6 04-Feb-2013 Elliott Hughes <enh@google.com> Add basic tests for posix_memalign.

Change-Id: Ie34fcc87aa9e8bfc715e25161752024b11e2032a
tdlib_test.cpp
a0ee07829a9ba7e99ef68e8c12551301cc797f0f 31-Jan-2013 Elliott Hughes <enh@google.com> Upgrade libm.

This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.

It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).

All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.

Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
ndroid.mk
env_test.cpp
ath_test.cpp
41b3179c9ef03ebb447cac7f5e8405dce399cb17 28-Jan-2013 Elliott Hughes <enh@google.com> Unit tests for formatting code, fix %%.

Also fix <signal.h> and <stdio.h> so they don't cause compiler warnings.

Change-Id: Ib1a746bf01de22d47dbd964de0e6af80a7c96303
ndroid.mk
ebug_format_test.cpp
a44e9afdd16105d6f36319cb538666d9cc78435a 18-Jan-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: optimize

Don't do the fortify_source checks if we can determine, at
compile time, that the provided operation is safe.

This avoids silliness like calling fortify source on things like:

size_t len = strlen("asdf");
printf("%d\n", len);

and allows the compiler to optimize this code to:

printf("%d\n", 4);

Defer to gcc's builtin functions instead of pointing our code
to the libc implementation.

Change-Id: I5e1dcb61946461c4afaaaa983e39f07c7a0df0ae
tring_test.cpp
36bd371e26c716cbc18e11801b13eff0352d91b0 16-Jan-2013 Nick Kralevich <nnk@google.com> Revert "stack protector: use AT_RANDOM"

The AT_RANDOM changes broke setuid / setgid executables
such as "ping". When the linker executes a setuid program,
it cleans the environment, removing any invalid environment
entries, and adding "NULL"s to the end of the environment
array for each removed variable. Later on, we try to determine
the location of the aux environment variable, and get tripped
up by these extra NULLs.

Reverting this patch will get setuid executables working again,
but getauxval() is still broken for setuid programs because of
this bug.

This reverts commit e3a49a8661125f24aec8a1453e54b3b78005e21e.

Change-Id: I05c58a896b1fe32cfb5d95d43b096045cda0aa4a
tack_protector_test.cpp
e3a49a8661125f24aec8a1453e54b3b78005e21e 14-Jan-2013 Nick Kralevich <nnk@google.com> stack protector: use AT_RANDOM

Populate the stack canaries from the kernel supplied
AT_RANDOM value, which doesn't involve any system calls.
This is slightly faster (6 fewer syscalls) and avoids
unnecessarily reading /dev/urandom, which depletes entropy.

Bug: 7959813

Change-Id: If2b43100a2a9929666df3de56b6139fed969e0f1
tack_protector_test.cpp
606058933c5129cb1026960ea67624b9426c610f 15-Jan-2013 Nick Kralevich <nnk@google.com> fix strerror_r test

e6e60065ff093ff8c859ab146cf543531cb1967c modified strerror_r to
treat errno as signed. However, the change to the test code
modified the "strerror" test, not the "strerror_r" test.

Make the same change for the strerror_r code.

Change-Id: Ia236a53df5745935e229a4446a74da8bed0cfd7b
tring_test.cpp
2c5153b043b44e9935a334ae9b2d5a4bc5258b40 11-Jan-2013 Nick Kralevich <nnk@google.com> libc: add getauxval()

Add support for getauxval(). This method allows a program an easy way
to retrieve information from the kernel auxiliary vector, and will
hopefully replace other clumsy ways of accessing this same information.

This particular function was also added to glibc in glibc 2.16.
See the following URLs for more details.

* http://lwn.net/Articles/519085/
* http://www.gnu.org/software/libc/manual/html_node/Auxiliary-Vector.html

This change is a prerequisite for bug 7959813.

Bug: http://code.google.com/p/android/issues/detail?id=38441
Change-Id: Iba19d899df334bddc6f4899077ece2fc87564ea8
ndroid.mk
etauxval_test.cpp
dcab1b2c76a498c56bc00024613386de8b4b2aae 11-Jan-2013 Nick Kralevich <nnk@google.com> Add stack canaries / strcpy tests.

Add a test to ensure that stack canaries are working
correctly. Since stack canaries aren't normally generated
on non-string functions, we have to enable stack-protector-all.

Add a test to ensure that an out of bounds strcpy generates
a runtime failure.

Change-Id: Id0d3e59fc4b9602da019e4d35c5c653e1a57fae4
ndroid.mk
tack_protector_test.cpp
tring_test.cpp
e6e60065ff093ff8c859ab146cf543531cb1967c 11-Jan-2013 Elliott Hughes <enh@google.com> glibc 2.15 treats errno as signed in strerror(3).

And the only reason I hadn't done that in bionic is because I wanted to behave
the same as glibc.

Change-Id: I2cf1bf0aac82a748cd6305a2cabbac0790058570
tring_test.cpp
c5d028fc913de84a781bd61084bf7ae2182fd48e 10-Jan-2013 Elliott Hughes <enh@google.com> Only have one copy of the kernel_sigset_t hack, and add more tests.

Change-Id: I377522fcba6fb4b5fd2754ab15b091014bd7c16f
thread_test.cpp
ignal_test.cpp
a43e906221a3e9c70a66118a8692cd46f77e144e 07-Jan-2013 Elliott Hughes <enh@google.com> Don't test GNU-style ELF hashes on MIPS.

The MIPS toolchain can't generate them because they're incompatible
with the MIPS ABI (which requires .dynsym match the GOT, while GNU-style
requires .dynsym to be sorted by hash code), so there's nothing to test.

Change-Id: I2220f452fe6fe595ec1312544cc741dd390a36a5
ndroid.mk
lfcn_test.cpp
fb5e5cbdd4e1d75594c37ebb544c0f46482a027b 07-Jan-2013 Elliott Hughes <enh@google.com> Fix an off-by-one error in the sigset_t function error handling.

Spotted while running the tests on MIPS, where sigset_t is
actually large enough. The bits in sigset_t are used such that
signal 1 is represented by bit 0, so the range of signals is
actually [1, 8*sizeof(sigset_t)]; it seems clearer to reword
the code in terms of valid bit offsets [0, 8*sizeof(sigset_t)),
which leads to the usual bounds checking idiom.

Change-Id: Id899c288e15ff71c85dd2fd33c47f8e97aa1956f
ignal_test.cpp
a55f63083fb16b2595f517a3260083e5f8cddd02 02-Jan-2013 Elliott Hughes <enh@google.com> Define _POSIX_MONOTONIC_CLOCK and implement sysconf(_SC_MONOTONIC_CLOCK).

Bug: http://code.google.com/p/android/issues/detail?id=39680
Change-Id: I11cf10a66f9d305868a725f04f581099fb88bbfc
ndroid.mk
nistd_test.cpp
e66190d2a97a713ae4b4786e60ca3d67ab8aa192 19-Dec-2012 Elliott Hughes <enh@google.com> Check for unknown flags passed to dlopen(3).

Change-Id: I56f4aab0e5a1487bc32d2c4d231e8bd15c4ac8da
ndroid.mk
lfcn_test.cpp
lopen_test.cpp
d8a5a6f513c6fa99229e9c82c5c308c7cd6b3d54 08-Dec-2012 Chris Dearman <chris@mips.com> Use pthread_kill() in raise()

raise() should use pthread_kill() in a pthreads environment.
For bionic this means it should always be used.

Change-Id: Ic679272b664d2b8a7068b628fb83a9f7395c441f
ignal_test.cpp
da73f655fcbac6e1a8bfd35303cef6f41187d12b 01-Dec-2012 Elliott Hughes <enh@google.com> Add argument checking to sigemptyset(3) and friends.

You could argue that this is hurting people smart enough to have manually
allocated a large-enough sigset_t, but those people are smart enough to
implement their own sigset functions too.

I wonder whether our least unpleasant way out of our self-inflicted 32-bit
cesspool is to have equivalents of _FILE_OFFSET_BITS such as _SIGSET_T_BITS,
so calling code could opt in? You'd have to be careful passing sigset_t
arguments between code compiled with different options.

Bug: 5828899
Change-Id: I0ae60ee8544835b069a2b20568f38ec142e0737b
ndroid.mk
ignal_test.cpp
fbe44ec0436a8ce735f4dbe06c5109e3c0d4a8ae 09-Nov-2012 Elliott Hughes <enh@google.com> Add a memmove(3) benchmark.

Change-Id: I9c0ffae0b5aae29521b7e68e5ce2318b5a401cba
tring_benchmark.cpp
7be369d4c60e9df2316fdb6c73181a40020abef2 09-Nov-2012 Elliott Hughes <enh@google.com> Simple google3-compatible benchmarking.

Based on our open-source RE2 benchmarking code.

Includes benchmarks for a handful of <string.h> functions.

Change-Id: I30eb70d25dbf4ad5f2ca44976a8ce3b1ff7dad01
ndroid.mk
enchmark.h
enchmark_main.cpp
tring_benchmark.cpp
d460f3f1af80af40d8c3fab12a68459d8d1ec4c5 08-Nov-2012 Elliott Hughes <enh@google.com> Merge "Tests for string routines."
6e33b0296d23c75bdefa53f0bf0b08c0d877a652 08-Nov-2012 Elliott Hughes <enh@google.com> Fix dlopen_library_with_only_gnu_hash_Test.

Change-Id: Id3395f155587cfa74061f97a2cb4c6a6e59c13dc
lopen_test.cpp
036154b0c2d64d618aded8674f2e13cbbb2867e2 05-Oct-2012 Anna Tikhonova <anna.tikhonova@intel.com> Tests for string routines.

Change-Id: I24068a228f59df1c3b758c5b2026a09720490616
Signed-off-by: Anna Tikhonova <anna.tikhonova@intel.com>
tring_test.cpp
90e10d41c4271a5d517f60f4ff1d2891b8ccc034 03-Nov-2012 Elliott Hughes <enh@google.com> Rewrite <fenv.h> for ARM.

The old code was one big no-op.

Bug: http://code.google.com/p/android/issues/detail?id=38196
Change-Id: I201a6ffa477385b2629f45e8c948bdfbd47b5bf1
ndroid.mk
env_test.cpp
4f251bee5d51228217c1bf4dfc9219f3058bd3ed 02-Nov-2012 Elliott Hughes <enh@google.com> Don't corrupt the thread list if the main thread exits.

...and don't pass a non-heap pointer to free(3), either.

This patch replaces the "node** prev" with the clearer "node* prev"
style and fixes the null pointer dereference in the old code. That's
not sufficient to fix the reporter's bug, though. The pthread_internal_t*
for the main thread isn't heap-allocated --- __libc_init_tls causes a
pointer to a statically-allocated pthread_internal_t to be added to
the thread list.

Bug: http://code.google.com/p/android/issues/detail?id=37410
Change-Id: I112b7f22782fc789d58f9c783f7b323bda8fb8b7
thread_test.cpp
1a6961650c82168864afe040dbdc05977db701df 01-Nov-2012 Elliott Hughes <enh@google.com> Stop defining our own PAGE_SIZE and PAGE_MASK, and test dlclose(3) too.

Also remove an unnecessary #include and a now-obsolete TODO.

Change-Id: I36d923721e349a286934b9534090a67ce0786e7b
lopen_test.cpp
124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1 31-Oct-2012 Elliott Hughes <enh@google.com> Reject .so files with no sysv hash table.

Also ensure that dlopen(3) errors always include the name of the library we
failed to open.

Also fix a bug where we'd fall back to searching LD_LIBRARY_PATH and the
built-in paths for names that include slashes.

Bug: http://code.google.com/p/android/issues/detail?id=38479
Change-Id: Ib2c009ed083344a7a012749d58f8679db2f26c78
ndroid.mk
lopen_test.cpp
mpty.cpp
06b596104a9ed3ac089abd00186a5698d7e8544f 30-Oct-2012 Elliott Hughes <enh@google.com> Merge "Fix bug in pthread_join, pthread_exit, pthread_detach"
58b575485c446f9d76ee00f67516ed42cf017769 29-Oct-2012 Elliott Hughes <enh@google.com> Clean up the <libgen.h> implementation a little, bring in tests.

Most of these tests were in system/extras, but I've added more to cover other
cases explicitly mentioned by POSIX.

Change-Id: I5e8d77e4179028d77306935cceadbb505515dcde
ndroid.mk
ibgen_test.cpp
10ce96944eaea4c459392952652fdb24742c9c29 26-Oct-2012 Sergey Melnikov <sergey.melnikov@intel.com> Fix bug in pthread_join, pthread_exit, pthread_detach

pthread_no_op_detach_after_join test from bionic-unit-tests hangs
on x86 emulator. There is a race in the pthread_join, pthread_exit,
pthread_detach functions:
- pthread_join waits for the non-detached thread
- pthread_detach sets the detached flag on that thread
- the thread executes pthread_exit which just kills the now-detached
thread, without sending the join notification.

This patch improves the test so it fails on ARM too, and modifies
pthread_detach to behave more like glibc, not setting the detach state if
called on a thread that's already being joined (but not returning an error).

Change-Id: I87dc688221ce979ef5178753dd63d01ac0b108e6
Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
thread_test.cpp
14f19592ae7c819855052bcebc79de87069c2954 29-Oct-2012 Elliott Hughes <enh@google.com> Fix the pthread_join on self error case.

We should return EDEADLK, not deadlock the calling thread.

Change-Id: I1243483f709c11b2a60e41142725c54c7dbfcbc9
thread_test.cpp
c30396f5f225e0b5a83a35432e2d82a7063cfdb9 29-Oct-2012 David 'Digit' Turner <digit@android.com> libc: Fix alphasort() signature (and implementation).

The declaration for alphasort() in <dirent.h> used the deprecated:

int alphasort(const void*, const void*);

while both Posix and GLibc use instead:

int alphasort(const struct dirent** a, const struct dirent** b);

See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html

This patch does the following:

- Update the declaration to match Posix/GLibc
- Get rid of the upstream BSD code which isn't compatible with the new
signature.
- Implement a new trivial alphasort() with the right signature, and
ensure that it uses strcoll() instead of strcmp().
- Remove Bionic-specific #ifdef .. #else .. #endif block in
dirent_test.cpp which uses alphasort().

Even through strcoll() currently uses strcmp(), this does the right
thing in the case where we decide to update strcoll() to properly
implement locale-specific ordered comparison.

Change-Id: I4fd45604d8a940aaf2eb0ecd7d73e2f11c9bca96
irent_test.cpp
063cfb2084ea4b12d3c85b2d2c44e888f0857eb4 26-Oct-2012 Elliott Hughes <enh@google.com> Clean up the implementation of the <dirent.h> functions.

Change-Id: I3c647cc9588525afc41fee90ee468d58cd13503a
ndroid.mk
irent_test.cpp
ad88a0863110798cef5169dcf917e18b967a7cf6 25-Oct-2012 Elliott Hughes <enh@google.com> Per-thread -fstack-protector guards for x86.

Based on a pair of patches from Intel:

https://android-review.googlesource.com/#/c/43909/
https://android-review.googlesource.com/#/c/44903/

For x86, this patch supports _both_ the global that ARM/MIPS use
and the per-thread TLS entry (%gs:20) that GCC uses by default. This
lets us support binaries built with any x86 toolchain (right now,
the NDK is emitting x86 code that uses the global).

I've also extended the original tests to cover ARM/MIPS too, and
be a little more thorough for x86.

Change-Id: I02f279a80c6b626aecad449771dec91df235ad01
ndroid.mk
lopen_test.cpp
tack_protector_test.cpp
tring_test.cpp
5419b9474753d25dff947c7740532f86d130c0be 17-Oct-2012 Elliott Hughes <enh@google.com> Make dlerror(3) thread-safe.

I gave up trying to use the usual thread-local buffer idiom; calls to
calloc(3) and free(3) from any of the "dl" functions -- which live in
the dynamic linker -- end up resolving to the dynamic linker's stubs.
I tried to work around that, but was just making things more complicated.
This alternative costs us a well-known TLS slot (instead of the
dynamically-allocated TLS slot we'd have used otherwise, so no difference
there), plus an extra buffer inside every pthread_internal_t.

Bug: 5404023
Change-Id: Ie9614edd05b6d1eeaf7bf9172792d616c6361767
lopen_test.cpp
tring_test.cpp
3b297c40794b23d50cb5240f9b03f6ef25fd98db 12-Oct-2012 Elliott Hughes <enh@google.com> Fix dlerror(3).

Add unit tests for dlerror(3) in various situations. I think We're at least
as good as glibc now.

Also factor out the ScopedPthreadMutexLock and use it here too.

Bug: http://code.google.com/p/android/issues/detail?id=38398
Change-Id: I040938b4366ab836e3df46d1d8055b92f4ea6ed8
lopen_test.cpp
156da966214957c5616a0b83cc84686eedfc4e31 10-Oct-2012 Elliott Hughes <enh@google.com> Fix a getcwd(3) bug and make our tests run correctly under valgrind.

The getcwd(3) bug was found by valgrind.

Bug: 7291287
Change-Id: I59f3bff1c1392a408b905934eebcd5d894d37492
lopen_test.cpp
774c7f54ff375d71106283d42779b0cc5f238f87 01-Oct-2012 Elliott Hughes <enh@google.com> Upgrade to the current NetBSD rand implementation.

Also add basic unit tests.

Change-Id: I7fc7ef61d47c1e8fdf8b8eff67a635220c3afd56
ndroid.mk
tdlib_test.cpp
eac9eb462ed6f7fcfb791e7a08b4011fcca47829 08-Sep-2012 Irina Tirdea <irina.tirdea@intel.com> Add getdelim(3) and getline(3) to bionic

Some userspace programs (e.g. perf) need getline.

Changes:
() add getdelim.c, getline.c from NetBSD (http://netbsd.org/) under the
NetBSD Foundation's (TNF) license ("2 clause" Berkeley-style license).
() add stub for reentrant.h header that is needed by getdelim.c
() add tests for getdelim(3) and getline(3).
() update NOTICE file.

Change-Id: I22ed82dd5904b9d7a3695535c04f502be3c27c5d
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
tdio_test.cpp
ac184b21425a0681c51ef152f0567168b575da49 26-Sep-2012 Elliott Hughes <enh@google.com> Fix several compiler warnings.

Change-Id: I55caa50a5937442734f4fcbdb4edf1c70f335bf8
tubs_test.cpp
8e630dacf61307e4681f04fc6b5ee593f30d91d0 26-Sep-2012 Elliott Hughes <enh@google.com> Merge "Simple tests for dladdr(3)."
91875dcd6e17b7f3b251efe9b236b905ef414dde 25-Sep-2012 Elliott Hughes <enh@google.com> Fix tmpfile(3).

This could be better, but at least now it works.

Change-Id: I88b7cf3f7ce8e5fa0b3fe678b7d1679a68ffffc9
ndroid.mk
tdio_test.cpp
8e15b08ae22a5230c1fea4779410de0420fa939c 26-Sep-2012 Elliott Hughes <enh@google.com> Simple tests for dladdr(3).

Change-Id: I22160b7fc9b950ea19adb6da42af2f893f4fe5d5
lopen_test.cpp
8a05a01de75d78a45d646115b20b2a3e3c12ba9e 13-Sep-2012 Kenny Root <kroot@google.com> Print out shared app gids correctly

For applications that share resources across users such as
forward-locked applications, print out their group name correctly.

Change-Id: I06ee0b67e4325cfa415ffd7a03e301700399a66d
tubs_test.cpp
2a54e5ecd0a96398e8d7d9b1629ecf8fb1633a2b 13-Sep-2012 Kenny Root <kroot@google.com> Add tests for Android-specific stubs

Also fix problem with multi-user IDs that the home directory was
returned as "/data" instead of "/" unlike all the other uids.

Change-Id: I914d22052e5a86552989f8969b85aadbc748c65d
ndroid.mk
tubs_test.cpp
fa36875df423af968d053c584c0de18a2448516b 14-Sep-2012 Elliott Hughes <enh@google.com> Merge "Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3)."
b5f053b5a7deb084e7a052d527e0aa41339ae05c 08-Sep-2012 Irina Tirdea <irina.tirdea@intel.com> Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).

Change-Id: I426109db25e907980d6cb3a7a695796e45783b78
ndroid.mk
tring_test.cpp
38bfa21695b19c21784d2074de30d5d102f08972 13-Sep-2012 Elliott Hughes <enh@google.com> Fix Mac build.

Change-Id: Id625806fab0f2f7f90f9508c5fce649afe970414
ndroid.mk
acf5aa76a56f101607aeb8e6d1fbea24d0d4f68c 13-Sep-2012 jeffhao <jeffhao@google.com> Added new test for dlopen which is failing for MIPS.

Change-Id: I2240faefb387a11647f49b1a15699907a40f98c1
ndroid.mk
lopen_test.cpp
4d014e15b44d3e8d1b0189bc9bb7b0d0685e5af8 08-Sep-2012 Elliott Hughes <enh@google.com> Add more pthreads tests.

Someone reported a bug if pthread_detach is called while a pthread_join is
already in progress, but I'm unable to reproduce it. Keep the tests I wrote,
though.

Change-Id: I3d71450bbbb5345f2cb213dc56310ec020d528cc
thread_test.cpp
bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706 06-Sep-2012 Elliott Hughes <enh@google.com> Don't corrupt the thread list in static executables.

Several previous changes conspired to make a mess of the thread list
in static binaries. This was most obvious when trying to call
pthread_key_delete(3) on the main thread.

Bug: http://code.google.com/p/android/issues/detail?id=36893
Change-Id: I2a2f553114d8fb40533c481252b410c10656da2e
ndroid.mk
thread_test.cpp
2e8f4345dfe16e64d7a3c26f688f17f2b48b2dd1 05-Sep-2012 Elliott Hughes <enh@google.com> Add missing dependencies.

Change-Id: I53c1cfb59ac7a89952a8d6b906b2b9e16a66624f
ndroid.mk
5ac9eee1d3291a0d203a125849b4636a11c0d124 01-Sep-2012 Benoit Goby <benoit@android.com> bionic: Fix TINY_ANDROID build

(cherry-pick of 545d5dbbcb0dc9e44323c4f2e687a3aace75a483.)

Change-Id: Ifc91e84ffed5a3a287accabd7f08b02752688db6
ndroid.mk
7b841f3b4ad121dd64f639c1858b42defffd60bd 16-Aug-2012 Joe Onorato <joeo@google.com> Don't over-generalize makefiles. Host modules always build. This isn't needed on eng builds.

Change-Id: I5821ced7a8a9042fd2094204e07470d8002263ca
ndroid.mk
04a83a48ed89f433c78e31106ed50059764797a0 17-Aug-2012 Elliott Hughes <enh@google.com> Enhance getcwd(3) to handle NULL like glibc.

Bug: http://code.google.com/p/android/issues/detail?id=36085
Change-Id: I960a1b585887eb66176c61d29c5c61c239a4003f
ndroid.mk
etcwd_test.cpp
cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8 15-Aug-2012 Elliott Hughes <enh@google.com> Switch to the current NetBSD regex implementation.

Change-Id: If32b28dd85d6a7ab8957ab81d19fa4c0de9499d5
ndroid.mk
egex_test.cpp