mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
069fdc8a08
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
[s390x] switch utsname from unsigned to signed
per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
24 lines
592 B
Go
24 lines
592 B
Go
package system
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// LUtimesNano is used to change access and modification time of the specified path.
|
|
// It's used for symbol link file because unix.UtimesNano doesn't support a NOFOLLOW flag atm.
|
|
func LUtimesNano(path string, ts []syscall.Timespec) error {
|
|
var _path *byte
|
|
_path, err := unix.BytePtrFromString(path)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if _, _, err := unix.Syscall(unix.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != unix.ENOSYS {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|