@ai-ecoverse/slicc-kernel 1.98.2 → 1.98.4
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 +16 -2
- package/dist/kernel-worker.js +22 -5
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +27 -9
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +22 -5
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +27 -9
- package/dist/process-worker.js.map +2 -2
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -11075,7 +11075,7 @@ var PATH_OPS = new Set(SYNC_FS_OPS);
|
|
|
11075
11075
|
var EARLY_WHOLE_FILE = 64 * 1024;
|
|
11076
11076
|
|
|
11077
11077
|
// src/version.ts
|
|
11078
|
-
var KERNEL_VERSION = true ? "1.98.
|
|
11078
|
+
var KERNEL_VERSION = true ? "1.98.4" : "0.0.0-dev";
|
|
11079
11079
|
var OS_RELEASE = "6.0.0-slicc";
|
|
11080
11080
|
function procVersion() {
|
|
11081
11081
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -15178,6 +15178,11 @@ function clipboardLine(text) {
|
|
|
15178
15178
|
}
|
|
15179
15179
|
return out.length > 200 ? `${out.slice(0, 200)}\u2026` : out;
|
|
15180
15180
|
}
|
|
15181
|
+
var nextOpenKey = 1;
|
|
15182
|
+
var fileKeys = /* @__PURE__ */ new WeakMap();
|
|
15183
|
+
function identityKey(st, path) {
|
|
15184
|
+
return st.ino === void 0 ? path : `${st.dev ?? 0}:${st.ino}`;
|
|
15185
|
+
}
|
|
15181
15186
|
var DYING = { ok: false, errno: "EINTR", message: "the process is being killed" };
|
|
15182
15187
|
var HOSTS_ONLY = new Resolver({ routes: new Routes() });
|
|
15183
15188
|
var WasmProcess = class {
|
|
@@ -15423,10 +15428,11 @@ var WasmProcess = class {
|
|
|
15423
15428
|
this.lockOwners.add(owner);
|
|
15424
15429
|
return owner;
|
|
15425
15430
|
}
|
|
15431
|
+
pathKeys = /* @__PURE__ */ new Map();
|
|
15426
15432
|
async lockPath(target, want) {
|
|
15427
15433
|
if (target.fd !== void 0) {
|
|
15428
15434
|
const st = await this.fds.get(target.fd).file.stat?.();
|
|
15429
|
-
if (!st
|
|
15435
|
+
if (!st) throw new KernelError("EBADF");
|
|
15430
15436
|
return st.path;
|
|
15431
15437
|
}
|
|
15432
15438
|
if (target.path === void 0) throw new KernelError("EINVAL");
|
|
@@ -15441,11 +15447,22 @@ var WasmProcess = class {
|
|
|
15441
15447
|
return path;
|
|
15442
15448
|
}
|
|
15443
15449
|
async lockKey(target, kind) {
|
|
15450
|
+
const file = target.fd === void 0 ? void 0 : this.fds.get(target.fd);
|
|
15451
|
+
const known = file ? fileKeys.get(file) : this.pathKeys.get(target.path ?? "");
|
|
15452
|
+
if (kind === "close" && !file && target.path !== void 0) this.pathKeys.delete(target.path);
|
|
15444
15453
|
const want = kind === "read" ? R_OK : kind === "write" ? W_OK : 0;
|
|
15445
15454
|
const path = await this.lockPath(target, want);
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15455
|
+
if (known !== void 0) return known;
|
|
15456
|
+
const st = await this.options.fs.stat?.(path).catch((err) => {
|
|
15457
|
+
if (!file) throw err;
|
|
15458
|
+
return void 0;
|
|
15459
|
+
});
|
|
15460
|
+
if (!st && !file) throw new KernelError("ENOENT");
|
|
15461
|
+
const key = st ? identityKey(st, path) : `open:${nextOpenKey++}`;
|
|
15462
|
+
if (kind === "close") return key;
|
|
15463
|
+
if (file) fileKeys.set(file, key);
|
|
15464
|
+
else if (this.pathKeys.size < 4096) this.pathKeys.set(path, key);
|
|
15465
|
+
return key;
|
|
15449
15466
|
}
|
|
15450
15467
|
async dropRecordLocks(fd) {
|
|
15451
15468
|
const { locks } = this.options;
|