src/internal/poll/fd_fsync_windows.go
raw| 1 | // Copyright 2018 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package poll |
| 6 | |
| 7 | import "syscall" |
| 8 | |
| 9 | // Fsync wraps syscall.Fsync. |
| 10 | func (fd *FD) Fsync() error { |
| 11 | if err := fd.incref(); err != nil { |
| 12 | return err |
| 13 | } |
| 14 | defer fd.decref() |
| 15 | return syscall.Fsync(fd.Sysfd) |
| 16 | } |