ArvernOS
Loading...
Searching...
No Matches
proc.h File Reference
#include <fs/vfs.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for proc.h:

Functions

int proc_fs_init ()
inode_t proc_fs_create_readonly_file (const char *name, proc_read_t *read_fn)
size_t proc_copy_out (char *buf, size_t size, uint64_t offset, const char *src, size_t len)

Function Documentation

◆ proc_copy_out()

size_t proc_copy_out ( char * buf,
size_t size,
uint64_t offset,
const char * src,
size_t len )

Copies a slice of the source string into the destination buffer.

The slice starts at offset. At most size - 1 bytes are copied and the result is always NUL-terminated. If offset is past the end of the source string, the destination buffer is set to an empty string.

Parameters
bufdestination buffer
sizesize of the destination buffer in bytes
offsetbyte offset into the source string
srcsource string
lenlength of the source string in bytes
Returns
the number of bytes copied

◆ proc_fs_create_readonly_file()

inode_t proc_fs_create_readonly_file ( const char * name,
proc_read_t * read_fn )
Todo
We probably want a specific driver for read-only pseudo-files.

◆ proc_fs_init()

int proc_fs_init ( )

Initializes the "proc" file system.

The "proc" file system exposes kernel information using files.

Returns
0 on success