From 895138e65b90c3f20712b9c31690d84a6aa956ac Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 17 Jun 2023 23:41:41 +0200 Subject: libc: implement dirent.h --- src/user/lib/include/dirent.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/user/lib/include/dirent.h') diff --git a/src/user/lib/include/dirent.h b/src/user/lib/include/dirent.h index 35ba1e9..7c419d7 100644 --- a/src/user/lib/include/dirent.h +++ b/src/user/lib/include/dirent.h @@ -1,20 +1,16 @@ #pragma once -#include +#include -typedef struct DIR DIR; struct dirent { ino_t d_ino; char d_name[256]; /* NAME_MAX + 1 */ }; -static inline DIR *opendir(const char *name) { - __libc_panic("unimplemented"); -} +typedef struct { + FILE *fp; + struct dirent dent; +} DIR; -static inline int closedir(DIR *dir) { - __libc_panic("unimplemented"); -} - -static inline struct dirent *readdir(DIR *dir) { - __libc_panic("unimplemented"); -} +DIR *opendir(const char *name); +int closedir(DIR *dir); +struct dirent *readdir(DIR *dir); -- cgit v1.2.3