23typedef struct file_table
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_free(file_table_t *table, fd_t fd)
Free a file descriptor.
file_t * file_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_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.
void file_table_init(file_table_t *table)
Initialize a file table.
fd_t file_table_set(file_table_t *table, fd_t fd, file_t *file)
Set a specific file descriptor to a file.
void file_table_deinit(file_table_t *table)
Deinitialize a file table.
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_dup(file_table_t *table, fd_t oldFd)
Duplicate a file descriptor.
#define CONFIG_MAX_FD
Maximum file descriptor configuration.
__UINT64_TYPE__ fd_t
A file descriptor.
static pmm_bitmap_t bitmap
BITMAP_DEFINE(bitmap, CONFIG_MAX_FD)
A simple ticket lock implementation.