platform_system_core/logcat
Mark Salyzyn e9ade17418 liblogcat: introduce getopt_long_r
Resolve one of the threading issues by creating a private C++ified
copy of getopt_long_r that started out its life as the bionic
getopt_long, but is reentrant.  Adds a new state context for the
stderr stream called optstderr.  Utilize this new function in logcat.
Control opterr and optstderr to match liblogcat expectations.  Correct
and fortify const.

Alternative would be to lock around _all_ getopt callers.  This has
the advantage of requiring _no_ locks that could get in the way of
using liblogcat in a signal handler.  The log reader interface does
run the risk of incurring locks and heap allocations though, so there
is more work to be done for that final goal.

Test: gTest logcat-unit-tests
Bug: 35326290
Change-Id: Ibb1b374c55d357d5d7fa5ad00bfaf07ae0bc4ba5
2017-03-06 08:40:16 -08:00
..
include/log liblogcat: introduce getopt_long_r 2017-03-06 08:40:16 -08:00
tests liblogcat: measure performance 2017-02-22 16:06:24 -08:00
.clang-format logcat: Add coding style 2017-02-17 14:42:14 -08:00
Android.mk liblogcat: introduce getopt_long_r 2017-03-06 08:40:16 -08:00
event.logtags Add float support to binary event log. 2015-04-28 18:20:48 -07:00
getopt_long.cpp liblogcat: introduce getopt_long_r 2017-03-06 08:40:16 -08:00
logcat.cpp liblogcat: introduce getopt_long_r 2017-03-06 08:40:16 -08:00
logcat_main.cpp logcat: Create liblogcat 2017-02-17 14:42:14 -08:00
logcat_system.cpp liblogcat: add android_logcat_popen and android_logcat_system 2017-02-17 14:42:14 -08:00
logcatd.rc resolve merge conflicts of 5f6dbd9 to nyc-mr1-dev-plus-aosp 2016-08-08 13:10:35 -07:00
logpersist logcatd: fix up logpersist.cat to filter out signature file 2016-08-08 10:20:22 -07:00
MODULE_LICENSE_APACHE2
NOTICE