Linux FILE结构体
struct file {
…
atomic_t f_count; //文件的引用计数(有多少进程打开该文件)
unsigned int f_flags; //对应于open时指定的flag
mode_t f_mode; //读写模式:open的mod_t mode参数
off_t f_pos; //该文件在当前进程中的文件偏移量
unsigned int f_uid, f_gid; //文件所有者id,所有组id
const struct file_operations *f_op; //与该文件相关联的操作函数
…
};
查看方法:
打开:/usr/src/linux-headers-4.15.0-107/include/linux /fs.h
搜索:struct file {
详解参考博客:
linux中什么是文件结构体:
https://blog.csdn.net/hbcbgcx/article/details/88753877
文件I/O之-打开文件在内核中的表示:
https://blog.csdn.net/kangroger/article/details/38689369
2020/07/23 11:54
@luxurylu