函数 | |
DEFINE_SPINLOCK (procfsLock) | |
int | ProcMatch (unsigned int len, const char *name, struct ProcDirEntry *pn) |
static struct ProcDirEntry * | ProcFindNode (struct ProcDirEntry *parent, const char *name) |
struct ProcDirEntry * | ProcFindEntry (const char *path) |
static int | CheckProcName (const char *name, struct ProcDirEntry **parent, const char **lastName) |
检查 proc名称有效性 更多... | |
static struct ProcDirEntry * | ProcAllocNode (struct ProcDirEntry **parent, const char *name, mode_t mode) |
分配 proc 节点 更多... | |
static int | ProcAddNode (struct ProcDirEntry *parent, struct ProcDirEntry *pn) |
static void | ProcDetachNode (struct ProcDirEntry *pn) |
static struct ProcDirEntry * | ProcCreateDir (struct ProcDirEntry *parent, const char *name, const struct ProcFileOperations *procFileOps, mode_t mode) |
/proc文件系统创建目录的方式 更多... | |
static struct ProcDirEntry * | ProcCreateFile (struct ProcDirEntry *parent, const char *name, const struct ProcFileOperations *procFileOps, mode_t mode) |
创建文件项 更多... | |
struct ProcDirEntry * | CreateProcEntry (const char *name, mode_t mode, struct ProcDirEntry *parent) |
创建 pro (目录/文件)项 更多... | |
static void | FreeProcEntry (struct ProcDirEntry *entry) |
释放proc 更多... | |
void | ProcFreeEntry (struct ProcDirEntry *pn) |
释放 更多... | |
static void | RemoveProcEntryTravalsal (struct ProcDirEntry *pn) |
void | RemoveProcEntry (const char *name, struct ProcDirEntry *parent) |
remove a proc node 更多... | |
struct ProcDirEntry * | ProcMkdirMode (const char *name, mode_t mode, struct ProcDirEntry *parent) |
struct ProcDirEntry * | ProcMkdir (const char *name, struct ProcDirEntry *parent) |
create a proc directory node 更多... | |
struct ProcDirEntry * | ProcCreateData (const char *name, mode_t mode, struct ProcDirEntry *parent, const struct ProcFileOperations *procFileOps, void *data) |
创建数据 更多... | |
struct ProcDirEntry * | ProcCreate (const char *name, mode_t mode, struct ProcDirEntry *parent, const struct ProcFileOperations *procFileOps) |
create a proc node 更多... | |
int | ProcStat (const char *file, struct ProcStat *buf) |
static int | GetNextDir (struct ProcDirEntry *pn, void *buf, size_t len) |
int | ProcOpen (struct ProcFile *procFile) |
打开 pro 更多... | |
static int | ProcRead (struct ProcDirEntry *pde, char *buf, size_t len) |
struct ProcDirEntry * | OpenProcFile (const char *fileName, int flags,...) |
open a proc node 更多... | |
int | ReadProcFile (struct ProcDirEntry *pde, void *buf, size_t len) |
read a proc node 更多... | |
int | WriteProcFile (struct ProcDirEntry *pde, const void *buf, size_t len) |
写 proc 文件 更多... | |
loff_t | LseekProcFile (struct ProcDirEntry *pde, loff_t offset, int whence) |
seek proc 文件 更多... | |
int | LseekDirProcFile (struct ProcDirEntry *pde, off_t *pos, int whence) |
directory migration 更多... | |
int | CloseProcFile (struct ProcDirEntry *pde) |
close a proc node 更多... | |
struct ProcDirEntry * | GetProcRootEntry (void) |
变量 | |
bool | procfsInit = false |
static struct ProcFile | g_procPf |
static struct ProcDirEntry | g_procRootDirEntry |
|
static |
检查 proc名称有效性
在文件 proc_file.c 第 166 行定义.
int CloseProcFile | ( | struct ProcDirEntry * | pde | ) |
close a proc node
pde | [IN] Type #struct ProcDirEntry * pointer of the node structure to be closed |
#-1 | close failed |
#0 | close successfully |
在文件 proc_file.c 第 663 行定义.
struct ProcDirEntry * CreateProcEntry | ( | const char * | name, |
mode_t | mode, | ||
struct ProcDirEntry * | parent | ||
) |
创建 pro (目录/文件)项
create a proc node
在文件 proc_file.c 第 364 行定义.
DEFINE_SPINLOCK | ( | procfsLock | ) |
|
static |
|
static |
struct ProcDirEntry * GetProcRootEntry | ( | void | ) |
int LseekDirProcFile | ( | struct ProcDirEntry * | pde, |
off_t * | pos, | ||
int | whence | ||
) |
directory migration
pde | [IN] Type #struct ProcDirEntry * pointer of the node structure to be deviated |
pos | [IN] Type #off_t * the number of deviation |
whence | [IN] Type int the begin of deviation |
#EINVAL | deviation failed |
#ENOERR | deviation successfully |
在文件 proc_file.c 第 652 行定义.
loff_t LseekProcFile | ( | struct ProcDirEntry * | pde, |
loff_t | offset, | ||
int | whence | ||
) |
struct ProcDirEntry * OpenProcFile | ( | const char * | fileName, |
int | flags, | ||
... | |||
) |
open a proc node
fileName | [IN] Type #const char * the fileName of the node to be opened |
flags | [IN] Type int the flags of open's node |
#NULL | open failed |
#NOT | NULL open successfully |
在文件 proc_file.c 第 553 行定义.
|
static |
在文件 proc_file.c 第 261 行定义.
|
static |
分配 proc 节点
在文件 proc_file.c 第 202 行定义.
struct ProcDirEntry * ProcCreate | ( | const char * | name, |
mode_t | mode, | ||
struct ProcDirEntry * | parent, | ||
const struct ProcFileOperations * | procFops | ||
) |
create a proc node
name | [IN] Type #const char * The name of the node to be created. |
mode | [IN] Type mode_t the mode of create's node. |
parent | [IN] Type #struct ProcDirEntry * the parent node of the node to be created. |
procFops | [IN] Type #const struct ProcFileOperations * operation function of the node. |
#NULL | Create failed. |
#ProcDirEntry* | Create successfully. |
在文件 proc_file.c 第 457 行定义.
struct ProcDirEntry * ProcCreateData | ( | const char * | name, |
mode_t | mode, | ||
struct ProcDirEntry * | parent, | ||
const struct ProcFileOperations * | procFileOps, | ||
void * | data | ||
) |
创建数据
在文件 proc_file.c 第 444 行定义.
|
static |
/proc文件系统创建目录的方式
在文件 proc_file.c 第 319 行定义.
|
static |
|
static |
struct ProcDirEntry * ProcFindEntry | ( | const char * | path | ) |
|
static |
void ProcFreeEntry | ( | struct ProcDirEntry * | pn | ) |
int ProcMatch | ( | unsigned int | len, |
const char * | name, | ||
struct ProcDirEntry * | pn | ||
) |
struct ProcDirEntry * ProcMkdir | ( | const char * | name, |
struct ProcDirEntry * | parent | ||
) |
create a proc directory node
name | [IN] Type #const char * The name of the node directory to be created. |
parent | [IN] Type #struct ProcDirEntry * the parent node of the directory node to be created, if pass NULL, default parent node is "/proc". |
#NULL | Create failed. |
#ProcDirEntry* | Create successfully. |
在文件 proc_file.c 第 439 行定义.
struct ProcDirEntry * ProcMkdirMode | ( | const char * | name, |
mode_t | mode, | ||
struct ProcDirEntry * | parent | ||
) |
|
static |
在文件 proc_file.c 第 520 行定义.
int ReadProcFile | ( | struct ProcDirEntry * | pde, |
void * | buf, | ||
size_t | len | ||
) |
read a proc node
pde | [IN] Type #struct ProcDirEntry * pointer of the node structure to be read |
buf | [IN] Type void * user-provided to save the data |
len | [IN] Type size_t the length of want to read |
#-1 | read failed |
#>0 | Number of bytes read success |
在文件 proc_file.c 第 584 行定义.
void RemoveProcEntry | ( | const char * | name, |
struct ProcDirEntry * | parent | ||
) |
remove a proc node
name | [IN] Type #const char * The name of the node to be removed. |
parent | [IN] Type #struct ProcDirEntry * the parent node of the node to be remove. |
在文件 proc_file.c 第 405 行定义.
|
static |
int WriteProcFile | ( | struct ProcDirEntry * | pde, |
const void * | buf, | ||
size_t | len | ||
) |
写 proc 文件
write a proc node
在文件 proc_file.c 第 601 行定义.
|
static |
在文件 proc_file.c 第 46 行定义.
|
static |
在文件 proc_file.c 第 50 行定义.
bool procfsInit = false |
在文件 proc_file.c 第 44 行定义.