code: func checkDeviceInode(fd int, path string) error {
  	var srcStat, dstStat unix.Stat_t
  	err := unix.Fstat(fd, &srcStat)
  	if err != nil {
  		return fmt.Errorf("error running fstat on subpath FD: %v", err)
  	}
  
  	err = unix.Stat(path, &dstStat)
  	if err != nil {
  		return fmt.Errorf("error running fstat on %s: %v", path, err)
  	}
  
  	if srcStat.Dev != dstStat.Dev {
  		return fmt.Errorf("different device number")
  	}
  	if srcStat.Ino != dstStat.Ino {
  		return fmt.Errorf("different inode")
  	}
  	return nil
  }
docs: // checkDeviceInode checks that opened file and path represent the same file.