The semantics of `truncate'.
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sun Feb 25 20:16:00 GMT 2001
> From: Toon Moene <toon@moene.indiv.nluug.nl>
>
> > I would try calling fflush(stream)/ftruncate(fileno(stream)) where
> > "stream" is the open FILE* on the file in question.
>
> Thanks - can I assume `fileno' exists ? Or do I have to configure-test
> for both `ftruncate' and `fileno' ?
You only need to check for ftruncate, fileno is already used elsewhere
without checks.
If you don't find ftruncate, you can immediately fallback to the copy
route or you can instead try some other ways of ftruncating a file.
There is a public domain ftruncate implementation in gnu
fileutils/lib/ftruncate.c. Perhaps we could stick it in libiberty,
though that won't help you in libf2c. You'll need to provide a
fallback ftruncate.o in there too. But that's probably more effort
than its worth.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc
mailing list