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.


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...


typedef struct devfs devfs_t
 DevFS node typedef. More...


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


const vfs_file_system_t devfs_file_system
 DevFS file system driver. More...

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.

[in]nodeDevFS node to register
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.

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

Variable Documentation

◆ devfs_file_system

const vfs_file_system_t devfs_file_system

DevFS file system driver.

For use with vfs_mount