@ai-ecoverse/slicc-kernel 1.93.2 → 1.93.3

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/dist/node.js CHANGED
@@ -8279,7 +8279,7 @@ function statOf(attr2, path, mount) {
8279
8279
  size: attr2.size,
8280
8280
  mode: attr2.mode ?? fallback,
8281
8281
  mtime,
8282
- atime: mtime,
8282
+ atime: attr2.atime === void 0 ? mtime : new Date(attr2.atime),
8283
8283
  ctime: mtime,
8284
8284
  ino: attr2.ino ?? inodeOf(path),
8285
8285
  ...!inodeless(mount, attr2) && attr2.nlink !== void 0 ? { nlink: attr2.nlink } : {},
@@ -9324,7 +9324,7 @@ var MountFs = class _MountFs {
9324
9324
  ([to], n) => this.utimes(to, atime, mtime, n)
9325
9325
  );
9326
9326
  }
9327
- await this.setMtime(found, real, mtime);
9327
+ await this.setTimes(found, real, atime, mtime);
9328
9328
  }
9329
9329
  async lutimes(path, atime, mtime, redirects = 0) {
9330
9330
  const found = this.at(path);
@@ -9341,12 +9341,13 @@ var MountFs = class _MountFs {
9341
9341
  if (!found.mount.caps.linkTimes && (await this.lstat(real)).isSymbolicLink) {
9342
9342
  throw errnoError("EOPNOTSUPP", path);
9343
9343
  }
9344
- await this.setMtime(found, real, mtime);
9344
+ await this.setTimes(found, real, atime, mtime);
9345
9345
  }
9346
- async setMtime(found, real, mtime) {
9346
+ async setTimes(found, real, atime, mtime) {
9347
9347
  this.writable(found.mount, real);
9348
9348
  this.table.forget(found.mount, real);
9349
- await found.mount.conn.call({ op: "setattr", path: found.rel, mtime: mtime.getTime() });
9349
+ const times = { mtime: mtime.getTime(), atime: atime.getTime() };
9350
+ await found.mount.conn.call({ op: "setattr", path: found.rel, ...times });
9350
9351
  }
9351
9352
  noLinks() {
9352
9353
  const noLinkBase = this.base.noLinks.call(this.base);
@@ -10500,7 +10501,7 @@ function mountTable(mounts = []) {
10500
10501
  }
10501
10502
 
10502
10503
  // src/version.ts
10503
- var KERNEL_VERSION = true ? "1.93.2" : "0.0.0-dev";
10504
+ var KERNEL_VERSION = true ? "1.93.3" : "0.0.0-dev";
10504
10505
  var OS_RELEASE = "6.0.0-slicc";
10505
10506
  function procVersion() {
10506
10507
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -16786,6 +16787,12 @@ function withOwner(base, owner) {
16786
16787
  function fsError2(code, message3 = code) {
16787
16788
  return Object.assign(new Error(message3), { code });
16788
16789
  }
16790
+ var SET_ATTRS = ["mode", "mtime", "atime", "size", "uid", "gid"];
16791
+ function setAttrOf(req) {
16792
+ const attr2 = {};
16793
+ for (const key of SET_ATTRS) if (req[key] !== void 0) attr2[key] = req[key];
16794
+ return attr2;
16795
+ }
16789
16796
  async function dispatch(h, req) {
16790
16797
  switch (req.op) {
16791
16798
  case "getattr":
@@ -16830,13 +16837,7 @@ async function dispatch(h, req) {
16830
16837
  if (!h.readlink) throw fsError2("EINVAL", `${req.path} is not a symlink`);
16831
16838
  return h.readlink(req.path);
16832
16839
  case "setattr":
16833
- return h.setattr?.(req.path, {
16834
- ...req.mode !== void 0 ? { mode: req.mode } : {},
16835
- ...req.mtime !== void 0 ? { mtime: req.mtime } : {},
16836
- ...req.size !== void 0 ? { size: req.size } : {},
16837
- ...req.uid !== void 0 ? { uid: req.uid } : {},
16838
- ...req.gid !== void 0 ? { gid: req.gid } : {}
16839
- });
16840
+ return h.setattr?.(req.path, setAttrOf(req));
16840
16841
  case "statfs":
16841
16842
  return h.statfs?.() ?? null;
16842
16843
  default:
@@ -18048,11 +18049,13 @@ function idOption2(value) {
18048
18049
  return value !== void 0 && /^\d+$/.test(value) ? Number(value) : 0;
18049
18050
  }
18050
18051
  function created2(ino, kind, mode, from, owner) {
18052
+ const now = Date.now();
18051
18053
  return {
18052
18054
  kind,
18053
18055
  ino,
18054
18056
  mode: owner?.mode === void 0 ? mode : mode & ~4095 | owner.mode & 4095,
18055
- mtime: Date.now(),
18057
+ mtime: now,
18058
+ atime: now,
18056
18059
  data: new ChunkedBytes(),
18057
18060
  target: "",
18058
18061
  children: /* @__PURE__ */ new Map(),
@@ -18070,6 +18073,7 @@ function attr(node) {
18070
18073
  kind: node.kind,
18071
18074
  size: node.kind === "file" ? node.data.size : node.kind === "symlink" ? node.target.length : 4096,
18072
18075
  mtime: node.mtime,
18076
+ atime: node.atime,
18073
18077
  mode: node.mode,
18074
18078
  ino: node.ino,
18075
18079
  ...node.kind === "directory" ? {} : { nlink: node.links },
@@ -18232,6 +18236,7 @@ function tmpfs() {
18232
18236
  node.mtime = Date.now();
18233
18237
  }
18234
18238
  if (change.mtime !== void 0) node.mtime = change.mtime;
18239
+ if (change.atime !== void 0) node.atime = change.atime;
18235
18240
  owned3(node, change);
18236
18241
  },
18237
18242
  async statfs() {