History log of /bionic/tests/stdio_ext_test.cpp
Revision Date Author Comments
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
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
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
2b021e10664c3938249eb18b48eeac253cbb3e20 20-Aug-2014 Elliott Hughes <enh@google.com> Add <stdio_ext.h> for elfutils.

Bug: 17139679
Change-Id: I1605ac382dbb6f23b2d874dbb9769f3cde4a6a99