summaryrefslogtreecommitdiff
path: root/src/user/lib/include/dirent.h
diff options
context:
space:
mode:
authordzwdz2023-06-17 23:41:41 +0200
committerdzwdz2023-06-17 23:41:41 +0200
commit895138e65b90c3f20712b9c31690d84a6aa956ac (patch)
treec3a840f5e41ffdc0fc7725eb839f502f55b01b64 /src/user/lib/include/dirent.h
parentb528a54a708c4cd2149c8e6884af2063c2b272cd (diff)
libc: implement dirent.h
Diffstat (limited to 'src/user/lib/include/dirent.h')
-rw-r--r--src/user/lib/include/dirent.h20
1 files changed, 8 insertions, 12 deletions
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 <bits/panic.h>
+#include <stdio.h>
-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);