The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
file_ops_t Struct Reference

what a kind of file can do. More...

#include </home/runner/work/ginnOS-docs/ginnOS-docs/ginnOS/src/kernel/vfs/file.h>

Data Fields

int32_t(*) read (file_t *file, void *buf, uint32_t count)
int32_t(*) write (file_t *file, const void *buf, uint32_t count)
int64_t(*) seek (file_t *file, int64_t offset, int whence)
int32_t(*) ioctl (file_t *file, uint32_t request, void *arg)
int32_t(*) mmap (file_t *file, addr_space_t as, uintptr_t virt, size_t length, int prot, uint64_t offset)
int32_t(*) read_entry (file_t *file, fs_dirent_t *entry)
int32_t(*) truncate (file_t *file, uint64_t length)
int32_t(*) stat (file_t *file, struct kstat *st)
uint32_t(*) poll (file_t *file)
void(*) release (file_t *file)

Detailed Description

what a kind of file can do.

a NULL entry means the operation is not supported, and the file_* wrappers return the usual errno for that. every function returns a count or 0 on success, or a negative errno.

Field Documentation

◆ read

int32_t(*) file_ops_t::read(file_t *file, void *buf, uint32_t count)

◆ write

int32_t(*) file_ops_t::write(file_t *file, const void *buf, uint32_t count)

◆ seek

int64_t(*) file_ops_t::seek(file_t *file, int64_t offset, int whence)

◆ ioctl

int32_t(*) file_ops_t::ioctl(file_t *file, uint32_t request, void *arg)

◆ mmap

int32_t(*) file_ops_t::mmap(file_t *file, addr_space_t as, uintptr_t virt, size_t length, int prot, uint64_t offset)

◆ read_entry

int32_t(*) file_ops_t::read_entry(file_t *file, fs_dirent_t *entry)

◆ truncate

int32_t(*) file_ops_t::truncate(file_t *file, uint64_t length)

◆ stat

int32_t(*) file_ops_t::stat(file_t *file, struct kstat *st)

◆ poll

uint32_t(*) file_ops_t::poll(file_t *file)

◆ release

void(*) file_ops_t::release(file_t *file)

The documentation for this struct was generated from the following file: