aarch64: Use bitreverse rtl code instead of unspec [PR115176]
[official-gcc.git] / libgo / go / syscall / libcall_posix_utimesnano.go
blob374ad93575496b2a59c582855656bfc1c4ba9bf3
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 //go:build aix || darwin || dragonfly || freebsd || hurd || openbsd || netbsd || solaris
6 // +build aix darwin dragonfly freebsd hurd openbsd netbsd solaris
8 // General POSIX version of UtimesNano.
10 package syscall
12 import "unsafe"
14 func UtimesNano(path string, ts []Timespec) error {
15 // TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it
16 // isn't supported by darwin so this uses utimes instead
17 if len(ts) != 2 {
18 return EINVAL
20 // Not as efficient as it could be because Timespec and
21 // Timeval have different types in the different OSes
22 tv := [2]Timeval{
23 NsecToTimeval(TimespecToNsec(ts[0])),
24 NsecToTimeval(TimespecToNsec(ts[1])),
26 return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))