Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
fd.c
Go to the documentation of this file.
1#include "fd.h"
2#include "memory/kalloc.h"
3
5 struct fdtable* table = kalloc(sizeof(struct fdtable));
6 table->max_fds = INITIAL_MAX_FDS;
7 table->fds = (struct file_descriptor**)kalloc(
8 sizeof(struct file_descriptor*) * table->max_fds);
9 table->next_fd = 0;
10 return table;
11}
12
14 struct file_descriptor* fd = kalloc(sizeof(struct file_descriptor));
15 return fd;
16}
17
18
19void free_fdtable(struct fdtable* table) {
20 kfree2(table->fds);
22}
madt_record_table_entry_t table[]
Definition acpi.h:3
struct file_descriptor * alloc_fd()
Definition fd.c:13
struct fdtable * alloc_fdtable()
Definition fd.c:4
void free_fdtable(struct fdtable *table)
Definition fd.c:19
#define INITIAL_MAX_FDS
Definition fd.h:7
void * kalloc(size_t size)
void kfree2(void *ptr)
Definition fd.h:20