[erlang-questions] : efile_drv.c bug?

Lev Walkin vlm@REDACTED
Tue Jun 17 16:03:49 CEST 2008


Raimo Niskanen wrote:
> On Tue, Jun 17, 2008 at 04:19:41AM -0700, Lev Walkin wrote:
>> Jachym Holecek wrote:
>>> On Tue, 17 Jun 2008 12:16:52 +0200, Raimo Niskanen  
>>> <raimo+erlang-questions@REDACTED> wrote:
>>>> On Mon, Jun 16, 2008 at 01:10:15PM -0700, Darren New wrote:
>>>>> Any idea why Windows (XP/SP2/32bit) can't handle files >4G but Linux can
>>>>> with the same release? Is this something expected to get fixed  
>>>>> eventually?
>>>> If I recall correctly, file pointers (off_t) are signed in Windows
>>>> but there are extensions in Unix that use unsigned off_t but
>>>> ((off_t) -1) as an error return value, so it is possible on
>>>> many 32 bit Unixes to have almost 4GByte files, but 32 bit
>>>> Windows is stuck with its 2GByte limit.
>>>>
>>>> Someone correct me!?
>>> Upon quick inspection off_t seems to be int64_t on NetBSD and
>>> 'long int' on Linux. So it's signed on at least two Unices.
>>
>> Single Unix Specification version 3, IEEE Std 1003.1
>> specifies
>>
>> 	blkcnt_t and off_t shall be signed integer types.
>>
>> http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/types.h.html
> 
> Well, I am certain I have seen a largefile extension with unsigned
> 32 bit off_t. It was probably Solaris 6 (or 8 or 5).

I believe it might have been size_t, since signed off_t is used to
specify a negative seek in lseek(SEEK_{CUR,END}).

Anyway newer Solaris 10 headers contain signed off_t ILP32 and LP64 modes.

-- 
Lev Walkin
vlm@REDACTED



More information about the erlang-questions mailing list