From 917735c39ed7ee90f632763a16deea06e8b7aaa9 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 24 Mar 2015 13:06:41 +1100 Subject: [PATCH] Added documentation about the safe way to close a mapping. --- file_system.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_system.go b/file_system.go index 955e5f7..4e6256a 100644 --- a/file_system.go +++ b/file_system.go @@ -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