[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2Gig filesize limit problem....
On Mon, Nov 19, 2001 at 04:41:54PM +0200, guy keren wrote:
>
> On Mon, 19 Nov 2001, Yotam Rubin wrote:
>
> > On Mon, Nov 19, 2001 at 10:35:26AM +0200, Schlomo Schapiro wrote:
> > > That's what I mean. If you don't use 64bit variables you can't use the
> > > long file stuff because then you would try to use 32bit variables in 64bit
> > > functions.
> > >
> > > Or do the flags(__*) also change the internal type of longint ?
> >
> > It's all described in my previous message. The aforementioned flags change
> > the file handling interface, so fseeko for example is passed with a 64 bit
> > offset in a transparent manner. The user doesn't have to know anything about
> > the change. When I call fseek(somefile, 0xfff023, SEEK_SET) using the new
> > interface, the offset argument is 64 bits in size, not 32 bits. Obviously,
> > this is fully backwards compatible, since 64 bits may contain 32 bits.
>
> i think shlomo was refering to the fact that if you copy an off_t into an
> int or a long, and you try to use this '64-bit-hack' - then you'll get
> overflows and a non-working code.
>
> only if the code uses off_t _all over_ - will this trick work. if anywhere
> in the code you have:
>
> long offset = ftell(fd);
Yes. This is a very non-portable way of doing things. One should never assume
anything about the underlying data types, as it leads to non-portable code.
-- Yotam Rubin
P.S.: Please do not CC me when writing to the list. I am subscribed to all
the mailing lists I post to.
>
> --
> guy
>
> "For world domination - press 1,
> or dial 0, and please hold, for the creator." -- nob o. dy
>
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il