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 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions stdlib/runtime/wasi.gr
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,30 @@ import foreign wasm path_rename: (
WasmI32,
WasmI32,
) -> 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
let _CLOCK_REALTIME = 0n
Expand Down Expand Up @@ -237,6 +261,21 @@ let _FDFLAG_NONBLOCK = 4n
let _FDFLAG_RSYNC = 8n
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
let _WHENCE_SET = 0n
let _WHENCE_CUR = 1n
Expand Down