Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jul 2005 18:39:29 -0400
From:      Garrett Wollman <wollman@csail.mit.edu>
To:        Giorgos Keramidas <keramida@FreeBSD.ORG>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: mmap bug?
Message-ID:  <17133.21281.703540.383144@khavrinen.csail.mit.edu>
In-Reply-To: <20050731201858.GC1052@gothmog.gr>
References:  <20050731141801.GA49300@gothmog.gr> <84dead7205073108564f71f1ab@mail.gmail.com> <20050731160853.GC49839@gothmog.gr> <84dead720507311115290f0140@mail.gmail.com> <20050731201858.GC1052@gothmog.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Sun, 31 Jul 2005 23:18:58 +0300, Giorgos Keramidas <keramida@FreeBSD.ORG> said:

> The bug seems to be elsewhere, namely to the fact that the filesystem
> code never realizes the file has changed size after I use mmap() to map
> a region beyond its current size and write past its current end.

You should not expect it to do that.  If you want to extend a file,
use ftruncate() before mapping it.  Anything written past the end of a
file should be discarded on last close.

-GAWollman




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