]> Cypherpunks repositories - gostls13.git/commit
syscall: use setattrlist for UtimesNano on Darwin for ns resolution
authorEvan Jones <ej@evanjones.ca>
Wed, 1 Nov 2017 16:44:14 +0000 (12:44 -0400)
committerIan Lance Taylor <iant@golang.org>
Wed, 1 Nov 2017 21:54:42 +0000 (21:54 +0000)
commiteb2b0ed5b59cfb340de0118235bfda60e0de4a8d
treebfdc161a6b6361d2996df7cf812d8bab3d55b523
parent86b7721ce3203ae002294f2c6027dfe48a968744
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>
src/syscall/syscall_bsd.go
src/syscall/syscall_darwin.go
src/syscall/syscall_dragonfly.go
src/syscall/syscall_freebsd.go
src/syscall/syscall_netbsd.go
src/syscall/syscall_openbsd.go