time_linux.go 315 B

12345678910111213141516
  1. package archive // import "github.com/docker/docker/pkg/archive"
  2. import (
  3. "syscall"
  4. "time"
  5. )
  6. func timeToTimespec(time time.Time) (ts syscall.Timespec) {
  7. if time.IsZero() {
  8. // Return UTIME_OMIT special value
  9. ts.Sec = 0
  10. ts.Nsec = (1 << 30) - 2
  11. return
  12. }
  13. return syscall.NsecToTimespec(time.UnixNano())
  14. }