feat: add /proc/fd file to dump the pid/fd/path information

1, for users with privilege, display all users' fd info with the template "Pid  Fd  SysFd Path"
2, for normal user, display its own fd info with the template "Pid Fd Path"

close #I3WB5U

Signed-off-by: chenwei <chenwei26@huawei.com>
This commit is contained in:
chenwei
2021-06-20 11:36:52 +08:00
parent ca40c79761
commit 600dded31e
5 changed files with 201 additions and 0 deletions

View File

@@ -34,6 +34,10 @@
#include "los_task.h"
#ifdef LOSCFG_FS_VFS
#include "fs/fd_table.h"
#endif
#ifdef __cplusplus
#if __cplusplus
extern "C" {
@@ -68,6 +72,12 @@ extern BOOL LOS_CheckInGroups(UINT32 gid);
extern INT32 LOS_GetUserID(VOID);
extern INT32 LOS_GetGroupID(VOID);
extern INT32 LOS_GetUsedPIDList(UINT32 *pidList, INT32 pidMaxNum);
#ifdef LOSCFG_FS_VFS
struct fd_table_s *LOS_GetFdTable(UINT32 pid);
#endif
#ifdef __cplusplus
#if __cplusplus
}