2021-10-27 00:57:07 +00:00
|
|
|
//go:build darwin || freebsd || netbsd || openbsd
|
|
|
|
// +build darwin freebsd netbsd openbsd
|
|
|
|
|
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (l *logFile) createTime(stat os.FileInfo) time.Time {
|
|
|
|
stat_t := stat.Sys().(*syscall.Stat_t)
|
|
|
|
createTime := stat_t.Ctimespec
|
2022-01-14 17:25:32 +00:00
|
|
|
// Sec and Nsec are int32 in 32-bit architectures.
|
|
|
|
return time.Unix(int64(createTime.Sec), int64(createTime.Nsec)) //nolint:unconvert
|
2021-10-27 00:57:07 +00:00
|
|
|
}
|