Date: Sat, 27 May 2000 12:09:01 -0700 From: Alfred Perlstein <bright@wintelcom.net> To: Trent Nelson <tpnelson@echidna.stu.cowan.edu.au> Cc: hackers@FreeBSD.ORG, dillon@backplane.com Subject: Re: Erroneous mmap() behaviour? Message-ID: <20000527120901.H28594@fw.wintelcom.net> In-Reply-To: <39300E44.558B632F@student.cowan.edu.au>; from tpnelson@echidna.stu.cowan.edu.au on Sun, May 28, 2000 at 02:04:52AM %2B0800 References: <39300E44.558B632F@student.cowan.edu.au>
next in thread | previous in thread | raw e-mail | index | archive | help
* Trent Nelson <tpnelson@echidna.stu.cowan.edu.au> [000527 11:44] wrote: > > Can someone explain to me why mmap() returns an address map you're > prohibited from accessing if the fd argument represents a file that has > just been created? > [snip incorrect use of mmap] > > Which is where my problem lies. > > Is it me, or mmap()? If it's me, is there any better way of doing what > I want to do? (which is essentially allocating memory to be modified, > then sync'd to a most probably newly-created file). > > From what I can see, the code works as it should in Linux. Linux is wrong. FreeBSD doesn't function as a crutch, you must use mmap() properly. You must use ftruncate() to extend the file before you try to write to an invalid area of the mmap(). -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." 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?20000527120901.H28594>