| 235 | } |
| 236 | |
| 237 | Directory::MaybeEntries Directory::Handle::getEntries() { |
| 238 | auto entries = getDir()->getEntries(); |
| 239 | if (entries.getError()) { |
| 240 | return entries; |
| 241 | } |
| 242 | auto& dcache = getDir()->dcache; |
| 243 | for (auto it = dcache.begin(); it != dcache.end(); ++it) { |
| 244 | auto& [name, entry] = *it; |
| 245 | if (entry.kind == DCacheKind::Mount) { |
| 246 | entries->push_back({name, entry.file->kind, entry.file->getIno()}); |
| 247 | } |
| 248 | } |
| 249 | return entries; |
| 250 | } |
| 251 | |
| 252 | } // namespace wasmfs |