Date: Sat, 21 Aug 1999 19:08:23 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: John-Mark Gurney <gurney_j@efn.org> Cc: Wes Peters <wes@softweyr.com>, hackers@FreeBSD.ORG Subject: Re: mmap mapped segment length Message-ID: <199908220208.TAA75507@apollo.backplane.com> References: <199908210906.CAA17706@salsa.gv.tsc.tdk.com> <37BF4C99.67814B7@softweyr.com> <19990821184246.00134@hydrogen.fircrest.net>
next in thread | previous in thread | raw e-mail | index | archive | help
:Wes Peters scribbled this message on Aug 21: :> Now I've got to go figure out what *I've* screwed up. I fstat the file before :> mapping it and pass S.st_size as the map length. Is there any reason why :> mmap would return non-NULL but map less than the requested size? : :no, there is NO reason why it wouldn't map the entire 50meg file... :I have used ffsrecov w/ a 1.8gig file where I fstat it and map the entire :file w/o a problem... : :also, mmap doesn't return NULL, it returns MAP_FAILED... : :the code for ffsrecov might give you some hints to make sure you aren't :doing anything wrong... : :-- : John-Mark Gurney Voice: +1 541 684 8449 : Cu Networking P.O. Box 5693, 97405 I would compile the program -Wall -Wstrict-prototypes. If you get warnings maybe the problem is that you've missed some important #include files. Many system calls take off_t arguments, including mmap, and without the correct prototype the compiler will not generate a good argument stack. mmap'ing a 50MB file definitely works. I run several databases which use mmap() that are several hundred megabytes in size. -Matt Matthew Dillon <dillon@backplane.com> 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?199908220208.TAA75507>