Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
fd.h File Reference
#include "vfs/dentry.h"
#include <type.h>

Go to the source code of this file.

Data Structures

struct  file_descriptor
 
struct  fdtable
 

Macros

#define INITIAL_MAX_FDS   64
 

Functions

struct file_descriptor __attribute__ ((aligned(64)))
 
struct fdtablealloc_fdtable ()
 
void free_fdtable (struct fdtable *fdt)
 
struct file_descriptoralloc_fd ()
 
int realloc_fdtable (struct fdtable *fdt, uint32_t max_fds)
 

Variables

atomic_t count
 
struct fdtablefdt
 
void * ops
 
uint8_t mode
 
uint64_t pos
 
uint32_t flags
 
vnode_ptr_t vnode
 
struct fdtable __attribute__
 

Macro Definition Documentation

◆ INITIAL_MAX_FDS

#define INITIAL_MAX_FDS   64

Definition at line 7 of file fd.h.

Referenced by alloc_fdtable().

Function Documentation

◆ __attribute__()

struct file_descriptor __attribute__ ( (aligned(64)) )

Definition at line 1 of file core.h.

◆ alloc_fd()

struct file_descriptor * alloc_fd ( )

Definition at line 13 of file fd.c.

References kalloc().

Referenced by create_process().

◆ alloc_fdtable()

struct fdtable * alloc_fdtable ( )

Definition at line 4 of file fd.c.

References INITIAL_MAX_FDS, kalloc(), and table.

Referenced by create_process().

◆ free_fdtable()

void free_fdtable ( struct fdtable * fdt)

Definition at line 19 of file fd.c.

References kfree2(), and table.

◆ realloc_fdtable()

int realloc_fdtable ( struct fdtable * fdt,
uint32_t max_fds )

References fdt.

Variable Documentation

◆ __attribute__

struct fdtable __attribute__

◆ count

atomic_t count

Definition at line 0 of file fd.h.

◆ fdt

struct fdtable* fdt

Definition at line 1 of file fd.h.

Referenced by realloc_fdtable(), syscall_ioctl(), syscall_read(), syscall_write(), and syscall_writev().

◆ flags

uint32_t flags

Definition at line 5 of file fd.h.

◆ mode

uint8_t mode

Definition at line 3 of file fd.h.

Referenced by syscall_open().

◆ ops

void* ops

Definition at line 2 of file fd.h.

◆ pos

uint64_t pos

Definition at line 4 of file fd.h.

Referenced by cache_lookup(), delete_dentry(), and print_dentry_tree().

◆ vnode

vnode_ptr_t vnode

Definition at line 6 of file fd.h.