Skip to content

Commit

Permalink
Use 'wasm_import_module' for LibWasi
Browse files Browse the repository at this point in the history
  • Loading branch information
lbguilherme committed Mar 26, 2022
1 parent 711a9ce commit 2af59c7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/crystal/system/wasi/lib_wasi.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@[Link(wasm_import_module: "wasi_snapshot_preview1")]
lib LibWasi
alias Fd = Int32
alias Size = UInt32
Expand Down Expand Up @@ -93,10 +94,10 @@ lib LibWasi
d_type : FileType
end

fun fd_prestat_get = __wasi_fd_prestat_get(fd : Fd, stat : Prestat*) : WasiError
fun fd_prestat_dir_name = __wasi_fd_prestat_dir_name(fd : Fd, path : UInt8*, len : Size) : WasiError
fun path_open = __wasi_path_open(fd : Fd, dirflags : LookupFlags, path : UInt8*, oflags : OpenFlags, fs_rights_base : Rights, fs_rights_inheriting : Rights, fdflags : FdFlags, ret : Fd*) : WasiError
fun fd_readdir = __wasi_fd_readdir(fd : Fd, buf : UInt8*, len : Size, cookie : UInt64, ret : Size*) : WasiError
fun fd_close = __wasi_fd_close(fd : Fd) : WasiError
fun random_get = __wasi_random_get(buf : UInt8*, len : Size) : WasiError
fun fd_prestat_get(fd : Fd, stat : Prestat*) : WasiError
fun fd_prestat_dir_name(fd : Fd, path : UInt8*, len : Size) : WasiError
fun path_open(fd : Fd, dirflags : LookupFlags, path : UInt8*, oflags : OpenFlags, fs_rights_base : Rights, fs_rights_inheriting : Rights, fdflags : FdFlags, ret : Fd*) : WasiError
fun fd_readdir(fd : Fd, buf : UInt8*, len : Size, cookie : UInt64, ret : Size*) : WasiError
fun fd_close(fd : Fd) : WasiError
fun random_get(buf : UInt8*, len : Size) : WasiError
end

0 comments on commit 2af59c7

Please sign in to comment.