void vfs_ctx_deinit(vfs_ctx_t *ctx)
Deinitialize a VFS context.
fd_t vfs_ctx_set_fd(vfs_ctx_t *ctx, fd_t fd, file_t *file)
Allocate a specific file descriptor in a VFS context.
fd_t vfs_ctx_dup(vfs_ctx_t *ctx, fd_t oldFd)
Duplicate a file descriptor in a VFS context.
void vfs_ctx_init(vfs_ctx_t *ctx, const path_t *cwd)
Initialize a VFS context.
uint64_t vfs_ctx_get_cwd(vfs_ctx_t *ctx, path_t *outCwd)
fd_t vfs_ctx_alloc_fd(vfs_ctx_t *ctx, file_t *file)
Allocate a new file descriptor in a VFS context.
fd_t vfs_ctx_dup2(vfs_ctx_t *ctx, fd_t oldFd, fd_t newFd)
Duplicate a file descriptor in a VFS context to a specific file descriptor.
uint64_t vfs_ctx_free_fd(vfs_ctx_t *ctx, fd_t fd)
Free a file descriptor in a VFS context.
uint64_t vfs_ctx_set_cwd(vfs_ctx_t *ctx, const path_t *cwd)
Set the current working directory of a VFS context.
file_t * vfs_ctx_get_file(vfs_ctx_t *ctx, fd_t fd)
Get a file from a VFS context.
#define CONFIG_MAX_FD
Maximum file descriptor configuration.
#define BITMAP_BITS_TO_QWORDS(bits)
Convert number of bits to number of qwords.
__UINT64_TYPE__ fd_t
A file descriptor.
A simple ticket lock implementation.
bitmap_t allocBitmap
Bitmap tracking allocated file descriptors.
struct dir_entry dir_entry_t