History log of /bionic/libc/stdio/fread.c
Revision Date Author Comments
7cc779f15c524e1622f7d5b1c7e82e6ffc6677fd 09-Feb-2017 George Burgess IV <gbiv@google.com> libc: add clang FORTIFY support

This patch adds clang-style FORTIFY to Bionic. For more information on
FORTIFY, please see https://goo.gl/8HS2dW . This implementation works
for versions of clang that don't support diagnose_if, so please see the
"without diagnose_if" sections. We plan to swap to a diagnose_if-based
FORTIFY later this year (since it doesn't really add any features; it
just simplifies the implementation a lot, and it gives us much prettier
diagnostics)

Bug: 32073964
Test: Builds on angler, bullhead, marlin, sailfish. Bionic CTS tests
pass on Angler and Bullhead.

Change-Id: I607aecbeee81529709b1eee7bef5b0836151eb2b
cc9ca1051dbf5bd2af1b801de13d43a399521cf9 28-Feb-2015 Christopher Ferris <cferris@google.com> Fix fread returning bad data.

Bug: 19172514
Change-Id: I05016577858a02aca7d14e75e6ec28abc925037c
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
e69e6458cca9adb9669850ac4055df38a20a70d1 21-Jan-2015 Elliott Hughes <enh@google.com> Fix signed/unsigned comparison that was upsetting clang.

bionic/libc/stdio/fread.c:86:27: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Werror,-Wsign-compare]

Change-Id: Ia7e1e053e0cb13113e8f2eede820be013acbab82
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
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
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
9d3c2dd11f5e796cd814cddc5b907494f859058e 18-Apr-2014 Elliott Hughes <enh@google.com> Switch to upstream OpenBSD fread/fvwrite.

Change-Id: I3dc11083693bc8d99edc0cbcc6f70dc9e5dc6565
f582340a6a48588aa50da17e1620e8f91b146941 12-Feb-2011 Kenny Root <kroot@google.com> Fix the handle locking in stdio

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

Based on OpenBSD change by guenther@openbsd.org
http://www.mail-archive.com/source-changes@cvs.openbsd.org/msg01015.html

Bug: 3446659
Change-Id: Ie82116e358c541718d6709ec45ca6796be5a007b
a910abcd194830d2d113b3e183eb7df4d36cd92e 31-Jan-2010 André Goddard Rosa <andre.goddard@gmail.com> improve readability of stdio: fix indentation and remove trailing spaces

Change-Id: Ic51e58a7c75d20bf770dc0ebd7f97a338fbe0036
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution