Added documentation about the safe way to close a mapping.

geesefs-0-30-9
Aaron Jacobs 2015-03-24 13:06:41 +11:00
parent 97c18fea3e
commit 917735c39e
1 changed files with 3 additions and 1 deletions

View File

@ -245,7 +245,9 @@ type FileSystem interface {
// Note that one potentially significant case where this is *not* called is
// munmap(2) (cf. http://goo.gl/j8B9g0). Even if users close(2) after writing
// to an mmap'd file, on OS X the contents are not immediately flushed (cf.
// https://github.com/osxfuse/osxfuse/issues/202).
// https://github.com/osxfuse/osxfuse/issues/202). On both Linux and OS X
// users can get safe behavior by calling msync(2), then munmap(2), then
// close(2).
//
// Because of cases like dup2(2), calls to FlushFile are not necessarily one
// to one with calls to OpenFile. They should not be used for reference