|
ginnOS
The reference: libc, the libraries and the kernel
|
#include </home/runner/work/ginnOS-docs/ginnOS-docs/ginnOS/src/kernel/fs/fs.h>
Data Fields | |
| kerr_t(*) | open (fs_mount_t *mount, const char *path, fs_file_t *file) |
| kerr_t(*) | create (fs_mount_t *mount, const char *path) |
| kerr_t(*) | mkdir (fs_mount_t *mount, const char *path) |
| kerr_t(*) | remove (fs_mount_t *mount, const char *path) |
| kerr_t(*) | rmdir (fs_mount_t *mount, const char *path) |
| kerr_t(*) | rename (fs_mount_t *mount, const char *old_path, const char *new_path) |
| kerr_t(*) | stat (fs_mount_t *mount, const char *path, fs_stat_t *stat_out) |
| uint32_t(*) | read (fs_file_t *file, uint32_t byte_count, void *data_out) |
| uint32_t(*) | write (fs_file_t *file, uint32_t byte_count, const void *data_in) |
| kerr_t(*) | truncate (fs_file_t *file, uint64_t length) |
| kerr_t(*) | read_entry (fs_file_t *file, fs_dirent_t *entry_out) |
| kerr_t(*) | fstat (fs_file_t *file, fs_stat_t *stat_out) |
| kerr_t(*) | setattr (fs_file_t *file, const fs_attr_t *attr) |
| change the permission bits and/or owner of an open file (optional; NULL means the filesystem keeps no owners: KERR_PERM). | |
| void(*) | close (fs_file_t *file) |
| int32_t(*) | ioctl (fs_file_t *file, uint32_t request, void *arg) |
| device-control operation for a special file (optional; NULL means the filesystem supports no ioctls, i.e. | |
| int32_t(*) | mmap (fs_file_t *file, addr_space_t as, uintptr_t virt, size_t length, int prot, uint64_t offset) |
| map an open special file's memory into a process (optional; NULL means the file is not mappable, i.e. | |
| int64_t(*) | seek (fs_file_t *file, int64_t offset, int whence) |
| reposition an open file's cursor (optional). | |
| kerr_t(*) | find_link (fs_mount_t *mount, const char *path, bool follow_last, char *target, uint32_t size, uint32_t *end_out) |
| links (all optional; NULL means the filesystem has none). | |
| kerr_t(*) | readlink (fs_mount_t *mount, const char *path, char *target, uint32_t size) |
| kerr_t(*) | symlink (fs_mount_t *mount, const char *path, const char *target) |
| kerr_t(*) | link (fs_mount_t *mount, const char *old_path, const char *new_path) |
| kerr_t(*) | mknod (fs_mount_t *mount, const char *path, uint32_t mode, uint32_t rdev) |
| make a named pipe or a device node (optional: KERR_PERM). | |
| kerr_t(*) fs_ops_t::open(fs_mount_t *mount, const char *path, fs_file_t *file) |
| kerr_t(*) fs_ops_t::create(fs_mount_t *mount, const char *path) |
| kerr_t(*) fs_ops_t::mkdir(fs_mount_t *mount, const char *path) |
| kerr_t(*) fs_ops_t::remove(fs_mount_t *mount, const char *path) |
| kerr_t(*) fs_ops_t::rmdir(fs_mount_t *mount, const char *path) |
| kerr_t(*) fs_ops_t::rename(fs_mount_t *mount, const char *old_path, const char *new_path) |
| kerr_t(*) fs_ops_t::stat(fs_mount_t *mount, const char *path, fs_stat_t *stat_out) |
| kerr_t(*) fs_ops_t::read_entry(fs_file_t *file, fs_dirent_t *entry_out) |
change the permission bits and/or owner of an open file (optional; NULL means the filesystem keeps no owners: KERR_PERM).
device-control operation for a special file (optional; NULL means the filesystem supports no ioctls, i.e.
-ENOTTY). devfs forwards this to the backing device; disk filesystems like ext2 leave it NULL. returns 0 on success or a negative errno.
| int32_t(*) fs_ops_t::mmap(fs_file_t *file, addr_space_t as, uintptr_t virt, size_t length, int prot, uint64_t offset) |
map an open special file's memory into a process (optional; NULL means the file is not mappable, i.e.
-ENODEV). devfs forwards this to the backing device; disk filesystems leave it NULL. returns 0 or -errno.
reposition an open file's cursor (optional).
devfs implements this over its generic cursor; ext2 leaves it NULL and the syscall layer uses the ext2 file cursor directly. whence is SEEK_SET(0)/CUR(1)/END(2).
| kerr_t(*) fs_ops_t::find_link(fs_mount_t *mount, const char *path, bool follow_last, char *target, uint32_t size, uint32_t *end_out) |
links (all optional; NULL means the filesystem has none).
find_link reports the first symbolic link along a path (see ext2_find_link); readlink reads one's target; symlink makes one; link gives a file one more name.
| kerr_t(*) fs_ops_t::readlink(fs_mount_t *mount, const char *path, char *target, uint32_t size) |
| kerr_t(*) fs_ops_t::symlink(fs_mount_t *mount, const char *path, const char *target) |
| kerr_t(*) fs_ops_t::link(fs_mount_t *mount, const char *old_path, const char *new_path) |
| kerr_t(*) fs_ops_t::mknod(fs_mount_t *mount, const char *path, uint32_t mode, uint32_t rdev) |
make a named pipe or a device node (optional: KERR_PERM).
| mode | S_IFIFO, S_IFCHR or S_IFBLK with the permission bits. |
| rdev | a device node's number (DEVICE_NUMBER packing). |