diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-08-26 01:40:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 13:40:29 -0400 |
commit | d0ccab7fb7dd80030d3765ca9a9af44de6ecda5a (patch) | |
tree | 10e36582bd5d099589c126bc0c0ef067bef2da5b /std | |
parent | f7174267e3e521636cd4abebbecd107d7079a313 (diff) |
fix(std/wasi): return flags from fd_fdstat_get (#7112)
Diffstat (limited to 'std')
-rw-r--r-- | std/wasi/snapshot_preview1.ts | 8 | ||||
m--------- | std/wasi/testdata | 0 |
2 files changed, 6 insertions, 2 deletions
diff --git a/std/wasi/snapshot_preview1.ts b/std/wasi/snapshot_preview1.ts index 233596cd4..f51eee3c6 100644 --- a/std/wasi/snapshot_preview1.ts +++ b/std/wasi/snapshot_preview1.ts @@ -307,14 +307,17 @@ export default class Context { this.fds = [ { + fdflags: FDFLAGS_APPEND, type: FILETYPE_CHARACTER_DEVICE, handle: Deno.stdin, }, { + fdflags: FDFLAGS_APPEND, type: FILETYPE_CHARACTER_DEVICE, handle: Deno.stdout, }, { + fdflags: FDFLAGS_APPEND, type: FILETYPE_CHARACTER_DEVICE, handle: Deno.stderr, }, @@ -521,7 +524,7 @@ export default class Context { const view = new DataView(this.memory.buffer); view.setUint8(stat_out, entry.type); - view.setUint16(stat_out + 4, 0, true); // TODO + view.setUint16(stat_out + 2, entry.fdflags, true); view.setBigUint64(stat_out + 8, 0n, true); // TODO view.setBigUint64(stat_out + 16, 0n, true); // TODO @@ -1155,9 +1158,9 @@ export default class Context { // directory this way so there's no native fstat but Deno.open // doesn't work with directories on windows so we'll have to work // around it for now. - const entries = Array.from(Deno.readDirSync(path)); const opened_fd = this.fds.push({ + fdflags, entries, path, }) - 1; @@ -1237,6 +1240,7 @@ export default class Context { const handle = Deno.openSync(path, options); const opened_fd = this.fds.push({ + fdflags, handle, path, }) - 1; diff --git a/std/wasi/testdata b/std/wasi/testdata -Subproject 419874edc0dd334df55760ba626ecc94a1df7cc +Subproject bbdc8e545d2e96aad747b0b20e4cf140690899d |