Go to the source code of this file.
|
| void | sysfs_init (void) |
| | Initializes the SysFS.
|
| |
| dentry_t * | sysfs_get_dev (void) |
| | Gets the default SysFS directory.
|
| |
| mount_t * | sysfs_mount_new (const path_t *parent, const char *name, namespace_t *ns, mount_flags_t flags, mode_t mode, const superblock_ops_t *superblockOps) |
| | Mount a new instance of SysFS.
|
| |
| dentry_t * | sysfs_dir_new (dentry_t *parent, const char *name, const inode_ops_t *inodeOps, void *private) |
| | Create a new directory inside a mounted SysFS instance.
|
| |
| dentry_t * | sysfs_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 SysFS instance.
|
| |
◆ SYSFS_NAME
| #define SYSFS_NAME "sysfs" |
◆ file_t
◆ file_ops_t
◆ superblock_t
◆ superblock_ops_t
◆ sysfs_init()
Initializes the SysFS.
Definition at line 82 of file sysfs.c.
◆ sysfs_get_dev()
Gets the default SysFS directory.
The default SysFS directory is the root of the /dev mount. The /dev directory is for devices or "other" resources which may not warrant an entire dedicated filesystem.
- Returns
- A reference to the
/dev SysFS directory.
Definition at line 99 of file sysfs.c.
◆ sysfs_mount_new()
Mount a new instance of SysFS.
Used to, for example, create /dev, /proc and directories whose contents should only be visible within a specific namespace.
If parent is NULL, then the sysfs instance will be mounted to a already existing directory in the root of the namespace. If it is not NULL, then it must point to a sysfs directory, a new directory of the name name will be created inside it and the SysFS instance will be mounted there.
- Parameters
-
| parent | The parent directory to mount the SysFS in. If NULL, the root of the namespace is used. |
| name | The name of the directory to mount the SysFS in. |
| ns | The namespace to mount the SysFS in, or NULL to use the current process's namespace. |
| flags | Mount flags. |
| mode | The maximum allowed permissions for files/directories opened under this mount. |
| superblockOps | The superblock operations for the new SysFS instance, can be NULL. |
- Returns
- On success, the mounted SysFS instance. On failure,
NULL and errno is set.
Definition at line 104 of file sysfs.c.
◆ sysfs_dir_new()
Create a new directory inside a mounted SysFS instance.
Used to, for example, create a new directory for a device or resource inside /dev or /proc.
- Parameters
-
| parent | The parent directory, if NULL then sysfs_get_dev() is used. |
| name | The name of the new directory. |
| inodeOps | The inode operations for the new directory, can be NULL. |
| private | Private data associated with the new directory, can be NULL, will be stored in the inode. |
- Returns
- On success, the new SysFS directory. On failure,
NULL and errno is set.
Definition at line 177 of file sysfs.c.
◆ sysfs_file_new()
Create a new file inside a mounted SysFS instance.
Used to, for example, create a new file for a device or resource inside /dev or /proc.
- Parameters
-
| parent | The parent directory, if NULL then sysfs_get_dev() 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 associated with the new file, can be NULL. |
- Returns
- On success, the new SysFS file. On failure,
NULL and errno is set.
Definition at line 216 of file sysfs.c.