2023-09-11 17:50:52 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
2023-09-01 09:23:31 +00:00
|
|
|
//go:build darwin || freebsd || netbsd || openbsd
|
|
|
|
|
|
|
|
package logging
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (l *LogFile) createTime(stat os.FileInfo) time.Time {
|
|
|
|
stat_t := stat.Sys().(*syscall.Stat_t)
|
|
|
|
createTime := stat_t.Ctimespec
|
2023-11-13 17:19:50 +00:00
|
|
|
return time.Unix(int64(createTime.Sec), int64(createTime.Nsec)) //nolint:unconvert
|
2023-09-01 09:23:31 +00:00
|
|
|
}
|