lib: c: io: implement standard FILE and DIR interfaces

This commit is contained in:
2026-03-25 20:21:12 +00:00
parent b975256cb9
commit 96784f611f
21 changed files with 599 additions and 0 deletions
+20
View File
@@ -1,6 +1,8 @@
#ifndef DIRENT_H_
#define DIRENT_H_
#include <sys/types.h>
#define DT_UNKNOWN 0
#define DT_BLK 1
#define DT_CHR 2
@@ -10,4 +12,22 @@
#define DT_REG 6
#define DT_SOCK 7
struct dirent {
ino_t d_ino;
off_t d_off;
unsigned short d_reclen;
unsigned char d_type;
char d_name[256];
};
struct __opaque_dir;
typedef struct __opaque_dir DIR;
extern DIR *opendir(const char *name);
extern DIR *fdopendir(int fd);
extern int closedir(DIR *dirp);
extern struct dirent *readdir(DIR *dirp);
#endif