github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/system/init.go (about)

     1  package system // import "github.com/demonoid81/moby/pkg/system"
     2  
     3  import (
     4  	"syscall"
     5  	"time"
     6  	"unsafe"
     7  )
     8  
     9  // Used by chtimes
    10  var maxTime time.Time
    11  
    12  func init() {
    13  	// chtimes initialization
    14  	if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 {
    15  		// This is a 64 bit timespec
    16  		// os.Chtimes limits time to the following
    17  		maxTime = time.Unix(0, 1<<63-1)
    18  	} else {
    19  		// This is a 32 bit timespec
    20  		maxTime = time.Unix(1<<31-1, 0)
    21  	}
    22  }