Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(StdLib): Sys/Socket #1590

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion stdlib/runtime/wasi.gr
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,31 @@ provide foreign wasm path_rename: (
WasmI32,
WasmI32,
WasmI32,
) => WasmI32 from "wasi_snapshot_preview1"
) -> WasmI32 from "wasi_snapshot_preview1"
import foreign wasm sock_accept: (
WasmI32,
WasmI32,
WasmI32
) -> WasmI32 from "wasi_snapshot_preview1";
import foreign wasm sock_recv: (
WasmI32,
WasmI32,
WasmI32,
WasmI32,
WasmI32,
WasmI32
) -> WasmI32 from "wasi_snapshot_preview1";
import foreign wasm sock_send: (
WasmI32,
WasmI32,
WasmI32,
WasmI32,
WasmI32
) -> WasmI32 from "wasi_snapshot_preview1";
import foreign wasm sock_shutdown: (
WasmI32,
WasmI32
) -> WasmI32 from "wasi_snapshot_preview1";

// clocks
provide let _CLOCK_REALTIME = 0n
Expand Down Expand Up @@ -245,6 +269,21 @@ provide let _FDFLAG_NONBLOCK = 4n
provide let _FDFLAG_RSYNC = 8n
provide let _FDFLAG_SYNC = 16n

// RiFlags
let _RIPEEK = 0n
let _RIWAITALL = 1n

// RoFlags
let _ROFDS_TRUNCATED = 0n
let _RODATA_TRUNCATED = 1n

// SdFlags
let _SDRD = 0n
let _SDWR = 1n

// SiFlags
let _SIDEFAULT = 0n

// whence
provide let _WHENCE_SET = 0n
provide let _WHENCE_CUR = 1n
Expand Down
Loading