[darcs-users] darcs patch: Handle empty files in mmapFilePS. Also cater for FD sh...

Eric Kow kowey at darcs.net
Wed Feb 4 21:15:25 UTC 2009

On Wed, Feb 04, 2009 at 21:58:37 +0100, Petr Rockai wrote:
> Here. To mmap a region of a file, you need to first open that file in an
> appropriate way. That is, the mmap system call takes a filedescriptor, not a
> path. You can't close the file as long as the mapping is active -- which it is
> as long, as the returned bytestring value is active -- its finalizer will call
> munmap (which is triggered by the GC figuring that the object is no longer
> reachable).

Oh! well, I think I understand that explanation.  Perhaps Don would
appreciate some sort of haddock patch laying this all out (or maybe
the kind of people who would try to use mmap understand this all
quite clearly already).  Barring that maybe a word or two belongs in
our code?

Anyway, applied, thanks!

Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090204/934d5fc4/attachment.pgp>

More information about the darcs-users mailing list