+build darwin freebsd linux

package fs

import (
	

	
)

func ( string) (ModKey, error) {
	 := unix.Stat_t{}
	if  := unix.Stat(, &);  != nil {
		return ModKey{}, 
	}
We can't detect changes if the file system zeros out the modification time
	if .Mtim.Sec == 0 && .Mtim.Nsec == 0 {
		return ModKey{}, modKeyUnusable
	}
Don't generate a modification key if the file is too new
	,  := unix.TimeToTimespec(time.Now())
	if  != nil {
		return ModKey{}, 
	}
	 := .Mtim.Sec + modKeySafetyGap
	if  > .Sec || ( == .Sec && .Mtim.Nsec > .Nsec) {
		return ModKey{}, modKeyUnusable
	}

	return ModKey{
		inode:      .Ino,
		size:       .Size,
		mtime_sec:  int64(.Mtim.Sec),
		mtime_nsec: int64(.Mtim.Nsec),
		mode:       uint32(.Mode),
		uid:        .Uid,
	}, nil