github.com/dougm/docker@v1.5.0/pkg/system/utimes_linux.go (about)

     1  package system
     2  
     3  import (
     4  	"syscall"
     5  	"unsafe"
     6  )
     7  
     8  func LUtimesNano(path string, ts []syscall.Timespec) error {
     9  	// These are not currently available in syscall
    10  	AT_FDCWD := -100
    11  	AT_SYMLINK_NOFOLLOW := 0x100
    12  
    13  	var _path *byte
    14  	_path, err := syscall.BytePtrFromString(path)
    15  	if err != nil {
    16  		return err
    17  	}
    18  
    19  	if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(AT_FDCWD), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(AT_SYMLINK_NOFOLLOW), 0, 0); err != 0 && err != syscall.ENOSYS {
    20  		return err
    21  	}
    22  
    23  	return nil
    24  }
    25  
    26  func UtimesNano(path string, ts []syscall.Timespec) error {
    27  	return syscall.UtimesNano(path, ts)
    28  }