fs: implement readdir function

this also fixes flawed file parsing in ext2_open_file
This commit is contained in:
Michael Shaw 2023-10-20 00:50:53 -04:00
commit 0eb461410c
7 changed files with 292 additions and 67 deletions

View file

@ -8,6 +8,7 @@ static const char *errno_str[] = {
[ENOENT] = "No such file or directory",
[EINVAL] = "Invalid argument",
[EBADF] = "Bad file descriptor",
[ENOTDIR] = "Not a directory",
};
inline const char *strerror(int errnum)

View file

@ -138,6 +138,9 @@ char *strtok(char *str, const char *delim, char **llast)
(*llast)++;
}
if(!(*ret))
return NULL;
return ret;
}