|
PatchworkOS
3984a1d
A non-POSIX operating system.
|
Device Filesystem. More...
Device Filesystem.
The devfs is a virtual filesystem that provides access to devices and resources.
Data Structures | |
| struct | devfs_file_desc_t |
| Descriptor for batch file creation. More... | |
Macros | |
| #define | DEVFS_NAME "devfs" |
| The name of the device filesystem. | |
Functions | |
| void | devfs_init (void) |
| Initializes the devfs. | |
| dentry_t * | devfs_dir_new (dentry_t *parent, const char *name, const inode_ops_t *inodeOps, void *private) |
| Create a new directory inside a mounted devfs instance. | |
| dentry_t * | devfs_file_new (dentry_t *parent, const char *name, const inode_ops_t *inodeOps, const file_ops_t *fileOps, void *private) |
| Create a new file inside a mounted devfs instance. | |
| dentry_t * | devfs_symlink_new (dentry_t *parent, const char *name, const inode_ops_t *inodeOps, void *private) |
| Create a new symbolic link inside a mounted devfs instance. | |
| uint64_t | devfs_files_new (list_t *out, dentry_t *parent, const devfs_file_desc_t *descs) |
| Create multiple files in a devfs directory. | |
| void | devfs_files_free (list_t *files) |
Free all files in a list created by devfs_files_new(). | |
| #define DEVFS_NAME "devfs" |
| dentry_t * devfs_dir_new | ( | dentry_t * | parent, |
| const char * | name, | ||
| const inode_ops_t * | inodeOps, | ||
| void * | private | ||
| ) |
Create a new directory inside a mounted devfs instance.
| parent | The parent directory, if NULL then the root is used. |
| name | The name of the new directory. |
| inodeOps | The inode operations for the new directory, can be NULL. |
| private | Private data to store in the inode of the new directory, can be NULL. |
NULL and errno is set. Definition at line 86 of file devfs.c.
| dentry_t * devfs_file_new | ( | dentry_t * | parent, |
| const char * | name, | ||
| const inode_ops_t * | inodeOps, | ||
| const file_ops_t * | fileOps, | ||
| void * | private | ||
| ) |
Create a new file inside a mounted devfs instance.
| parent | The parent directory, if NULL then the root is used. |
| name | The name of the new file. |
| inodeOps | The inode operations for the new file, can be NULL. |
| fileOps | The file operations for the new file, can be NULL. |
| private | Private data to store in the inode of the new file, can be NULL. |
NULL and errno is set. Definition at line 125 of file devfs.c.
| dentry_t * devfs_symlink_new | ( | dentry_t * | parent, |
| const char * | name, | ||
| const inode_ops_t * | inodeOps, | ||
| void * | private | ||
| ) |
Create a new symbolic link inside a mounted devfs instance.
| parent | The parent directory, if NULL then the root is used. |
| name | The name of the new symbolic link. |
| inodeOps | The inode operations for the new symbolic link. |
| private | Private data to store in the inode of the new symbolic link, can be NULL. |
NULL and errno is set. Definition at line 165 of file devfs.c.
| uint64_t devfs_files_new | ( | list_t * | out, |
| dentry_t * | parent, | ||
| const devfs_file_desc_t * | descs | ||
| ) |
Create multiple files in a devfs directory.
| out | Output list to store created dentries, can be NULL. The dentries use the otherEntry list entry. |
| parent | The parent directory, if NULL then the root is used. |
| descs | Array of file descriptors, terminated by an entry with name == NULL. |
ERR and errno is set. Definition at line 199 of file devfs.c.
Free all files in a list created by devfs_files_new().
| files | The list of files to free. |
Definition at line 254 of file devfs.c.