On Sun, 1 Dec 2002, Bart Oldeman wrote:

> Also many DOS programs assume that the program size is a "signed long
> int" (C) or "longint" (TP) so the 2GB--4GB region is a bit risky. I've
> just never tested it so I don't know.

Well, let's see:

POSIX.1 claims:

off_t lseek(int fildes, off_t offset, int whence)

and further:

off_t shall be a signed arithmetic type.

Now you can put everything together yourselves, when you know
sizeof(off_t) ;-)

However, the POSIX.1 rationale includes statements like this:
"The C Standard [aka ANSI-C] includes functions fgetpos() and fsetpos(),
 which work on very large files by use of a special positioning type."
-and-
"An invalid file offset [...] may be both implementation defined and
device dependent [...]. A negative file offset may be valid for some
devices in some implementations."
-and-
"See B.6.5.2 for a explanation of the use of signed and unsigned offsets
 with lseek()." But I can't find any references in there.

So, to deal with files beyond 2GB from within C is an "implementor
defined" issue.

The API function DOS-42 is a straight forward implementation of this
definition with sizeof(off_t) == 4.

There is DOS-71-A6 to retrieve the QWORD length of a file, but I haven't
found a QWORD-capable LSEEK API function in RBIL; despite the cludge using
DOS-6c-00 with "Extended Size" bit set in order to make negative positions
valid and mapping them to >2GB addresses.

Bye,

-- 

Steffen Kaiser

----------
list options/archives/etc.: http://www.topica.com/lists/fd-dev
unsubscribe: send blank email to: [EMAIL PROTECTED]

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bz8Rv5.bbRv4l.YXJjaGl2
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

Reply via email to