Skip to content
Snippets Groups Projects
Commit 31d3b9f4 authored by Avi Kivity's avatar Avi Kivity
Browse files

fd: implement close()

parent 91d79a1a
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,15 @@ int open(const char* fname, int mode, ...)
});
}
int close(int fd)
{
if (fd < 0 || unsigned(fd) >= file_table.size()) {
return libc_error(EBADF);
}
file_table[fd].reset();
return 0;
}
std::shared_ptr<file_desc> get_fd(int fd)
{
if (fd < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment