DaJiYuQia 27a97abd24
Patch procf (#90)
* 1234

* 123

* 合并master

* procfs

* 1

* procfs展示进程基本信息

* modified code

* 恢复权限

* 恢复权限

 #恢复权限

* modify permission

* 删除run.sh

* 解决第一次编译时磁盘镜像权限错误的问题

* 恢复.vscode/c_cpp_properties.json

* 删除process.c中错误的do_fork

* remake procfs

* 修改一些变量名

* 修改类型

* modified

* data_puts缓冲区溢出后return

Co-authored-by: longjin <longjin@RinGoTek.cn>
2022-11-26 17:34:00 +08:00

44 lines
725 B
C

#pragma once
#include <common/list.h>
#include <common/lockref.h>
#include <common/spinlock.h>
#include <common/stdio.h>
#include <common/stdlib.h>
#include <common/string.h>
#include <filesystem/VFS/VFS.h>
#include <process/process.h>
/**
* @brief 初始化procfs
*
*/
void procfs_init();
/**
* @brief proc文件系统的超级块信息结构体
*
*/
struct procfs_sb_info_t
{
struct lockref lockref; //该lockref包含自旋锁以及引用计数
};
/**
* @brief procfs文件系统的结点私有信息
*
*/
struct procfs_inode_info_t
{
long pid;
int type;
};
/**
* @brief 创建进程对应文件
*
* @param pid 进程号
* @return int64_t 错误码
*/
int64_t procfs_register_pid(long pid);