@ai-ecoverse/slicc-kernel 1.99.0 → 1.99.2

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.
@@ -1362,7 +1362,11 @@ var init_physical_path = __esm({
1362
1362
  });
1363
1363
 
1364
1364
  // src/fs/dev-removal.ts
1365
+ function inShm(path) {
1366
+ return path === SHM || path.startsWith(`${SHM}/`);
1367
+ }
1365
1368
  function inDevTree(path) {
1369
+ if (path.startsWith(`${SHM}/`)) return false;
1366
1370
  return path === "/dev" || path.startsWith("/dev/");
1367
1371
  }
1368
1372
  function devRemoval(path, cred) {
@@ -1370,9 +1374,11 @@ function devRemoval(path, cred) {
1370
1374
  if (cred && cred.euid !== 0) return "EACCES";
1371
1375
  return path === "/dev" ? "EBUSY" : "EPERM";
1372
1376
  }
1377
+ var SHM;
1373
1378
  var init_dev_removal = __esm({
1374
1379
  "src/fs/dev-removal.ts"() {
1375
1380
  "use strict";
1381
+ SHM = "/dev/shm";
1376
1382
  }
1377
1383
  });
1378
1384
 
@@ -4644,7 +4650,7 @@ var KERNEL_VERSION, OS_RELEASE;
4644
4650
  var init_version = __esm({
4645
4651
  "src/version.ts"() {
4646
4652
  "use strict";
4647
- KERNEL_VERSION = true ? "1.99.0" : "0.0.0-dev";
4653
+ KERNEL_VERSION = true ? "1.99.2" : "0.0.0-dev";
4648
4654
  OS_RELEASE = "6.0.0-slicc";
4649
4655
  }
4650
4656
  });
@@ -5167,7 +5173,7 @@ var init_js_io = __esm({
5167
5173
 
5168
5174
  // src/process/js/js-dev.ts
5169
5175
  function inDev(abs) {
5170
- return abs.startsWith("/dev") && (abs.length === 4 || abs[4] === "/");
5176
+ return abs.startsWith("/dev") && (abs.length === 4 || abs[4] === "/") && !inShm(abs);
5171
5177
  }
5172
5178
  function missing(path) {
5173
5179
  throw new JsCallError("ENOENT", path);
@@ -5308,7 +5314,7 @@ function* devReaddir(abs) {
5308
5314
  if (node.kind !== "dir") throw new JsCallError("ENOTDIR", abs);
5309
5315
  const names = yield { op: "fd-tty-names" };
5310
5316
  const ttys = names.filter((n) => /^\/dev\/tty\d+$/.test(n)).map((n) => n.slice(5));
5311
- return [...DEVICES, "clipboard", "sealed", "tty", "fd", "pts", ...STDIO3, ...ttys].sort();
5317
+ return [...DEVICES, "clipboard", "sealed", "tty", "fd", "pts", "shm", ...STDIO3, ...ttys].sort();
5312
5318
  }
5313
5319
  function* aliasOf(fd, abs, o) {
5314
5320
  const info = yield* fdInfo(fd, abs);
@@ -5519,6 +5525,7 @@ var DEV_READ_MAX, DEVICES, STDIO3, SELF_FD, S_IFMT, DIR, LINK, CHAR, BORN, CHAR_
5519
5525
  var init_js_dev = __esm({
5520
5526
  "src/process/js/js-dev.ts"() {
5521
5527
  "use strict";
5528
+ init_dev_removal();
5522
5529
  init_sync_fs_wire();
5523
5530
  init_js_io();
5524
5531
  init_js_kernel();
@@ -10752,6 +10759,15 @@ var init_js_runtime = __esm({
10752
10759
  });
10753
10760
 
10754
10761
  // src/realm/emscripten-vfs-hook.ts
10762
+ function kernelDevDirs(bridge) {
10763
+ return KERNEL_DEV_DIRS.filter((dir) => {
10764
+ try {
10765
+ return bridge.stat(dir).isDirectory;
10766
+ } catch {
10767
+ return false;
10768
+ }
10769
+ });
10770
+ }
10755
10771
  function topLevelDirs(bridge, warn) {
10756
10772
  let names;
10757
10773
  try {
@@ -10790,7 +10806,12 @@ function linuxRmdir(Fs) {
10790
10806
  function mountVfsIntoEmscripten(Fs, deps) {
10791
10807
  const { bridge, warn } = deps;
10792
10808
  const dirs = topLevelDirs(bridge, warn);
10793
- const { plugin, mounted } = mountLiveVfsDirs(Fs, bridge, dirs ?? [], warn);
10809
+ const { plugin, mounted } = mountLiveVfsDirs(
10810
+ Fs,
10811
+ bridge,
10812
+ [...dirs ?? [], ...kernelDevDirs(bridge)],
10813
+ warn
10814
+ );
10794
10815
  if (dirs) liveRoot(Fs, bridge);
10795
10816
  if (bridge.owners && Fs.lookupPath) useLiveChown(Fs);
10796
10817
  if (bridge.links && Fs.lookupPath) readingLinks(Fs);
@@ -10808,13 +10829,14 @@ function mountVfsIntoEmscripten(Fs, deps) {
10808
10829
  invalidate: () => invalidateLiveVfs(Fs, plugin)
10809
10830
  };
10810
10831
  }
10811
- var MODULE_OWNED_DIRS, SYNTHETIC_DIRS2;
10832
+ var MODULE_OWNED_DIRS, SYNTHETIC_DIRS2, KERNEL_DEV_DIRS;
10812
10833
  var init_emscripten_vfs_hook = __esm({
10813
10834
  "src/realm/emscripten-vfs-hook.ts"() {
10814
10835
  "use strict";
10815
10836
  init_live_vfs_fs();
10816
10837
  MODULE_OWNED_DIRS = /* @__PURE__ */ new Set(["dev", "proc"]);
10817
10838
  SYNTHETIC_DIRS2 = ["/usr", "/bin"];
10839
+ KERNEL_DEV_DIRS = ["/dev/shm"];
10818
10840
  }
10819
10841
  });
10820
10842