@ai-ecoverse/slicc-kernel 1.124.10 → 1.124.11

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.
@@ -801,6 +801,17 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
801
801
  else cache.mutated([]);
802
802
  }
803
803
  };
804
+ const relabeling = (p, op) => {
805
+ if (exact || !bridge.identifyNext) return rewriting(p, op);
806
+ bridge.identifyNext();
807
+ try {
808
+ return op();
809
+ } finally {
810
+ const st = bridge.identified?.() ?? null;
811
+ if (st) cache.mutated([p], st.ino);
812
+ else cache.mutated([]);
813
+ }
814
+ };
804
815
  const rewriting = (p, op, ...also) => {
805
816
  if (exact) return identified(p, op, also);
806
817
  const ino = cache.inoOf(p, () => bridge.stat(p));
@@ -857,8 +868,8 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
857
868
  unlink: (p) => mutating(() => bridge.unlink(p)),
858
869
  rmdir: (p) => mutating(() => bridge.rmdir(p)),
859
870
  symlink: (target, link) => mutating(() => bridge.symlink(target, link), ...entry(link)),
860
- chmod: (p, mode) => rewriting(p, () => bridge.chmod(p, mode)),
861
- utimes: (p, a, m, now2) => rewriting(p, () => bridge.utimes(p, a, m, now2)),
871
+ chmod: (p, mode) => relabeling(p, () => bridge.chmod(p, mode)),
872
+ utimes: (p, a, m, now2) => relabeling(p, () => bridge.utimes(p, a, m, now2)),
862
873
  lutimes: (p, a, m, now2) => mutating(() => bridge.lutimes(p, a, m, now2)),
863
874
  ...bridge.hold ? { hold: bridge.hold.bind(bridge) } : {},
864
875
  ...bridge.access ? { access: bridge.access.bind(bridge) } : {},
@@ -872,7 +883,7 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
872
883
  mkfifo: (p, mode) => mutating(() => bridge.mkfifo?.(p, mode), ...entry(p))
873
884
  } : {},
874
885
  ...chown ? {
875
- chown: (p, ...rest2) => rewriting(p, () => chown.call(bridge, p, ...rest2))
886
+ chown: (p, ...rest2) => relabeling(p, () => chown.call(bridge, p, ...rest2))
876
887
  } : {},
877
888
  ...bridge.pread && bridge.pwrite && bridge.truncate ? {
878
889
  pread: bridge.pread.bind(bridge),
@@ -5488,7 +5499,7 @@ var KERNEL_VERSION, OS_RELEASE;
5488
5499
  var init_version = __esm({
5489
5500
  "src/version.ts"() {
5490
5501
  "use strict";
5491
- KERNEL_VERSION = true ? "1.124.10" : "0.0.0-dev";
5502
+ KERNEL_VERSION = true ? "1.124.11" : "0.0.0-dev";
5492
5503
  OS_RELEASE = "6.0.0-slicc";
5493
5504
  }
5494
5505
  });
@@ -7448,6 +7459,7 @@ function errnoError(code2, path) {
7448
7459
  function createSyncFsSabBridge(transport, opts = {}) {
7449
7460
  const timeoutMs2 = opts.timeoutMs ?? SYNC_FS_REQUEST_TIMEOUT_MS;
7450
7461
  let identity = {};
7462
+ let once = false;
7451
7463
  let last = null;
7452
7464
  function run(req, path, transfer) {
7453
7465
  last = null;
@@ -7466,7 +7478,9 @@ function createSyncFsSabBridge(transport, opts = {}) {
7466
7478
  throw errnoError("EIO", path);
7467
7479
  }
7468
7480
  const changing = (req, path, transfer) => {
7469
- const r = run({ ...req, ...identity }, path, transfer);
7481
+ const ask = once ? { identity: true } : identity;
7482
+ once = false;
7483
+ const r = run({ ...req, ...ask }, path, transfer);
7470
7484
  if (r.ok && r.kind === "json") last = parseSyncFsStat(r.json);
7471
7485
  };
7472
7486
  const io = (id) => ({
@@ -7563,7 +7577,14 @@ function createSyncFsSabBridge(transport, opts = {}) {
7563
7577
  identify: () => {
7564
7578
  identity = { identity: true };
7565
7579
  },
7566
- identified: () => last,
7580
+ identifyNext: () => {
7581
+ once = true;
7582
+ last = null;
7583
+ },
7584
+ identified: () => {
7585
+ once = false;
7586
+ return last;
7587
+ },
7567
7588
  lutimes: (path, atimeMs, mtimeMs, now) => {
7568
7589
  run({ op: "lutimes", path, atimeMs, mtimeMs, ...now ? { now } : {} }, path);
7569
7590
  },