summaryrefslogtreecommitdiff
path: root/pkg/ctime/ctime_linux.go
blob: bf3cd5752efe630e0514e92329b8f7f1a70cc3c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//go:build linux
// +build linux

package ctime

import (
	"os"
	"syscall"
	"time"
)

func created(fi os.FileInfo) time.Time {
	st := fi.Sys().(*syscall.Stat_t)
	//nolint:unconvert // need to type cast on some cpu architectures
	return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec))
}