Class OpenFileMap

Class Documentation

class gkfs::filemap::OpenFileMap

Public Functions

OpenFileMap()
std::shared_ptr<OpenFile> get(int fd)
std::shared_ptr<OpenDir> get_dir(int dirfd)
bool exist(int fd)
int add(std::shared_ptr<OpenFile>)
bool remove(int fd)
int dup(int oldfd)
int dup2(int oldfd, int newfd)
int generate_fd_idx()

Generate new file descriptor index to be used as an fd within one process

Returns

fd_idx

int get_fd_idx()

Private Functions

int safe_generate_fd_idx_()

Private Members

std::map<int, std::shared_ptr<OpenFile>> files_
std::recursive_mutex files_mutex_
int fd_idx
std::mutex fd_idx_mutex
std::atomic<bool> fd_validation_needed