//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris

package workspace

import (
	"os"
	"syscall"
)

// reviewWorkingFileInodeOS extracts the inode from a Unix FileInfo's
// syscall.Stat_t. Returns 0 if the FileInfo does not carry a Stat_t (which
// is the case for non-disk-backed files).
func reviewWorkingFileInodeOS(info os.FileInfo) uint64 {
	if stat, ok := info.Sys().(*syscall.Stat_t); ok {
		return uint64(stat.Ino)
	}
	return 0
}
