mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-12 06:11:03 -04:00
17 lines
315 B
Go
17 lines
315 B
Go
![]() |
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())
|
||
|
}
|