|
PatchworkOS
966e257
A non-POSIX operating system.
|
Underlying type of a file descriptor. More...
Underlying type of a file descriptor.
A file is the underlying type of a file descriptor. Note that internally the kernel does not use file descriptors, they are simply a per-process handle to a file. The kernel uses files directly.
Data Structures | |
| struct | file_t |
| File structure. More... | |
| struct | file_ops_t |
| File operations structure. More... | |
| struct | poll_file_t |
| Structure for polling multiple files. More... | |
Functions | |
| file_t * | file_new (const path_t *path, mode_t mode) |
| Create a new file structure. | |
| uint64_t | file_generic_seek (file_t *file, int64_t offset, seek_origin_t origin) |
| Helper function for basic seeking. | |
Create a new file structure.
This does not open the file, instead its used internally by the VFS when opening files.
There is no file_free() instead use UNREF().
| path | The path of the file. |
| mode | The mode with which the file was opened, if no permissions are specified the maximum allowed permissions from the mount are used. |
NULL and errno is set to:EINVAL: Invalid parameters.EACCES: The requested mode exceeds the maximum allowed permissions.ENOENT: The dentry of the path is negative.EISDIR: The dentry of the path is a directory but mode does not specify MODE_DIRECTORY.ENOTDIR: The dentry of the path is a file but mode specifies MODE_DIRECTORY.ENOMEM: Out of memory. Definition at line 32 of file file.c.