aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_openbsd.go
diff options
context:
space:
mode:
authorEvan Jones <ej@evanjones.ca>2017-11-01 12:44:14 -0400
committerIan Lance Taylor <iant@golang.org>2017-11-01 21:54:42 +0000
commiteb2b0ed5b59cfb340de0118235bfda60e0de4a8d (patch)
treebfdc161a6b6361d2996df7cf812d8bab3d55b523 /src/syscall/syscall_openbsd.go
parent86b7721ce3203ae002294f2c6027dfe48a968744 (diff)
downloadgo-eb2b0ed5b59cfb340de0118235bfda60e0de4a8d.tar.xz
syscall: use setattrlist for UtimesNano on Darwin for ns resolution
Mac OS X 10.13 introduced APFS which stores nanosecond resolution timestamps. The implementation of os.Stat already returns full resolution timestamps, but os.Chtimes only sets timestamps with microsecond resolution. Fix this by using setattrlist on Darwin, which takes a struct timeval with nanosecond resolution. This is what Mac OS X 10.13 appears uses to implement utimensat, according to dtruss. Fixes #22528 Change-Id: I397dabef6b2b73a081382999aa4c4405ab8c6015 Reviewed-on: https://go-review.googlesource.com/74952 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/syscall_openbsd.go')
-rw-r--r--src/syscall/syscall_openbsd.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/syscall/syscall_openbsd.go b/src/syscall/syscall_openbsd.go
index 7ac8b2d040..a43d88bf7a 100644
--- a/src/syscall/syscall_openbsd.go
+++ b/src/syscall/syscall_openbsd.go
@@ -99,6 +99,11 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
return
}
+func setattrlistTimes(path string, times []Timespec) error {
+ // used on Darwin for UtimesNano
+ return ENOSYS
+}
+
/*
* Exposed directly
*/