This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Patch: Initialise new file space to zero for Beos
- To: nickc at cygnus dot co dot uk
- Subject: Re: Patch: Initialise new file space to zero for Beos
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 18 Sep 1999 17:03:10 -0400
- CC: binutils at sourceware dot cygnus dot com
- References: <199909180943.KAA02222@pathia.cygnus.co.uk>
Date: Sat, 18 Sep 1999 10:43:14 +0100
From: Nick Clifton <nickc@cygnus.com>
Does anyone have any objections to my applying the following patch ?
It enhances bfd_seek() so that, for BeOS only, any newly created
file space is initialised to zero. The BeOS fseek function does not
do this automatically (unlike fseek on other OSes), and as a result
binary comparisons of identical files fail. This means that
bootstrapping under BeOS does not work.
My general attitude about this sort of patch is that BFD is not the
only Unix program which expects that an fseek past the end of a file
fills in the intervening space with zeroes. Therefore, I think that
patching BFD just fixes one case of the problem. The proper thing to
do is to fix the stdio library, or to otherwise provide a version of
fseek which does the right Unix-like thing.
So I don't think you should write your patch as a change to bfd_seek.
I think you should write a version of fseek which you put into
libiberty, and you should fix up the libiberty configuration to build
that version of fseek on BeOS. It may turn out to be convenient to
give it a different name, and to use an appropriate #define when
building BFD, which would be fine by me.
Ian