Files
wazero/internal/platform/futimens_unsupported.go
Crypt Keeper 4d90a5c364 platform: Allows sysfs to implement utimens natively (#1215)
platform: Allows sysfs to implement utimesns natively

This moves away from `syscall.UtimesNano` as it has intentionally
avoided common features in POSIX, such as handling UTIME_NOW and
UTIME_OMIT. When we eventually expose this API, users will be free to
override `UTIME_NOW` with a fake clock, possibly the same that was
supplied to wazero's `ModuleConfig`.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-03-09 13:14:09 +08:00

24 lines
634 B
Go

//go:build !windows && !linux && !darwin
package platform
import "syscall"
// Define values even if not used except as sentinels.
const (
_UTIME_NOW = -1
_UTIME_OMIT = -2
SupportsSymlinkNoFollow = false
)
func utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) error {
return utimensPortable(path, times, symlinkFollow)
}
func futimens(fd uintptr, times *[2]syscall.Timespec) error {
// Go exports syscall.Futimes, which is microsecond granularity, and
// WASI tests expect nanosecond. We don't yet have a way to invoke the
// futimens syscall portably.
return syscall.ENOSYS
}