aboutsummaryrefslogtreecommitdiff
path: root/libc/stdio/stdio_ext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Modernize codebase by replacing NULL with nullptrYi Kong2018-08-021-1/+1
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
* Add __fseterr.Elliott Hughes2018-02-141-0/+4
| | | | | | | | | Trivial, obvious counterpart to the standard ferror(3) and clearerr(3), and lets us build bison out of the box. Bug: http://b/64273806 Test: ran tests Change-Id: I20affabddb71210051165c41e86adfe5ae04f77f
* Finish <stdio_ext.h>.Elliott Hughes2017-08-011-7/+3
| | | | | | | | | Implement __freading and __fwriting, and clarify the documentation that was the cause of these not being implemented for years. Bug: http://b/17157253 Test: ran tests Change-Id: I89542c8131b13889e2585417a024050ecf2abcb7
* Move libc_log code into libasync_safe.Christopher Ferris2017-05-031-2/+3
| | | | | | | | | | | | | | | | | | This library is used by a number of different libraries in the system. Make it easy for platform libraries to use this library and create an actual exported include file. Change the names of the functions to reflect the new name of the library. Run clang_format on the async_safe_log.cpp file since the formatting is all over the place. Bug: 31919199 Test: Compiled for angler/bullhead, and booted. Test: Ran bionic unit tests. Test: Ran the malloc debug tests. Change-Id: I8071bf690c17b0ea3bc8dc5749cdd5b6ad58478a
* More stdio cleanup.Elliott Hughes2016-07-291-21/+0
| | | | | | | Time to get back to cleaning up stdio, so start with a bunch of easy one-liners... Change-Id: I8df5fdc72500a89b977bfaa6c64c3639198d4e3e
* Make FILE*s less usable after fclose(3).Elliott Hughes2016-01-191-1/+8
| | | | | | | | | | | | 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
* Change _stdio_handles_locking into _caller_handles_locking.Yabin Cui2015-11-201-2/+2
| | | | | | | | | | | | | | | 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
* Add fileno_unlocked to support thread sanitizer.Yabin Cui2015-11-061-0/+4
| | | | | Bug: 25392375 Change-Id: If3f92a0e08a53f4b59e01397e8efa307d8572349
* Implement __fsetlocking.Elliott Hughes2015-01-211-10/+15
| | | | | | | | | | | | 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
* Add <stdio_ext.h> for elfutils.Elliott Hughes2014-08-201-0/+96
Bug: 17139679 Change-Id: I1605ac382dbb6f23b2d874dbb9769f3cde4a6a99