This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Avoid use of ftruncate() in libgcov


Richard Sandiford wrote:
So... would it be OK to drop the use of ftruncate() and rely simply on
closing and reopening the file in w+ mode?  Patch below.  I've verified
that the truncation still works on i686-pc-linux-gnu after this patch.
closing and opening will break concurrent updates. (which I think manifests
on an enable-coverage bootstrap with -j<somenumber>).  An alternative to
ftruncate would be some kind of explicit STOP record in the file.  But I think
that's tricky given that there are some seek-to-end operations going on.

I wasn't entirely sure whether functions like __gcov_open() are considered
internal to libgcov or whether they're part of some external (stable?) API.
Since I couldn't see any user documentation of the libgcov functions, and
since it doesn't look like we install any header files associated with it,
I assumed the function was internal and could be changed.
Those are internal to libgcov.  The entire coverage API and file structure
is internal to a gcc release, but the file structure is designed to be
forward compatible.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]