use wasi
use runtime
-use core
use wasi {
IOVec, SubscriptionTagged, Subscription, Event, Size,
poll_oneoff, fd_write, fd_datasync, fd_read,
__runtime_initialize,
Multi_Threading_Enabled,
}
+use core {
+ __flush_stdio
+}
// Platform supports
package runtime.platform
use runtime
-use core
+use core {package, *}
use wasi
-use core
-
#if runtime.runtime != .Wasi {
#error "The file system library is currently only available on the WASI runtime, and should only be included if that is the chosen runtime."
}
out_entry.identifier = ~~dirent.d_ino;
out_entry.name_length = dirent.d_namlen;
memory.set(~~&out_entry.name_data, 0, 256);
- memory.copy(~~&out_entry.name_data, ~~(dirent + 1), math.min(dirent.d_namlen, sizeof typeof out_entry.name_data));
+ memory.copy(~~&out_entry.name_data, ~~(cast([&] wasi.DirEnt, dirent) + 1), math.min(dirent.d_namlen, sizeof typeof out_entry.name_data));
dir.last_cookie = dirent.d_next;
return true;