@ai-ecoverse/slicc-kernel 1.121.1 → 1.122.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 +9 -1
- package/dist/kernel-worker.js +2 -1
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +39 -3
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +2 -1
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +43 -7
- package/dist/process-worker.js.map +3 -3
- package/dist/types/process/process-fds.d.ts +1 -0
- package/dist/types/process/process-locks.d.ts +6 -0
- package/package.json +1 -1
|
@@ -3966,6 +3966,7 @@ var init_wasi_host = __esm({
|
|
|
3966
3966
|
const { mkfifo } = this.o.fs;
|
|
3967
3967
|
if (!mkfifo) return E.NOSYS;
|
|
3968
3968
|
const raw = mem.string(p, l);
|
|
3969
|
+
if (raw === "") throw new WasiError("ENOENT");
|
|
3969
3970
|
const path = dirfd === AT_FDCWD && !raw.startsWith("/") ? fds.resolve(3, `${this.cwd}/${raw}`) : at(dirfd, p, l);
|
|
3970
3971
|
const umask = this.o.kernel.call({ op: "proc-umask" });
|
|
3971
3972
|
const want = mode & 4095 & ~umask;
|
|
@@ -5431,7 +5432,7 @@ var KERNEL_VERSION, OS_RELEASE;
|
|
|
5431
5432
|
var init_version = __esm({
|
|
5432
5433
|
"src/version.ts"() {
|
|
5433
5434
|
"use strict";
|
|
5434
|
-
KERNEL_VERSION = true ? "1.
|
|
5435
|
+
KERNEL_VERSION = true ? "1.122.1" : "0.0.0-dev";
|
|
5435
5436
|
OS_RELEASE = "6.0.0-slicc";
|
|
5436
5437
|
}
|
|
5437
5438
|
});
|
|
@@ -8678,7 +8679,24 @@ function closeDropsLocks(Fs, kernel) {
|
|
|
8678
8679
|
}
|
|
8679
8680
|
};
|
|
8680
8681
|
}
|
|
8681
|
-
|
|
8682
|
+
function kernelFlock(deps) {
|
|
8683
|
+
return (fd, op) => {
|
|
8684
|
+
const kind = FLOCK_KINDS[op & ~LOCK_NB2];
|
|
8685
|
+
if (!kind) return -wasiErrno("EINVAL");
|
|
8686
|
+
const Fs = deps.fs();
|
|
8687
|
+
const stream = Fs?.getStream(fd);
|
|
8688
|
+
if (!Fs || !stream) return -wasiErrno("EBADF");
|
|
8689
|
+
if (stream.sliccKernelFd === void 0) lockPromoters.get(Fs)?.()(stream);
|
|
8690
|
+
if (stream.sliccKernelFd === void 0) return 0;
|
|
8691
|
+
try {
|
|
8692
|
+
deps.flock(stream.sliccKernelFd, kind, kind !== "unlock" && (op & LOCK_NB2) === 0);
|
|
8693
|
+
return 0;
|
|
8694
|
+
} catch (err) {
|
|
8695
|
+
return -errnoOf(err);
|
|
8696
|
+
}
|
|
8697
|
+
};
|
|
8698
|
+
}
|
|
8699
|
+
var F_GETLK2, F_SETLK2, F_SETLKW2, F_RDLCK2, F_WRLCK2, F_UNLCK2, SEEK_CUR3, SEEK_END3, O_ACCMODE2, O_RDONLY, O_WRONLY4, lockPromoters, held, LOCK_NB2, FLOCK_KINDS;
|
|
8682
8700
|
var init_process_locks = __esm({
|
|
8683
8701
|
"src/process/process-locks.ts"() {
|
|
8684
8702
|
"use strict";
|
|
@@ -8697,6 +8715,12 @@ var init_process_locks = __esm({
|
|
|
8697
8715
|
O_WRONLY4 = 1;
|
|
8698
8716
|
lockPromoters = /* @__PURE__ */ new WeakMap();
|
|
8699
8717
|
held = /* @__PURE__ */ new WeakMap();
|
|
8718
|
+
LOCK_NB2 = 4;
|
|
8719
|
+
FLOCK_KINDS = {
|
|
8720
|
+
1: "shared",
|
|
8721
|
+
2: "exclusive",
|
|
8722
|
+
8: "unlock"
|
|
8723
|
+
};
|
|
8700
8724
|
}
|
|
8701
8725
|
});
|
|
8702
8726
|
|
|
@@ -9593,7 +9617,8 @@ var init_process_fds = __esm({
|
|
|
9593
9617
|
resizeHeap: "emscripten_resize_heap",
|
|
9594
9618
|
fdWrite: "fd_write",
|
|
9595
9619
|
fdRead: "fd_read",
|
|
9596
|
-
sleepMs: "slicc_sleep_ms"
|
|
9620
|
+
sleepMs: "slicc_sleep_ms",
|
|
9621
|
+
flock: "__syscall_flock"
|
|
9597
9622
|
};
|
|
9598
9623
|
UTIME_NOW = 1073741823;
|
|
9599
9624
|
UTIME_OMIT = 1073741822;
|
|
@@ -13648,6 +13673,9 @@ function kernelSys(transport) {
|
|
|
13648
13673
|
closeLocks(target) {
|
|
13649
13674
|
call2({ op: "lk-close", ...target }, "lk-close");
|
|
13650
13675
|
},
|
|
13676
|
+
flock(fd, kind, wait2) {
|
|
13677
|
+
call2({ op: "flock", fd, kind, ...wait2 ? { wait: wait2 } : {} }, `flock ${fd}`);
|
|
13678
|
+
},
|
|
13651
13679
|
ptyNumber(fd) {
|
|
13652
13680
|
return json2(call2({ op: "pty-number", fd }, `pty-number ${fd}`));
|
|
13653
13681
|
},
|
|
@@ -13781,6 +13809,13 @@ function kernelWrappers(imports, module, deps) {
|
|
|
13781
13809
|
kernelLink(imports, fsOf, memory, kernelGlue);
|
|
13782
13810
|
devCreations(imports, fsOf, memory, kernelGlue);
|
|
13783
13811
|
kernelUname(imports, hostnameOf(init.env), memory, kernelGlue);
|
|
13812
|
+
wrapImport(
|
|
13813
|
+
imports,
|
|
13814
|
+
"flock",
|
|
13815
|
+
kernelGlue,
|
|
13816
|
+
() => kernelFlock({ fs: fsOf, flock: (fd, kind, wait2) => sys.flock?.(fd, kind, wait2) }),
|
|
13817
|
+
true
|
|
13818
|
+
);
|
|
13784
13819
|
const glue = ownValue(module, "sliccFdImports");
|
|
13785
13820
|
syncFsync(imports, fsOf, glue);
|
|
13786
13821
|
positionalIo(imports, { glue, fs: fsOf, sys, memory });
|
|
@@ -14114,6 +14149,7 @@ var init_process_runtime = __esm({
|
|
|
14114
14149
|
" fdWrite: typeof _fd_write === 'function' ? _fd_write : undefined,",
|
|
14115
14150
|
" fdRead: typeof _fd_read === 'function' ? _fd_read : undefined,",
|
|
14116
14151
|
" sleepMs: typeof slicc_sleep_ms === 'function' ? slicc_sleep_ms : undefined,",
|
|
14152
|
+
" flock: typeof __syscall_flock === 'function' ? __syscall_flock : undefined,",
|
|
14117
14153
|
"};",
|
|
14118
14154
|
"Module.sliccFdImports ??= {",
|
|
14119
14155
|
" fd_sync: typeof _fd_sync === 'function' ? _fd_sync : undefined,",
|