@ai-ecoverse/slicc-kernel 1.26.3 → 1.26.5
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/README.md +1 -1
- package/dist/kernel-worker.js +64 -14
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +171 -195
- package/dist/node-process-worker.js.map +4 -4
- package/dist/node.js +64 -14
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +171 -195
- package/dist/process-worker.js.map +4 -4
- package/package.json +3 -3
|
@@ -369,13 +369,169 @@ var init_types = __esm({
|
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
|
|
372
|
+
// src/process/wasi/wasi-abi.ts
|
|
373
|
+
function wasiErrnoOf(code2) {
|
|
374
|
+
if (!code2) return E.IO;
|
|
375
|
+
const name = code2.startsWith("E") ? code2.slice(1) : code2;
|
|
376
|
+
if (name === "OPNOTSUPP") return E.NOTSUP;
|
|
377
|
+
if (name === "WOULDBLOCK") return E.AGAIN;
|
|
378
|
+
if (name === "NOMEDIUM") return E.NODEV;
|
|
379
|
+
return E[name] ?? E.IO;
|
|
380
|
+
}
|
|
381
|
+
var E, FILETYPE, RIGHTS, OFLAGS, FDFLAGS, LOOKUP_SYMLINK_FOLLOW, WHENCE, CLOCK, FSTFLAGS, EVENTTYPE, SUBCLOCK_ABSTIME, EVENT_FD_READWRITE_HANGUP, RIFLAGS, SDFLAGS, PREOPENTYPE_DIR, SIZE, WASI_SIGNAL_TO_POSIX;
|
|
382
|
+
var init_wasi_abi = __esm({
|
|
383
|
+
"src/process/wasi/wasi-abi.ts"() {
|
|
384
|
+
"use strict";
|
|
385
|
+
E = {
|
|
386
|
+
SUCCESS: 0,
|
|
387
|
+
"2BIG": 1,
|
|
388
|
+
ACCES: 2,
|
|
389
|
+
ADDRINUSE: 3,
|
|
390
|
+
ADDRNOTAVAIL: 4,
|
|
391
|
+
AFNOSUPPORT: 5,
|
|
392
|
+
AGAIN: 6,
|
|
393
|
+
ALREADY: 7,
|
|
394
|
+
BADF: 8,
|
|
395
|
+
BADMSG: 9,
|
|
396
|
+
BUSY: 10,
|
|
397
|
+
CANCELED: 11,
|
|
398
|
+
CHILD: 12,
|
|
399
|
+
CONNABORTED: 13,
|
|
400
|
+
CONNREFUSED: 14,
|
|
401
|
+
CONNRESET: 15,
|
|
402
|
+
DEADLK: 16,
|
|
403
|
+
DESTADDRREQ: 17,
|
|
404
|
+
DOM: 18,
|
|
405
|
+
DQUOT: 19,
|
|
406
|
+
EXIST: 20,
|
|
407
|
+
FAULT: 21,
|
|
408
|
+
FBIG: 22,
|
|
409
|
+
HOSTUNREACH: 23,
|
|
410
|
+
IDRM: 24,
|
|
411
|
+
ILSEQ: 25,
|
|
412
|
+
INPROGRESS: 26,
|
|
413
|
+
INTR: 27,
|
|
414
|
+
INVAL: 28,
|
|
415
|
+
IO: 29,
|
|
416
|
+
ISCONN: 30,
|
|
417
|
+
ISDIR: 31,
|
|
418
|
+
LOOP: 32,
|
|
419
|
+
MFILE: 33,
|
|
420
|
+
MLINK: 34,
|
|
421
|
+
MSGSIZE: 35,
|
|
422
|
+
MULTIHOP: 36,
|
|
423
|
+
NAMETOOLONG: 37,
|
|
424
|
+
NETDOWN: 38,
|
|
425
|
+
NETRESET: 39,
|
|
426
|
+
NETUNREACH: 40,
|
|
427
|
+
NFILE: 41,
|
|
428
|
+
NOBUFS: 42,
|
|
429
|
+
NODEV: 43,
|
|
430
|
+
NOENT: 44,
|
|
431
|
+
NOEXEC: 45,
|
|
432
|
+
NOLCK: 46,
|
|
433
|
+
NOLINK: 47,
|
|
434
|
+
NOMEM: 48,
|
|
435
|
+
NOMSG: 49,
|
|
436
|
+
NOPROTOOPT: 50,
|
|
437
|
+
NOSPC: 51,
|
|
438
|
+
NOSYS: 52,
|
|
439
|
+
NOTCONN: 53,
|
|
440
|
+
NOTDIR: 54,
|
|
441
|
+
NOTEMPTY: 55,
|
|
442
|
+
NOTRECOVERABLE: 56,
|
|
443
|
+
NOTSOCK: 57,
|
|
444
|
+
NOTSUP: 58,
|
|
445
|
+
NOTTY: 59,
|
|
446
|
+
NXIO: 60,
|
|
447
|
+
OVERFLOW: 61,
|
|
448
|
+
OWNERDEAD: 62,
|
|
449
|
+
PERM: 63,
|
|
450
|
+
PIPE: 64,
|
|
451
|
+
PROTO: 65,
|
|
452
|
+
PROTONOSUPPORT: 66,
|
|
453
|
+
PROTOTYPE: 67,
|
|
454
|
+
RANGE: 68,
|
|
455
|
+
ROFS: 69,
|
|
456
|
+
SPIPE: 70,
|
|
457
|
+
SRCH: 71,
|
|
458
|
+
STALE: 72,
|
|
459
|
+
TIMEDOUT: 73,
|
|
460
|
+
TXTBSY: 74,
|
|
461
|
+
XDEV: 75,
|
|
462
|
+
NOTCAPABLE: 76
|
|
463
|
+
};
|
|
464
|
+
FILETYPE = {
|
|
465
|
+
UNKNOWN: 0,
|
|
466
|
+
BLOCK_DEVICE: 1,
|
|
467
|
+
CHARACTER_DEVICE: 2,
|
|
468
|
+
DIRECTORY: 3,
|
|
469
|
+
REGULAR_FILE: 4,
|
|
470
|
+
SOCKET_DGRAM: 5,
|
|
471
|
+
SOCKET_STREAM: 6,
|
|
472
|
+
SYMBOLIC_LINK: 7
|
|
473
|
+
};
|
|
474
|
+
RIGHTS = {
|
|
475
|
+
FD_DATASYNC: 1n << 0n,
|
|
476
|
+
FD_READ: 1n << 1n,
|
|
477
|
+
FD_SEEK: 1n << 2n,
|
|
478
|
+
FD_FDSTAT_SET_FLAGS: 1n << 3n,
|
|
479
|
+
FD_SYNC: 1n << 4n,
|
|
480
|
+
FD_TELL: 1n << 5n,
|
|
481
|
+
FD_WRITE: 1n << 6n,
|
|
482
|
+
ALL: (1n << 30n) - 1n
|
|
483
|
+
};
|
|
484
|
+
OFLAGS = { CREAT: 1, DIRECTORY: 2, EXCL: 4, TRUNC: 8 };
|
|
485
|
+
FDFLAGS = { APPEND: 1, DSYNC: 2, NONBLOCK: 4, RSYNC: 8, SYNC: 16 };
|
|
486
|
+
LOOKUP_SYMLINK_FOLLOW = 1;
|
|
487
|
+
WHENCE = { SET: 0, CUR: 1, END: 2 };
|
|
488
|
+
CLOCK = { REALTIME: 0, MONOTONIC: 1, PROCESS_CPUTIME: 2, THREAD_CPUTIME: 3 };
|
|
489
|
+
FSTFLAGS = { ATIM: 1, ATIM_NOW: 2, MTIM: 4, MTIM_NOW: 8 };
|
|
490
|
+
EVENTTYPE = { CLOCK: 0, FD_READ: 1, FD_WRITE: 2 };
|
|
491
|
+
SUBCLOCK_ABSTIME = 1;
|
|
492
|
+
EVENT_FD_READWRITE_HANGUP = 1;
|
|
493
|
+
RIFLAGS = { PEEK: 1, WAITALL: 2 };
|
|
494
|
+
SDFLAGS = { RD: 1, WR: 2 };
|
|
495
|
+
PREOPENTYPE_DIR = 0;
|
|
496
|
+
SIZE = {
|
|
497
|
+
FILESTAT: 64,
|
|
498
|
+
FDSTAT: 24,
|
|
499
|
+
DIRENT: 24,
|
|
500
|
+
SUBSCRIPTION: 48,
|
|
501
|
+
EVENT: 32
|
|
502
|
+
};
|
|
503
|
+
WASI_SIGNAL_TO_POSIX = Object.fromEntries(
|
|
504
|
+
Array.from({ length: 30 }, (_, i) => [i + 1, i + 1 < 16 ? i + 1 : i + 2])
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// src/process/wasi-errno.ts
|
|
510
|
+
function wasiErrno(code2) {
|
|
511
|
+
return WASI_ERRNO[code2] ?? E.IO;
|
|
512
|
+
}
|
|
513
|
+
var WASI_ERRNO;
|
|
514
|
+
var init_wasi_errno = __esm({
|
|
515
|
+
"src/process/wasi-errno.ts"() {
|
|
516
|
+
"use strict";
|
|
517
|
+
init_wasi_abi();
|
|
518
|
+
WASI_ERRNO = {
|
|
519
|
+
...Object.fromEntries(Object.entries(E).map(([name, errno2]) => [`E${name}`, errno2])),
|
|
520
|
+
EWOULDBLOCK: E.AGAIN,
|
|
521
|
+
ENOTSUP: 138,
|
|
522
|
+
EOPNOTSUPP: 138,
|
|
523
|
+
ENOMEDIUM: 148
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
372
528
|
// src/realm/live-vfs-fs.ts
|
|
373
529
|
function toErrno(Fs, err) {
|
|
374
530
|
if (err?.errno !== void 0 && err instanceof Fs.ErrnoError) {
|
|
375
531
|
return err;
|
|
376
532
|
}
|
|
377
533
|
const code2 = err?.code;
|
|
378
|
-
const errno2 = typeof code2 === "string" ?
|
|
534
|
+
const errno2 = wasiErrno(typeof code2 === "string" ? code2 : "EIO");
|
|
379
535
|
return new Fs.ErrnoError(errno2);
|
|
380
536
|
}
|
|
381
537
|
function liveNodePath(node) {
|
|
@@ -410,7 +566,7 @@ function createHelpers(Fs, ops) {
|
|
|
410
566
|
try {
|
|
411
567
|
call2(fn);
|
|
412
568
|
} catch (err) {
|
|
413
|
-
if (err.errno !==
|
|
569
|
+
if (err.errno !== wasiErrno("ENOSYS")) throw err;
|
|
414
570
|
}
|
|
415
571
|
}
|
|
416
572
|
function freshState(stat) {
|
|
@@ -485,9 +641,9 @@ function createHelpers(Fs, ops) {
|
|
|
485
641
|
const s = node.live;
|
|
486
642
|
if (!s.orphan) {
|
|
487
643
|
const st = statOf(node);
|
|
488
|
-
if (st.readonly) throw new Fs.ErrnoError(
|
|
644
|
+
if (st.readonly) throw new Fs.ErrnoError(wasiErrno("EROFS"));
|
|
489
645
|
if (st.maxFile !== void 0 && size > st.maxFile) {
|
|
490
|
-
throw new Fs.ErrnoError(
|
|
646
|
+
throw new Fs.ErrnoError(wasiErrno("EFBIG"));
|
|
491
647
|
}
|
|
492
648
|
}
|
|
493
649
|
const ranged = s.openCount > 0 ? rangedOf(node) : void 0;
|
|
@@ -603,7 +759,7 @@ function createNodeOps(h) {
|
|
|
603
759
|
} else if (Fs.isFile(mode)) {
|
|
604
760
|
call2(() => bridgeOf(parent).writeFile(path, new Uint8Array(0)));
|
|
605
761
|
} else {
|
|
606
|
-
throw new Fs.ErrnoError(
|
|
762
|
+
throw new Fs.ErrnoError(wasiErrno("EPERM"));
|
|
607
763
|
}
|
|
608
764
|
const node = makeNode(parent, name, {
|
|
609
765
|
isFile: Fs.isFile(mode),
|
|
@@ -671,7 +827,7 @@ function createNodeOps(h) {
|
|
|
671
827
|
});
|
|
672
828
|
},
|
|
673
829
|
readlink(node) {
|
|
674
|
-
if (!Fs.isLink(node.mode)) throw new Fs.ErrnoError(
|
|
830
|
+
if (!Fs.isLink(node.mode)) throw new Fs.ErrnoError(wasiErrno("EINVAL"));
|
|
675
831
|
return call2(() => bridgeOf(node).readlink(liveNodePath(node)));
|
|
676
832
|
}
|
|
677
833
|
};
|
|
@@ -701,7 +857,7 @@ function createStreamOps(h) {
|
|
|
701
857
|
if ((stream.flags & 3) !== 0) {
|
|
702
858
|
try {
|
|
703
859
|
const st = statOf(stream.node);
|
|
704
|
-
if (st.readonly) throw new Fs.ErrnoError(
|
|
860
|
+
if (st.readonly) throw new Fs.ErrnoError(wasiErrno("EROFS"));
|
|
705
861
|
stream.node.live.maxFile = st.maxFile;
|
|
706
862
|
} catch (err) {
|
|
707
863
|
if (stream.fd !== void 0) Fs.closeStream?.(stream.fd);
|
|
@@ -738,7 +894,7 @@ function createStreamOps(h) {
|
|
|
738
894
|
},
|
|
739
895
|
read(stream, buffer, offset, length, position) {
|
|
740
896
|
const node = stream.node;
|
|
741
|
-
if (Fs.isDir(node.mode)) throw new Fs.ErrnoError(
|
|
897
|
+
if (Fs.isDir(node.mode)) throw new Fs.ErrnoError(wasiErrno("EISDIR"));
|
|
742
898
|
const ranged = rangedOf(node);
|
|
743
899
|
if (ranged) {
|
|
744
900
|
const out2 = new Uint8Array(buffer.buffer, buffer.byteOffset + offset, Math.max(0, length));
|
|
@@ -754,11 +910,11 @@ function createStreamOps(h) {
|
|
|
754
910
|
},
|
|
755
911
|
write(stream, buffer, offset, length, position) {
|
|
756
912
|
const node = stream.node;
|
|
757
|
-
if (Fs.isDir(node.mode)) throw new Fs.ErrnoError(
|
|
913
|
+
if (Fs.isDir(node.mode)) throw new Fs.ErrnoError(wasiErrno("EISDIR"));
|
|
758
914
|
if (length <= 0) return 0;
|
|
759
915
|
const s = node.live;
|
|
760
916
|
const end = position + length;
|
|
761
|
-
if (s.maxFile !== void 0 && end > s.maxFile) throw new Fs.ErrnoError(
|
|
917
|
+
if (s.maxFile !== void 0 && end > s.maxFile) throw new Fs.ErrnoError(wasiErrno("EFBIG"));
|
|
762
918
|
const ranged = rangedOf(node);
|
|
763
919
|
if (ranged) {
|
|
764
920
|
const bytes = new Uint8Array(buffer.buffer, buffer.byteOffset + offset, length);
|
|
@@ -781,7 +937,7 @@ function createStreamOps(h) {
|
|
|
781
937
|
const s = stream.node.live;
|
|
782
938
|
pos += rangedOf(stream.node)?.size() ?? (s.loaded ? s.len : statOf(stream.node).size);
|
|
783
939
|
}
|
|
784
|
-
if (pos < 0) throw new Fs.ErrnoError(
|
|
940
|
+
if (pos < 0) throw new Fs.ErrnoError(wasiErrno("EINVAL"));
|
|
785
941
|
return pos;
|
|
786
942
|
},
|
|
787
943
|
fsync(stream) {
|
|
@@ -803,7 +959,7 @@ function createLiveVfsPlugin(Fs) {
|
|
|
803
959
|
stream_ops: streamOps,
|
|
804
960
|
mount(mount) {
|
|
805
961
|
const st = h.call(() => mount.opts.bridge.stat(mount.opts.root));
|
|
806
|
-
if (!st.isDirectory) throw new Fs.ErrnoError(
|
|
962
|
+
if (!st.isDirectory) throw new Fs.ErrnoError(wasiErrno("ENOTDIR"));
|
|
807
963
|
const root = h.makeNode(null, "/", st);
|
|
808
964
|
mounts.add(mount);
|
|
809
965
|
return root;
|
|
@@ -961,41 +1117,17 @@ function guardRenames(Fs) {
|
|
|
961
1117
|
if (!rename || Fs.sliccRename) return;
|
|
962
1118
|
Fs.sliccRename = true;
|
|
963
1119
|
Fs.rename = (from, to) => {
|
|
964
|
-
if (crosses(Fs, from, to)) throw new Fs.ErrnoError(
|
|
1120
|
+
if (crosses(Fs, from, to)) throw new Fs.ErrnoError(wasiErrno("EXDEV"));
|
|
965
1121
|
rename(from, to);
|
|
966
1122
|
};
|
|
967
1123
|
}
|
|
968
|
-
var
|
|
1124
|
+
var S_IFDIR, S_IFREG, S_IFLNK, PERM_MASK, DEFAULT_DIR_PERM, UMASK, SEEK_CUR, SEEK_END;
|
|
969
1125
|
var init_live_vfs_fs = __esm({
|
|
970
1126
|
"src/realm/live-vfs-fs.ts"() {
|
|
971
1127
|
"use strict";
|
|
972
1128
|
init_ranged();
|
|
973
1129
|
init_types();
|
|
974
|
-
|
|
975
|
-
EACCES: 2,
|
|
976
|
-
EBADF: 8,
|
|
977
|
-
EBUSY: 10,
|
|
978
|
-
EEXIST: 20,
|
|
979
|
-
EFBIG: 22,
|
|
980
|
-
EINVAL: 28,
|
|
981
|
-
EIO: 29,
|
|
982
|
-
EISDIR: 31,
|
|
983
|
-
ELOOP: 32,
|
|
984
|
-
ENAMETOOLONG: 37,
|
|
985
|
-
ENOENT: 44,
|
|
986
|
-
ENOMEDIUM: 148,
|
|
987
|
-
ENOSPC: 51,
|
|
988
|
-
ENOSYS: 52,
|
|
989
|
-
ENOTCONN: 53,
|
|
990
|
-
ENOTDIR: 54,
|
|
991
|
-
ENOTEMPTY: 55,
|
|
992
|
-
EPERM: 63,
|
|
993
|
-
EROFS: 69,
|
|
994
|
-
ESTALE: 72,
|
|
995
|
-
ETIMEDOUT: 73,
|
|
996
|
-
EXDEV: 75
|
|
997
|
-
};
|
|
998
|
-
EIO = 29;
|
|
1130
|
+
init_wasi_errno();
|
|
999
1131
|
S_IFDIR = 16384;
|
|
1000
1132
|
S_IFREG = 32768;
|
|
1001
1133
|
S_IFLNK = 40960;
|
|
@@ -1342,162 +1474,6 @@ var init_sync_sab_bridge = __esm({
|
|
|
1342
1474
|
}
|
|
1343
1475
|
});
|
|
1344
1476
|
|
|
1345
|
-
// src/process/wasi/wasi-abi.ts
|
|
1346
|
-
function wasiErrnoOf(code2) {
|
|
1347
|
-
if (!code2) return E.IO;
|
|
1348
|
-
const name = code2.startsWith("E") ? code2.slice(1) : code2;
|
|
1349
|
-
if (name === "OPNOTSUPP") return E.NOTSUP;
|
|
1350
|
-
if (name === "WOULDBLOCK") return E.AGAIN;
|
|
1351
|
-
if (name === "NOMEDIUM") return E.NODEV;
|
|
1352
|
-
return E[name] ?? E.IO;
|
|
1353
|
-
}
|
|
1354
|
-
var E, FILETYPE, RIGHTS, OFLAGS, FDFLAGS, LOOKUP_SYMLINK_FOLLOW, WHENCE, CLOCK, FSTFLAGS, EVENTTYPE, SUBCLOCK_ABSTIME, EVENT_FD_READWRITE_HANGUP, RIFLAGS, SDFLAGS, PREOPENTYPE_DIR, SIZE, WASI_SIGNAL_TO_POSIX;
|
|
1355
|
-
var init_wasi_abi = __esm({
|
|
1356
|
-
"src/process/wasi/wasi-abi.ts"() {
|
|
1357
|
-
"use strict";
|
|
1358
|
-
E = {
|
|
1359
|
-
SUCCESS: 0,
|
|
1360
|
-
"2BIG": 1,
|
|
1361
|
-
ACCES: 2,
|
|
1362
|
-
ADDRINUSE: 3,
|
|
1363
|
-
ADDRNOTAVAIL: 4,
|
|
1364
|
-
AFNOSUPPORT: 5,
|
|
1365
|
-
AGAIN: 6,
|
|
1366
|
-
ALREADY: 7,
|
|
1367
|
-
BADF: 8,
|
|
1368
|
-
BADMSG: 9,
|
|
1369
|
-
BUSY: 10,
|
|
1370
|
-
CANCELED: 11,
|
|
1371
|
-
CHILD: 12,
|
|
1372
|
-
CONNABORTED: 13,
|
|
1373
|
-
CONNREFUSED: 14,
|
|
1374
|
-
CONNRESET: 15,
|
|
1375
|
-
DEADLK: 16,
|
|
1376
|
-
DESTADDRREQ: 17,
|
|
1377
|
-
DOM: 18,
|
|
1378
|
-
DQUOT: 19,
|
|
1379
|
-
EXIST: 20,
|
|
1380
|
-
FAULT: 21,
|
|
1381
|
-
FBIG: 22,
|
|
1382
|
-
HOSTUNREACH: 23,
|
|
1383
|
-
IDRM: 24,
|
|
1384
|
-
ILSEQ: 25,
|
|
1385
|
-
INPROGRESS: 26,
|
|
1386
|
-
INTR: 27,
|
|
1387
|
-
INVAL: 28,
|
|
1388
|
-
IO: 29,
|
|
1389
|
-
ISCONN: 30,
|
|
1390
|
-
ISDIR: 31,
|
|
1391
|
-
LOOP: 32,
|
|
1392
|
-
MFILE: 33,
|
|
1393
|
-
MLINK: 34,
|
|
1394
|
-
MSGSIZE: 35,
|
|
1395
|
-
MULTIHOP: 36,
|
|
1396
|
-
NAMETOOLONG: 37,
|
|
1397
|
-
NETDOWN: 38,
|
|
1398
|
-
NETRESET: 39,
|
|
1399
|
-
NETUNREACH: 40,
|
|
1400
|
-
NFILE: 41,
|
|
1401
|
-
NOBUFS: 42,
|
|
1402
|
-
NODEV: 43,
|
|
1403
|
-
NOENT: 44,
|
|
1404
|
-
NOEXEC: 45,
|
|
1405
|
-
NOLCK: 46,
|
|
1406
|
-
NOLINK: 47,
|
|
1407
|
-
NOMEM: 48,
|
|
1408
|
-
NOMSG: 49,
|
|
1409
|
-
NOPROTOOPT: 50,
|
|
1410
|
-
NOSPC: 51,
|
|
1411
|
-
NOSYS: 52,
|
|
1412
|
-
NOTCONN: 53,
|
|
1413
|
-
NOTDIR: 54,
|
|
1414
|
-
NOTEMPTY: 55,
|
|
1415
|
-
NOTRECOVERABLE: 56,
|
|
1416
|
-
NOTSOCK: 57,
|
|
1417
|
-
NOTSUP: 58,
|
|
1418
|
-
NOTTY: 59,
|
|
1419
|
-
NXIO: 60,
|
|
1420
|
-
OVERFLOW: 61,
|
|
1421
|
-
OWNERDEAD: 62,
|
|
1422
|
-
PERM: 63,
|
|
1423
|
-
PIPE: 64,
|
|
1424
|
-
PROTO: 65,
|
|
1425
|
-
PROTONOSUPPORT: 66,
|
|
1426
|
-
PROTOTYPE: 67,
|
|
1427
|
-
RANGE: 68,
|
|
1428
|
-
ROFS: 69,
|
|
1429
|
-
SPIPE: 70,
|
|
1430
|
-
SRCH: 71,
|
|
1431
|
-
STALE: 72,
|
|
1432
|
-
TIMEDOUT: 73,
|
|
1433
|
-
TXTBSY: 74,
|
|
1434
|
-
XDEV: 75,
|
|
1435
|
-
NOTCAPABLE: 76
|
|
1436
|
-
};
|
|
1437
|
-
FILETYPE = {
|
|
1438
|
-
UNKNOWN: 0,
|
|
1439
|
-
BLOCK_DEVICE: 1,
|
|
1440
|
-
CHARACTER_DEVICE: 2,
|
|
1441
|
-
DIRECTORY: 3,
|
|
1442
|
-
REGULAR_FILE: 4,
|
|
1443
|
-
SOCKET_DGRAM: 5,
|
|
1444
|
-
SOCKET_STREAM: 6,
|
|
1445
|
-
SYMBOLIC_LINK: 7
|
|
1446
|
-
};
|
|
1447
|
-
RIGHTS = {
|
|
1448
|
-
FD_DATASYNC: 1n << 0n,
|
|
1449
|
-
FD_READ: 1n << 1n,
|
|
1450
|
-
FD_SEEK: 1n << 2n,
|
|
1451
|
-
FD_FDSTAT_SET_FLAGS: 1n << 3n,
|
|
1452
|
-
FD_SYNC: 1n << 4n,
|
|
1453
|
-
FD_TELL: 1n << 5n,
|
|
1454
|
-
FD_WRITE: 1n << 6n,
|
|
1455
|
-
ALL: (1n << 30n) - 1n
|
|
1456
|
-
};
|
|
1457
|
-
OFLAGS = { CREAT: 1, DIRECTORY: 2, EXCL: 4, TRUNC: 8 };
|
|
1458
|
-
FDFLAGS = { APPEND: 1, DSYNC: 2, NONBLOCK: 4, RSYNC: 8, SYNC: 16 };
|
|
1459
|
-
LOOKUP_SYMLINK_FOLLOW = 1;
|
|
1460
|
-
WHENCE = { SET: 0, CUR: 1, END: 2 };
|
|
1461
|
-
CLOCK = { REALTIME: 0, MONOTONIC: 1, PROCESS_CPUTIME: 2, THREAD_CPUTIME: 3 };
|
|
1462
|
-
FSTFLAGS = { ATIM: 1, ATIM_NOW: 2, MTIM: 4, MTIM_NOW: 8 };
|
|
1463
|
-
EVENTTYPE = { CLOCK: 0, FD_READ: 1, FD_WRITE: 2 };
|
|
1464
|
-
SUBCLOCK_ABSTIME = 1;
|
|
1465
|
-
EVENT_FD_READWRITE_HANGUP = 1;
|
|
1466
|
-
RIFLAGS = { PEEK: 1, WAITALL: 2 };
|
|
1467
|
-
SDFLAGS = { RD: 1, WR: 2 };
|
|
1468
|
-
PREOPENTYPE_DIR = 0;
|
|
1469
|
-
SIZE = {
|
|
1470
|
-
FILESTAT: 64,
|
|
1471
|
-
FDSTAT: 24,
|
|
1472
|
-
DIRENT: 24,
|
|
1473
|
-
SUBSCRIPTION: 48,
|
|
1474
|
-
EVENT: 32
|
|
1475
|
-
};
|
|
1476
|
-
WASI_SIGNAL_TO_POSIX = Object.fromEntries(
|
|
1477
|
-
Array.from({ length: 30 }, (_, i) => [i + 1, i + 1 < 16 ? i + 1 : i + 2])
|
|
1478
|
-
);
|
|
1479
|
-
}
|
|
1480
|
-
});
|
|
1481
|
-
|
|
1482
|
-
// src/process/wasi-errno.ts
|
|
1483
|
-
function wasiErrno(code2) {
|
|
1484
|
-
return WASI_ERRNO[code2] ?? E.IO;
|
|
1485
|
-
}
|
|
1486
|
-
var WASI_ERRNO;
|
|
1487
|
-
var init_wasi_errno = __esm({
|
|
1488
|
-
"src/process/wasi-errno.ts"() {
|
|
1489
|
-
"use strict";
|
|
1490
|
-
init_wasi_abi();
|
|
1491
|
-
WASI_ERRNO = {
|
|
1492
|
-
...Object.fromEntries(Object.entries(E).map(([name, errno2]) => [`E${name}`, errno2])),
|
|
1493
|
-
EWOULDBLOCK: E.AGAIN,
|
|
1494
|
-
ENOTSUP: 138,
|
|
1495
|
-
EOPNOTSUPP: 138,
|
|
1496
|
-
ENOMEDIUM: 148
|
|
1497
|
-
};
|
|
1498
|
-
}
|
|
1499
|
-
});
|
|
1500
|
-
|
|
1501
1477
|
// src/process/kernel-streams.ts
|
|
1502
1478
|
function isPtyPath(path) {
|
|
1503
1479
|
return PTY_PATH.test(path);
|