github.com/ttys3/engine@v17.12.1-ce-rc2+incompatible/pkg/system/init.go (about)

     1  package 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  }