1 #pragma once
2 
3 #include <common/list.h>
4 #include <common/lockref.h>
5 #include <common/spinlock.h>
6 #include <common/stdio.h>
7 #include <common/stdlib.h>
8 #include <common/string.h>
9 #include <filesystem/vfs/VFS.h>
10 #include <process/process.h>
11 
12 /**
13  * @brief 初始化procfs
14  *
15  */
16 void procfs_init();
17 
18 /**
19  * @brief proc文件系统的超级块信息结构体
20  *
21  */
22 struct procfs_sb_info_t
23 {
24     struct lockref lockref; //该lockref包含自旋锁以及引用计数
25 };
26 
27 /**
28  * @brief procfs文件系统的结点私有信息
29  *
30  */
31 struct procfs_inode_info_t
32 {
33     long pid;
34     int type;
35 };
36 
37 /**
38  * @brief 创建进程对应文件
39  *
40  * @param pid 进程号
41  * @return int64_t 错误码
42  */
43 int64_t procfs_register_pid(long pid);
44