linux - 什么是 Linux 中的匿名 inode?

标签 linux epoll inode

我在 google 上搜索了“anonymous 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.

关于linux - 什么是 Linux 中的匿名 inode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4508998/

相关文章:

linux - Crystalspace vs. Irrlicht vs......?

linux - 有多少长期存在的并发 TCP session 被认为是合理的?

linux - 移动并删除文件夹中所有匹配 grep 的文件

c - 如何修改Libevent中注册的事件?

c - 是否可以在每条指令后转储内存?

sockets - 单线程 NGINX 如何处理如此多的连接?

sockets - 在 child 中接收事件

directory - 如何获取文件 inode 的指针

linux - 在创建管道、fifo 或套接字时创建 inode