summaryrefslogtreecommitdiff
path: root/src/syscall/zsyscall_freebsd_386.go
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2017-08-11 16:49:01 +0200
committerIan Lance Taylor <iant@golang.org>2017-08-14 04:14:41 +0000
commit67c360594f1cdfa8e663bf5ff51724d3fc31abb9 (patch)
tree64e627cf79f98d770b07d3296de77c78bd27fcb3 /src/syscall/zsyscall_freebsd_386.go
parent6203a79b52a550f05511411a6c7bc3597381ee8e (diff)
downloadgo-git-67c360594f1cdfa8e663bf5ff51724d3fc31abb9.tar.gz
syscall: add utimensat and use it for UtimesNano on BSD and Solaris
All the BSDs and Solaris support the utimensat syscall, but Darwin doesn't. Account for that by adding the //sys lines not to syscall_bsd.go but the individual OS's syscall_*.go files and implement utimensat on Darwin as just returning ENOSYS, such that UtimesNano will fall back to use utimes as it currently does unconditionally. This also adds the previously missing utimensat syscall number for FreeBSD and Dragonfly. Fixes #16480 Change-Id: I367454c6168eb1f7150b988fa16cf02abff42f34 Reviewed-on: https://go-review.googlesource.com/55130 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/zsyscall_freebsd_386.go')
-rw-r--r--src/syscall/zsyscall_freebsd_386.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/syscall/zsyscall_freebsd_386.go b/src/syscall/zsyscall_freebsd_386.go
index 63061b2794..55fead990a 100644
--- a/src/syscall/zsyscall_freebsd_386.go
+++ b/src/syscall/zsyscall_freebsd_386.go
@@ -1308,3 +1308,18 @@ func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func utimensat(dirfd int, path string, times *[2]Timespec) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := Syscall(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}