linux – 什么是匿名的inode?
发布时间:2020-12-13 18:04:57 所属栏目:Linux 来源:网络整理
导读:我做了一个谷歌搜索关于“匿名inode”,它似乎与epoll相关…但实际上是什么? 解决方法 至少在某些上下文中,匿名inode是没有附加目录条目的inode.创建这样一个inode的最简单方法就是这样: int fd = open( "/tmp/file",O_CREAT | O_RDWR,0666 );unlink( "/tmp
我做了一个谷歌搜索关于“匿名inode”,它似乎与epoll相关…但实际上是什么?
解决方法
至少在某些上下文中,匿名inode是没有附加目录条目的inode.创建这样一个inode的最简单方法就是这样:
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. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |