This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Avoid use of ftruncate() in libgcov
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Jul 2004 17:13:36 +0100
- Subject: Re: RFA: Avoid use of ftruncate() in libgcov
- Organization: Codesourcery LLC
- References: <87r7qw181b.fsf@redhat.com>
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