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
Nathan Sidwell <nathan@codesourcery.com> writes:
>> But why is that any worse than the other scenarios in which data
>> from one instance is lost? E.g.:
>> instanceA instanceB
>> open
>> discover mismatch
>> truncate
>> try to open --> fail, skip to next file
>> write data
>> close
>> which loses instanceB's data.
> I thought the second open blocks. It should do.
Yes, if you have F_SETLKW. We don't for newlib though, so I was getting
caught up on the fopen() version. I guess you're not trying to guarantee
freedom for race conditions for that though. Sigh.
...jedi hand wave...
Richard