23typedef struct file_table
#define CONFIG_MAX_FD
Maximum file descriptor configuration.
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_close(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.
void file_table_close_mode(file_table_t *table, mode_t mode)
Close all files in the file table with the specified mode.
uint64_t file_table_close_range(file_table_t *table, fd_t min, fd_t max)
Free a range of file descriptors.
fd_t file_table_open(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.
fd_t file_table_dup(file_table_t *table, fd_t oldFd)
Duplicate a file descriptor.
mode_t
Path flags and permissions.
__UINT64_TYPE__ fd_t
File descriptor type.
BITMAP_DEFINE(bitmap, CONFIG_MAX_FD)
A simple ticket lock implementation.