Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 1999 02:06:23 -0700
From:      Don Lewis <Don.Lewis@tsc.tdk.com>
To:        Wes Peters <wes@softweyr.com>, hackers@FreeBSD.ORG
Subject:   Re: mmap mapped segment length
Message-ID:  <199908210906.CAA17706@salsa.gv.tsc.tdk.com>
In-Reply-To: Wes Peters <wes@softweyr.com> "mmap mapped segment length" (Aug 21,  2:10am)

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 21,  2:10am, Wes Peters wrote:
} Subject: mmap mapped segment length
} I discovered to my dismay today that the length field in the mmap call is
} a size_t, not an off_t.  I was attempting to process a large (~50 MByte) file
} and found I was only processing the first 4 MBytes of it.

50 MB should comfortably fit in a size_t.

} Is this intentional, or just an artifact of the implementation?  Is there any
} reason NOT to change this to an off_t?

The type of size_t is supposed to be large enough to express the length of
any object that will fit in the virtual address space of a process.  Since
a size_t is 32 bits on an i386 and pointers are also 32 bits, there wouldn't
be any advantage to changing mmap() to use a 64 bit wide length parameter,
since you wouldn't be able to access all of such a large object.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908210906.CAA17706>