func (n *Netns) inode() string {
	var stat unix.Stat_t

	err := unix.Fstat(int(n.Fd()), &stat)
	if err != nil {
		return "unknown"
	}

	return fmt.Sprintf("%d", stat.Ino)
}
示例#2
0
func getInodeFd(fd int) (uint64, error) {
	stat := &unix.Stat_t{}
	err := unix.Fstat(fd, stat)
	return stat.Ino, err
}
示例#3
0
文件: testhelpers.go 项目: aanm/cni
func GetInodeF(file *os.File) (uint64, error) {
	stat := &unix.Stat_t{}
	err := unix.Fstat(int(file.Fd()), stat)
	return stat.Ino, err
}