Oops, set MS_SYNC or Linux does nothing.

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

View File

@ -176,13 +176,14 @@ func dup2(oldfd int, newfd int) (err error) {
return return
} }
// Call msync(2) on a slice previously returned by mmap(2). // Call msync(2) with the MS_SYNC flag on a slice previously returned by
// mmap(2).
func msync(p []byte) (err error) { func msync(p []byte) (err error) {
_, _, errno := unix.Syscall( _, _, errno := unix.Syscall(
unix.SYS_MSYNC, unix.SYS_MSYNC,
uintptr(unsafe.Pointer(&p[0])), uintptr(unsafe.Pointer(&p[0])),
uintptr(len(p)), uintptr(len(p)),
0) unix.MS_SYNC)
if errno != 0 { if errno != 0 {
err = errno err = errno