Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 1999 15:11:42 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        Wes Peters <wes@softweyr.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: mmap mapped segment length
Message-ID:  <19990821151142.07786@hydrogen.fircrest.net>
In-Reply-To: <37BE5F07.3F91A2B8@softweyr.com>; from Wes Peters on Sat, Aug 21, 1999 at 02:10:47AM -0600
References:  <37BE5F07.3F91A2B8@softweyr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Wes Peters scribbled this message on Aug 21:
> 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.

as w/ others I'm assuming the file is 50gigs and you can only use map
the first 4gigs...

> Is this intentional, or just an artifact of the implementation?  Is there any
> reason NOT to change this to an off_t?
> 
> Granted, I'm no VM hacker, but I'm willing to take a swing at it if there is
> any interest in putting it into the system.  Otherwise, I have a workaround
> that works just fine for this application.

I'm sure that you will find that if you try to map the first 4gigs of
the file that it will not fit into memory, and the mapping will fail..
do what you are suppose to do, map 2gigs or so of it (I've mapped 1.8gigs
w/o problems before on x86), work with it, then map the next 2gigs and
so on...  just use the offset to specify where in the file you want to
map...

-- 
  John-Mark Gurney                              Voice: +1 541 684 8449
  Cu Networking					  P.O. Box 5693, 97405

  "The soul contains in itself the event that shall presently befall it.
  The event is only the actualizing of its thought." -- Ralph Waldo Emerson


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?19990821151142.07786>