@ai-ecoverse/slicc-kernel 1.196.18 → 1.196.19
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/async-process.js +1 -1
- package/dist/cloudflare-sources.js +1 -1
- package/dist/cloudflare.js +284 -36
- package/dist/cloudflare.js.map +4 -4
- package/dist/kernel-worker.js +332 -84
- package/dist/kernel-worker.js.map +4 -4
- package/dist/meta.js.map +2 -2
- package/dist/node-process-worker.cjs +1 -1
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +282 -34
- package/dist/node.js.map +4 -4
- package/dist/process-worker.js +1 -1
- package/dist/types/fs/meta.d.ts +1 -0
- package/dist/types/fs/opfs.d.ts +12 -0
- package/dist/types/fs/private-rename.d.ts +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1133,7 +1133,7 @@ A lookup follows at most 40 symlinks, as Linux does: the 41st is `ELOOP`, for WA
|
|
|
1133
1133
|
|
|
1134
1134
|
OPFS renames use `FileSystemHandle.move()` when available. If a directory handle has no native move, the kernel coordinates with writers before copying the tree and deleting the source. Replacing an empty directory also uses this coordination. A shared-capable root without the locks needed for a copy returns `EBUSY` instead.
|
|
1135
1135
|
|
|
1136
|
-
|
|
1136
|
+
On a private root (no peer transport), an absent or explicitly unsupported native move falls back to a local copy. Before copying, the kernel drains operations on the source and destination trees. If a conflicting operation or write session remains open past a short grace period, the rename returns `EBUSY` without copying; finish the operation and retry. Later conflicting operations wait for the copy, with a bounded wait. A writer elsewhere on the root need not close. A local-folder mount commits writes under both operands before dispatch, so a shell can rename a directory while its descriptor remains open. A caller using the raw folder driver directly must close an overlapping uncommitted write session before retrying. This ordering is local to the kernel: it cannot coordinate writes from a native app or another tab that independently mounts the same local folder. The source is kept intact until every byte has been copied; a copy failure leaves an existing destination intact or removes a newly created one. On a root configured for peers, a rename that did not coordinate a copy still returns `EBUSY` instead of copying, even if no peer is currently visible. Other native failures report their own errno, such as `ENOENT` for a vanished source or `EACCES` for a denied move.
|
|
1137
1137
|
|
|
1138
1138
|
**FIFOs** (`mkfifo`, #896):
|
|
1139
1139
|
- **Creating one:** an Emscripten program's `mkfifo`/`mknod(S_IFIFO)` makes a FIFO node on the OPFS root (in `/tmp`, `/home` and the rest), owned by the caller, with mode `mode & ~umask`. `stat`, `ls -l` (`p`) and `test -p` show it as a FIFO, in Emscripten, WASI and JS programs. A WASIX program makes one through `slicc_fs.path_mkfifo` (see [File modes and the umask](#file-modes-and-the-umask); its libc uses it from wasix-sysroot -33), and `stat`s, `open`s, reads and writes one like any program. An existing name is `EEXIST`. tmpfs mounts (`/dev/shm`, a tmpfs `/tmp`) have FIFO nodes too, through the driver's `fifos` capability ([#907](https://github.com/ai-ecoverse/slicc-kernel/issues/907)). hostfs, `fsa` and media mounts have none, so `mkfifo` there is `EPERM`, and `EROFS` on a readonly path.
|
|
@@ -1390,7 +1390,7 @@ With `users: 'enforce'` the kernel checks every file call that reaches it agains
|
|
|
1390
1390
|
- **The layout:** with `users: 'report'` or `'enforce'`, the kernel gives its own paths an owner and a mode when they have no owner record yet: on a fresh root, and once on a root from before owners. These are `/` `0755`, `/root` `0700`, `/home` `0755`, `/etc` `0755`, `/etc/passwd` and `/etc/group` `0644`, `/usr` and `/usr/local` `0755`, `/node_modules` (or the `modules` option) and the system `PNPM_HOME` `0755`, all root's. A path that has a record keeps it, so an admin's `chmod 711 /home` or `chown cone /node_modules` lasts across restarts; a mounted path is left to its mount, and a path below a symlinked directory is stamped where it really is. Only a root that records owners is stamped: the OPFS root with its sidecar, which the page and the Node entry (in memory) both use; a custom root file system without owner records is left as it is. The directory for files removed while open, `/.slicc-unlinked`, is made root's `0700`. `/tmp` is the exception: it is set to `1777` at every start, and the first time owners are on for a root from before owners (and at every start after that until it has listed `/tmp` and succeeded for every entry), what is in it without an owner of its own is removed (as a boot empties `/tmp` on Linux; a file that is open is kept, a symlinked `/tmp` is left alone, and one `console.warn` line says how many entries went), since it would otherwise be root's, and a program that made it for its user, such as pnpm's lock directories, would find it isn't its own. Emscripten programs see `/` at `0755`, `/dev` at `0755`, `null`, `zero`, `full`, `random`, `urandom` and `tty` at `0666`, and `/dev/shm` at `1777`. With `users: 'off'` nothing is stamped. Paths the embedder makes (bios's `/opt` and `/var/lib/slicc`) are the embedder's to set. `/etc/sudoers` and `/etc/sudoers.d` are written when missing (see [Sudo](#sudo)).
|
|
1391
1391
|
- **Terminals:** a terminal from `openTerminal` belongs to its session's user, with group `tty` when `/etc/group` has one (the user's own group otherwise), mode `0620`; a pseudo-terminal's slave `/dev/pts/N` belongs to the uid and gid that opened `/dev/ptmx`, mode `0620`. Opening one by name (`/dev/ttyN`, `/dev/pts/N`, from every runtime) needs both `r` and `w`, so only its owner and root open it: the kernel's terminal descriptor always reads and writes, so the group's `w` bit (`write`, `wall` on Linux) does not let a group member open it. `/dev/tty` is the opener's own controlling terminal and is not checked, and descriptors a process inherited (across `sudo` or a `setresuid` too) keep working. Emscripten programs' `stat` of `/dev/ttyN` and `/dev/pts/N` shows the owner and mode. With `users: 'off'` terminals have no owner, as before.
|
|
1392
1392
|
- **A client's `fs`:** checked as the client's user; a page's client (root) passes.
|
|
1393
|
-
- **Removed files still open:** a process that holds a removed file may look it up (`stat`, `lstat`) under the hidden name the kernel gave it in `/.slicc-unlinked`, which is root's `0700`; every other process is refused there, so the kernel's own bookkeeping of held files raises no denials for their holders. The kernel tries twice to rename a held file into `/.slicc-unlinked`. If both attempts fail and the file is still present, removal returns `EBUSY` and the holder can keep reading the original file. These are two rename attempts, not two copy attempts:
|
|
1393
|
+
- **Removed files still open:** a process that holds a removed file may look it up (`stat`, `lstat`) under the hidden name the kernel gave it in `/.slicc-unlinked`, which is root's `0700`; every other process is refused there, so the kernel's own bookkeeping of held files raises no denials for their holders. The kernel tries twice to rename a held file into `/.slicc-unlinked`. If both attempts fail and the file is still present, removal returns `EBUSY` and the holder can keep reading the original file. These are two rename attempts, not two copy attempts: on a private root the kernel can copy a held file aside after draining writers, but on a shared-capable root neither attempt makes an uncoordinated copy ([#1218](https://github.com/ai-ecoverse/slicc-kernel/issues/1218)). Files of the same removal already moved aside are moved back. If one of those moves back fails too, that file stays in `/.slicc-unlinked`: its holder still reads it, but its name is gone although the removal reported `EBUSY`. That's a double failure, and rare.
|
|
1394
1394
|
|
|
1395
1395
|
`users: 'enforce'` is the default of `createKernel` and `createNodeKernel`; pass `'report'` to find what a program would be refused without refusing it, or `'off'` for kernels without owners. A `Launcher` made directly (see [What is in here](#what-is-in-here)) still defaults to `'off'`.
|
|
1396
1396
|
|
package/dist/async-process.js
CHANGED
|
@@ -1535,7 +1535,7 @@ function createParentRefreshCount() {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
|
|
1537
1537
|
// src/version.ts
|
|
1538
|
-
var KERNEL_VERSION = true ? "1.196.
|
|
1538
|
+
var KERNEL_VERSION = true ? "1.196.19" : "0.0.0-dev";
|
|
1539
1539
|
var OS_RELEASE = "6.0.0-slicc";
|
|
1540
1540
|
function procVersion() {
|
|
1541
1541
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|