Loading...
Searching...
No Matches
DevFS device file system

Dynamic device file system. More...

Detailed Description

Dynamic device file system.

This file system implementation allows devices to register file names for easier access to device drivers from shell commands etc.

The idea is similar to the /dev directory on Unix.

Files

file  random-vfs.h
 Random backends for devfs.
 
file  devfs.h
 DevFS public API.
 

Data Structures

struct  devfs
 A device "file" consists of a file name and an opaque pointer to device driver private data. More...
 

Typedefs

typedef struct devfs devfs_t
 DevFS node typedef.
 

Functions

int devfs_register (devfs_t *node)
 Register a node in DevFS.
 
int devfs_unregister (devfs_t *node)
 Remove a registration from DevFS.
 

Variables

const vfs_file_system_t devfs_file_system
 DevFS file system driver.
 

Typedef Documentation

◆ devfs_t

typedef struct devfs devfs_t

DevFS node typedef.

Definition at line 38 of file devfs.h.

Function Documentation

◆ devfs_register()

int devfs_register ( devfs_t node)

Register a node in DevFS.

The node will immediately become available to vfs_open, if DevFS is already mounted somewhere.

If DevFS is not mounted, the node will be registered and will become available to vfs_open when DevFS is mounted.

Parameters
[in]nodeDevFS node to register
Returns
0 on success
<0 on error

◆ devfs_unregister()

int devfs_unregister ( devfs_t node)

Remove a registration from DevFS.

The node will no longer be available to vfs_open, but any already opened FDs will remain open.

Parameters
[in]nodeDevFS node to unregister
Returns
0 on success
<0 on error

Variable Documentation

◆ devfs_file_system

const vfs_file_system_t devfs_file_system
extern

DevFS file system driver.

For use with vfs_mount