@ai-ecoverse/slicc-kernel 1.60.2 → 1.61.1
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 +2 -2
- package/dist/driver-worker.js.map +2 -2
- package/dist/index.js.map +2 -2
- package/dist/kernel-worker.js +16 -1
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +36 -7
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +16 -1
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +36 -7
- package/dist/process-worker.js.map +2 -2
- package/package.json +2 -2
package/dist/process-worker.js
CHANGED
|
@@ -1675,6 +1675,11 @@ function createSyncFsSabBridge(transport, opts = {}) {
|
|
|
1675
1675
|
...io({}),
|
|
1676
1676
|
pinned: (handle) => io({ handle }),
|
|
1677
1677
|
kept: (handle) => json({ op: "kept", path: "/", handle }, "/") === true,
|
|
1678
|
+
keptStat: (handle) => {
|
|
1679
|
+
const s = parseSyncFsStat(json({ op: "stat", path: "/", handle }, "/"));
|
|
1680
|
+
if (!s) throw errnoError("EIO", "/");
|
|
1681
|
+
return s;
|
|
1682
|
+
},
|
|
1678
1683
|
stat: (path) => {
|
|
1679
1684
|
const s = parseSyncFsStat(json({ op: "stat", path }, path));
|
|
1680
1685
|
if (!s) throw errnoError("EIO", path);
|
|
@@ -4763,6 +4768,7 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
|
|
|
4763
4768
|
lutimes: (p, a, m) => mutating(() => bridge.lutimes(p, a, m), p),
|
|
4764
4769
|
...bridge.hold ? { hold: bridge.hold.bind(bridge) } : {},
|
|
4765
4770
|
...bridge.kept ? { kept: bridge.kept.bind(bridge) } : {},
|
|
4771
|
+
...bridge.keptStat ? { keptStat: bridge.keptStat.bind(bridge) } : {},
|
|
4766
4772
|
...bridge.pinned ? { pinned: (handle) => pinnedIo2(bridge, handle, rewriting) } : {},
|
|
4767
4773
|
...bridge.create ? { create: (p) => mutating(() => bridge.create?.(p), ...entry(p)) } : {},
|
|
4768
4774
|
...chown ? {
|
|
@@ -6699,16 +6705,41 @@ var init_wasi_host = __esm({
|
|
|
6699
6705
|
fdFilestat(fd) {
|
|
6700
6706
|
const e = this.fds.get(fd);
|
|
6701
6707
|
if (e.type === "dir") return filestatOf(e.path, this.o.fs.stat(e.path));
|
|
6702
|
-
if (e.type === "file") return this.
|
|
6708
|
+
if (e.type === "file") return this.localFilestat(e.file);
|
|
6703
6709
|
const kind = e.type === "kernel" ? this.fds.kind(fd, e) : void 0;
|
|
6704
6710
|
if (kind === "file") {
|
|
6705
6711
|
const vfs = this.kernelStat(fd);
|
|
6706
|
-
if (vfs.path) return this.statOrphanable(vfs.path, vfs.size, vfs.orphan);
|
|
6712
|
+
if (vfs.path) return this.statOrphanable(vfs.path, vfs.size, vfs.orphan, vfs.orphan);
|
|
6707
6713
|
}
|
|
6708
6714
|
const filetype = kind ? kernelFiletype(kind).filetype : FILETYPE.CHARACTER_DEVICE;
|
|
6709
6715
|
return this.local({ filetype, size: 0n, ino: BigInt(fd + 1), mtimeNs: 0n });
|
|
6710
6716
|
}
|
|
6711
|
-
|
|
6717
|
+
localFilestat(file) {
|
|
6718
|
+
const { buffer } = file;
|
|
6719
|
+
if (buffer.isOrphan()) return this.statOrphanable(file.path, file.size(), false, true);
|
|
6720
|
+
let s;
|
|
6721
|
+
try {
|
|
6722
|
+
s = this.o.fs.stat(file.path);
|
|
6723
|
+
} catch {
|
|
6724
|
+
s = this.keptStat(buffer.handle);
|
|
6725
|
+
}
|
|
6726
|
+
return this.sized(file.path, s, file.size());
|
|
6727
|
+
}
|
|
6728
|
+
keptStat(handle) {
|
|
6729
|
+
if (handle === void 0) return void 0;
|
|
6730
|
+
try {
|
|
6731
|
+
return this.o.fs.keptStat?.(handle);
|
|
6732
|
+
} catch {
|
|
6733
|
+
return void 0;
|
|
6734
|
+
}
|
|
6735
|
+
}
|
|
6736
|
+
sized(path, s, size) {
|
|
6737
|
+
return {
|
|
6738
|
+
...filestatOf(path, s ?? { isFile: true, isDirectory: false, size: 0 }),
|
|
6739
|
+
size: BigInt(size)
|
|
6740
|
+
};
|
|
6741
|
+
}
|
|
6742
|
+
statOrphanable(path, size, orphan = false, gone = false) {
|
|
6712
6743
|
let s;
|
|
6713
6744
|
if (!orphan) {
|
|
6714
6745
|
try {
|
|
@@ -6716,10 +6747,8 @@ var init_wasi_host = __esm({
|
|
|
6716
6747
|
} catch {
|
|
6717
6748
|
}
|
|
6718
6749
|
}
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
size: BigInt(size)
|
|
6722
|
-
};
|
|
6750
|
+
const out = this.sized(path, s, size);
|
|
6751
|
+
return gone ? { ...out, nlink: 0n } : out;
|
|
6723
6752
|
}
|
|
6724
6753
|
pathFilestat(path, lookup) {
|
|
6725
6754
|
if (deviceOf(path)) {
|