7 opendir(const char* dir)
10 int fd = open(dir, O_RDONLY);
15 _dir = (DIR){ .dirfd = fd };
22 if (!dirp || dirp->dirfd == -1) {
23 // TODO migrate the status.h
27 int err = close(dirp->dirfd);
40 static struct dirent _dirent;
45 struct lx_dirent* _lxd = &dir->_lxd;
47 int more = sys_readdir(dir->dirfd, _lxd);
49 _dirent.d_type = _lxd->d_type;
50 strncpy(_dirent.d_name, _lxd->d_name, 256);