PatchworkOS  c9fea19
A non-POSIX operating system.
Loading...
Searching...
No Matches
file_table.h File Reference
#include <kernel/config.h>
#include <kernel/fs/file.h>
#include <kernel/sync/lock.h>
#include <sys/bitmap.h>
Include dependency graph for file_table.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  file_table_t
 File table structure. More...
 

Functions

void file_table_init (file_table_t *table)
 Initialize a file table.
 
void file_table_deinit (file_table_t *table)
 Deinitialize a file table.
 
file_tfile_table_get (file_table_t *table, fd_t fd)
 Get a file from its file descriptor.
 
fd_t file_table_alloc (file_table_t *table, file_t *file)
 Allocate a new file descriptor for a file.
 
uint64_t file_table_free (file_table_t *table, fd_t fd)
 Free a file descriptor.
 
uint64_t file_table_free_range (file_table_t *table, fd_t min, fd_t max)
 Free a range of file descriptors.
 
fd_t file_table_set (file_table_t *table, fd_t fd, file_t *file)
 Set a specific file descriptor to a file.
 
fd_t file_table_dup (file_table_t *table, fd_t oldFd)
 Duplicate a file descriptor.
 
fd_t file_table_dup2 (file_table_t *table, fd_t oldFd, fd_t newFd)
 Duplicate a file descriptor to a specific file descriptor.
 
uint64_t file_table_copy (file_table_t *dest, file_table_t *src, fd_t min, fd_t max)
 Copy a file table, closing any overlapping file descriptors.
 
void file_table_close_all (file_table_t *table)
 Close all files in the file table.