什么是Linux中的匿名inode? [英] What is an anonymous inode in Linux?

查看:77
本文介绍了什么是Linux中的匿名inode?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google上搜索了有关匿名inode"的信息,看来它与epoll有关……但是实际上是什么呢?

I made a google search about "anonymous inode" and it seems it's related to epoll ... but what actually is it?

推荐答案

至少在某些情况下,匿名索引节点是没有附加目录条目的索引节点.创建此类inode的最简单方法如下:

At least in some contexts, an anonymous inode is an inode without an attached directory entry. The easiest way to create such an inode is as such:

int fd = open( "/tmp/file", O_CREAT | O_RDWR, 0666 );
unlink( "/tmp/file" );
// Note that the descriptor fd now points to an inode that has no filesystem entry; you
// can still write to it, fstat() it, etc. but you can't find it in the filesystem.

这篇关于什么是Linux中的匿名inode?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆