MentOS  0.8.0
The Mentoring Operating System
procfs.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "process/process.h"
9 
11 typedef struct proc_dir_entry_t {
17  void *data;
19  const char *name;
21 
24 int procfs_module_init(void);
25 
28 int procfs_cleanup_module(void);
29 
34 proc_dir_entry_t *proc_dir_entry_get(const char *name, proc_dir_entry_t *parent);
35 
40 proc_dir_entry_t *proc_mkdir(const char *name, proc_dir_entry_t *parent);
41 
46 int proc_rmdir(const char *name, proc_dir_entry_t *parent);
47 
52 proc_dir_entry_t *proc_create_entry(const char *name, proc_dir_entry_t *parent);
53 
58 int proc_destroy_entry(const char *name, proc_dir_entry_t *parent);
59 
65 
70 
Process data structures and functions.
int proc_rmdir(const char *name, proc_dir_entry_t *parent)
Removes a directory from the procfs filesystem.
Definition: procfs.c:933
int procfs_module_init(void)
Initialize the procfs filesystem.
Definition: procfs.c:864
int proc_entry_set_mask(proc_dir_entry_t *entry, mode_t mask)
Sets the mask of a given procfs entry.
Definition: procfs.c:1025
proc_dir_entry_t * proc_create_entry(const char *name, proc_dir_entry_t *parent)
Creates a new entry inside the procfs filesystem.
Definition: procfs.c:969
struct proc_dir_entry_t proc_dir_entry_t
Stores information about a procfs directory entry.
proc_dir_entry_t * proc_dir_entry_get(const char *name, proc_dir_entry_t *parent)
Finds the direntry inside /proc or under the given parent.
Definition: procfs.c:890
int proc_destroy_entry(const char *name, proc_dir_entry_t *parent)
Removes an entry from the procfs filesystem.
Definition: procfs.c:994
int procfs_cleanup_module(void)
Clean up the procfs filesystem.
Definition: procfs.c:877
proc_dir_entry_t * proc_mkdir(const char *name, proc_dir_entry_t *parent)
Creates a new directory inside the procfs filesystem.
Definition: procfs.c:908
int procr_destroy_entry_pid(task_struct *entry)
Destroy the entire procfs entry tree for the give process.
Definition: proc_running.c:470
int procr_create_entry_pid(task_struct *entry)
Create the entire procfs entry tree for the give process.
Definition: proc_running.c:433
unsigned int mode_t
The type of mode.
Definition: stddef.h:49
Stores information about a procfs directory entry.
Definition: procfs.h:11
vfs_sys_operations_t * sys_operations
Generic system operations.
Definition: procfs.h:13
vfs_file_operations_t * fs_operations
Files operations.
Definition: procfs.h:15
const char * name
Name of the entry.
Definition: procfs.h:19
void * data
Data associated with the dir_entry.
Definition: procfs.h:17
this is our task object. Every process in the system has this, and it holds a lot of information....
Definition: process.h:82
Set of functions used to perform operations on files.
Definition: vfs_types.h:86
Set of functions used to perform operations on filesystem.
Definition: vfs_types.h:70