This forces all syscall functions, notably filesystem, to return numeric codes as opposed to mapping in two different areas. The result of this change is better consolidation in call sites of `sysfs.FS`, while further refactoring is needed to address consolidation of file errors. Signed-off-by: Adrian Cole <adrian@tetrate.io>
17 lines
262 B
Go
17 lines
262 B
Go
//go:build !linux
|
|
|
|
package platform
|
|
|
|
import (
|
|
"io/fs"
|
|
"syscall"
|
|
)
|
|
|
|
func fdatasync(f fs.File) syscall.Errno {
|
|
// Attempt to sync everything, even if we only need to sync the data.
|
|
if s, ok := f.(syncFile); ok {
|
|
return UnwrapOSError(s.Sync())
|
|
}
|
|
return 0
|
|
}
|