@remix_labs/hub-client 2.3348.0-dev → 2.3350.0-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/miniwasi.js +12 -11
- package/package.json +1 -1
package/miniwasi.js
CHANGED
|
@@ -36,7 +36,7 @@ class MiniWASI {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
fd_seek(fd, offset_low, offset_high, whence, newOffset) {
|
|
39
|
-
|
|
39
|
+
return 70; // ESPIPE
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
clock_time_get(id, precision, time) {
|
|
@@ -66,8 +66,7 @@ class MiniWASI {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
poll_oneoff(in_, out, nsub) {
|
|
69
|
-
|
|
70
|
-
this.abort("unexpected poll_oneoff call");
|
|
69
|
+
return 58; // ENOTSUP
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
fd_write(fd, iov, iovcnt, pnum) {
|
|
@@ -115,8 +114,17 @@ class MiniWASI {
|
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
fd_fdstat_get(fd, buf) {
|
|
117
|
+
if (fd > 2) return 8; // EBADF
|
|
118
118
|
this.update();
|
|
119
|
-
|
|
119
|
+
// fdstat layout: fs_filetype(u8) + pad(1) + fs_flags(u16) + pad(4) + fs_rights_base(u64) + fs_rights_inheriting(u64)
|
|
120
|
+
const view = new DataView(this.memory.buffer);
|
|
121
|
+
view.setUint8(buf, 2); // FILETYPE_CHARACTER_DEVICE
|
|
122
|
+
view.setUint8(buf + 1, 0);
|
|
123
|
+
view.setUint16(buf + 2, 0, true);
|
|
124
|
+
view.setUint32(buf + 4, 0, true);
|
|
125
|
+
view.setBigUint64(buf + 8, 0n, true);
|
|
126
|
+
view.setBigUint64(buf + 16, 0n, true);
|
|
127
|
+
return 0;
|
|
120
128
|
}
|
|
121
129
|
|
|
122
130
|
args_sizes_get(ptr_count, ptr_sizes) {
|
|
@@ -171,13 +179,6 @@ class MiniWASI {
|
|
|
171
179
|
proc_exit(code) {
|
|
172
180
|
throw new ProcExit(code);
|
|
173
181
|
}
|
|
174
|
-
|
|
175
|
-
abort(msg) {
|
|
176
|
-
let e = new Error();
|
|
177
|
-
let stack = e.stack || "(no stack trace)";
|
|
178
|
-
console.error("WASM ABORT: %s at %s", msg, stack);
|
|
179
|
-
throw new WebAssembly.RuntimeError(msg);
|
|
180
|
-
}
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
class ProcExit extends Error {
|