github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/internal/poll/fd_fsync_windows.go (about) 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 }