@ai-ecoverse/slicc-kernel 1.34.0 → 1.34.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 +1 -1
- package/dist/kernel-worker.js +2 -10
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +88 -11
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +7 -14
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +88 -11
- package/dist/process-worker.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -349,7 +349,7 @@ Directories are renamed with `FileSystemHandle.move()` where available, else by
|
|
|
349
349
|
- `@ai-ecoverse/slicc-kernel/driver` exports the types and `fsError`.
|
|
350
350
|
- **Capabilities:** `readonly`, `symlinks`, `chmod`, `ranges`, `maxIo` (the largest read or write per message), `maxFile`, `listingStats`, `linkTimes`, and `attrTtl`/`entryTtl` (in ms, default 1000). `linkTimes` promises that `setattr` with `mtime` on a symlink sets the link's own time. Without it, setting a link's own times (`touch -h`, `utimensat` with `AT_SYMLINK_NOFOLLOW`) fails with `EOPNOTSUPP` and never reaches the target. tmpfs has it; hostfs does not. Setting times through a link follows it in the kernel, so `setattr` gets the target. `ranges` (driver protocol 1.1) promises that a write lands in the file at once, with no copy of the whole file on `open` or `release`, and that `setattr` takes `size`.
|
|
351
351
|
- **Caching:** the kernel caches attributes and listings for those TTLs, and a driver can push `invalidate` for changes made outside.
|
|
352
|
-
- **File contents:** on a mount with `ranges`, as `tmpfs` is, and on the root file system when it is in OPFS (in a browser with sync access handles) or an in-memory root, a program reads and writes a file in 64 KiB pages: reads come from the driver 1 MiB at a time, and changed pages go back in 1 MiB runs once 8 MiB have changed, at `fsync`, and when the file is closed (from the kernel's own descriptors also 250 ms after a write). A file of any size the mount can hold works, with memory to spare for about one more copy of it. In OPFS a write opens a sync access handle for just that write. Elsewhere (`fsa` mounts, `hostfs` with an older proxy, and a root outside OPFS), file contents are read whole when a program opens a file and written back when it closes it.
|
|
352
|
+
- **File contents:** on a mount with `ranges`, as `tmpfs` is, and on the root file system when it is in OPFS (in a browser with sync access handles) or an in-memory root, a program reads and writes a file in 64 KiB pages: reads come from the driver 1 MiB at a time, and changed pages go back in 1 MiB runs once 8 MiB have changed, at `fsync`, and when the file is closed (from the kernel's own descriptors also 250 ms after a write). A file of any size the mount can hold works, with memory to spare for about one more copy of it. In OPFS a write opens a sync access handle for just that write. Elsewhere (`fsa` mounts, `hostfs` with an older proxy, and a root outside OPFS), file contents are read whole when a program opens a file and written back when it closes it. Before a program's next call into the kernel (any wait, read of a pipe or terminal, sleep or spawn), its changed pages also go back, so other processes and the embedder see a write as soon as the writer does anything but compute: a daemon's pidfile, a log another process follows. On a whole-file mount that holds only for files of up to 64 KiB; a larger one goes back at close, fsync and exit, as before. Beyond that, both give close-to-open consistency, as NFS has. A process that ends without closing its files keeps what it wrote: on exit, on a trap, and when a signal kills it. For a killed WASI program, the kernel lets its worker write its changed pages back before `waitpid` reports the death. The only exception is a worker that makes no call into the kernel for 2 seconds after the signal; it is stopped without that write-back.
|
|
353
353
|
- **Rules on a mount:**
|
|
354
354
|
- a rename across mounts is `EXDEV`, so `mv` copies;
|
|
355
355
|
- `df` reports each mount from its driver's `statfs`;
|
package/dist/kernel-worker.js
CHANGED
|
@@ -1144,14 +1144,6 @@ function sinkFile(onData) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
|
-
function nullFile() {
|
|
1148
|
-
return new OpenFile({
|
|
1149
|
-
read: async () => new Uint8Array(0),
|
|
1150
|
-
write: async (bytes) => bytes.length,
|
|
1151
|
-
close: () => {
|
|
1152
|
-
}
|
|
1153
|
-
});
|
|
1154
|
-
}
|
|
1155
1147
|
function written(device, bytes) {
|
|
1156
1148
|
if (device === "full" && bytes.length > 0) throw new KernelError("ENOSPC");
|
|
1157
1149
|
return bytes.length;
|
|
@@ -5003,7 +4995,7 @@ var ChildTable = class {
|
|
|
5003
4995
|
captured.set(n, chunks);
|
|
5004
4996
|
return sinkFile((bytes) => chunks.push(bytes));
|
|
5005
4997
|
}
|
|
5006
|
-
return
|
|
4998
|
+
return deviceFile("null");
|
|
5007
4999
|
}
|
|
5008
5000
|
async wait(pid, nohang, signal, flags = {}) {
|
|
5009
5001
|
let interrupt;
|
|
@@ -10873,7 +10865,7 @@ var Launcher = class {
|
|
|
10873
10865
|
return { status: NOT_FOUND, stdout: concat5(out), stderr: concat5(err) };
|
|
10874
10866
|
}
|
|
10875
10867
|
const fds = new FdTable();
|
|
10876
|
-
fds.installAt(0, options.stdin ? bytesSource(options.stdin) :
|
|
10868
|
+
fds.installAt(0, options.stdin ? bytesSource(options.stdin) : deviceFile("null"));
|
|
10877
10869
|
fds.installAt(1, sinkFile(stdout));
|
|
10878
10870
|
fds.installAt(2, sinkFile(stderr));
|
|
10879
10871
|
const group = options.pgid !== void 0 ? { pgid: options.pgid } : {};
|