summaryrefslogtreecommitdiff
path: root/pkg/archive/time_linux.go
blob: 797143ee84d8f6a8fdc98c031871ec62655c8f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package archive // import "github.com/docker/docker/pkg/archive"

import (
	"syscall"
	"time"
)

func timeToTimespec(time time.Time) (ts syscall.Timespec) {
	if time.IsZero() {
		// Return UTIME_OMIT special value
		ts.Sec = 0
		ts.Nsec = (1 << 30) - 2
		return
	}
	return syscall.NsecToTimespec(time.UnixNano())
}