⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proc_fs.h.txt

📁 linux内核学习笔记 希望想看的人可以很快下载到
💻 TXT
字号:
这个头文件中存储了大部分的proc文件系统的调用函数。
这些函数的实现在fs/proc目录下。


#ifdef CONFIG_PROC_FS
#endif

在头文件中有这样的定义,所以如果想使用这中间的所有的函数定义,请安如下的规则使用。

在程序文件的开头定义
#ifndef CONFIG_PROC_FS
#	ifdef CONFIG_PROC_FS
#endif

然后再使用,或者
#ifdef CONFIG_PROC_FS
	……
#endif

**************************基本数据结构******************************
struct proc_dir_entry {
        unsigned short low_ino;
	unsigned short namelen;		//proc中的文件名长度
        const char *name;		//proc中的文件名
        mode_t mode;
        nlink_t nlink;
        uid_t uid;
        gid_t gid;
        unsigned long size;
        struct inode_operations * proc_iops;
        struct file_operations * proc_fops;
        get_info_t *get_info;
        struct module *owner;
        struct proc_dir_entry *next, *parent, *subdir;
        void *data;
        read_proc_t *read_proc;
        write_proc_t *write_proc;
        atomic_t count;         /* use count */
        int deleted;            /* delete flag */
        kdev_t  rdev;
};

********************************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -