@ai-ecoverse/slicc-kernel 1.117.5 → 1.118.0

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
@@ -6735,7 +6735,7 @@ function satisfies(version, range2) {
6735
6735
  }
6736
6736
 
6737
6737
  // src/version.ts
6738
- var KERNEL_VERSION = true ? "1.117.5" : "0.0.0-dev";
6738
+ var KERNEL_VERSION = true ? "1.118.0" : "0.0.0-dev";
6739
6739
  var OS_RELEASE = "6.0.0-slicc";
6740
6740
  function procVersion() {
6741
6741
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -9916,7 +9916,7 @@ var FifoTable = class {
9916
9916
  };
9917
9917
 
9918
9918
  // src/mount/protocol.ts
9919
- var DRIVER_PROTOCOL = [1, 2];
9919
+ var DRIVER_PROTOCOL = [1, 3];
9920
9920
  function driverVersionError(theirs) {
9921
9921
  const major = Array.isArray(theirs) ? theirs[0] : void 0;
9922
9922
  if (major === DRIVER_PROTOCOL[0]) return void 0;
@@ -10228,11 +10228,12 @@ function inodeless(mount, attr2) {
10228
10228
  }
10229
10229
  function statOf(attr2, path, mount) {
10230
10230
  const mtime = new Date(attr2.mtime);
10231
- const fallback = attr2.kind === "directory" ? 16877 : attr2.kind === "symlink" ? 41471 : 33188;
10231
+ const fallback = attr2.kind === "directory" ? 16877 : attr2.kind === "symlink" ? 41471 : attr2.kind === "fifo" ? 4516 : 33188;
10232
10232
  return {
10233
10233
  isFile: attr2.kind === "file",
10234
10234
  isDirectory: attr2.kind === "directory",
10235
10235
  isSymbolicLink: attr2.kind === "symlink",
10236
+ ...attr2.kind === "fifo" ? { isFifo: true } : {},
10236
10237
  size: attr2.size,
10237
10238
  mode: attr2.mode ?? fallback,
10238
10239
  mtime,
@@ -10775,7 +10776,7 @@ var MountFs = class _MountFs {
10775
10776
  }
10776
10777
  const { mount, rel: rel2 } = found;
10777
10778
  this.writable(mount, real);
10778
- if (owner?.fifo) throw errnoError("EPERM", `${real}: this mount has no FIFOs`);
10779
+ if (owner?.fifo) return this.mkfifo(found, real, owner);
10779
10780
  const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
10780
10781
  if (mount.maxFile > 0 && bytes.length > mount.maxFile) {
10781
10782
  throw errnoError(
@@ -10792,6 +10793,18 @@ var MountFs = class _MountFs {
10792
10793
  }
10793
10794
  }
10794
10795
  }
10796
+ async mkfifo(found, real, owner) {
10797
+ const { mount, rel: rel2 } = found;
10798
+ if (!mount.caps.fifos) throw errnoError("EPERM", `${real}: this mount has no FIFOs`);
10799
+ const made2 = await this.driverOwner(found, real, owner, false);
10800
+ await this.table.commit(real);
10801
+ this.table.forget(mount, real);
10802
+ try {
10803
+ await mount.conn.call({ op: "mkfifo", path: rel2, ...made2 });
10804
+ } finally {
10805
+ this.table.forget(mount, real);
10806
+ }
10807
+ }
10795
10808
  async writeWhole(mount, real, rel2, bytes, owner) {
10796
10809
  await this.table.commit(real);
10797
10810
  this.table.forget(mount, real);
@@ -20821,6 +20834,9 @@ async function dispatch(h, req) {
20821
20834
  case "link":
20822
20835
  if (!h.link) throw fsError2("EPERM", "this file system has no hard links");
20823
20836
  return h.link(req.from, req.to);
20837
+ case "mkfifo":
20838
+ if (!h.mkfifo) throw fsError2("EPERM", "this file system has no FIFOs");
20839
+ return ownerOf2(req) ? h.mkfifo(req.path, ownerOf2(req)) : h.mkfifo(req.path);
20824
20840
  case "symlink":
20825
20841
  if (!h.symlink) throw fsError2("EPERM", "this file system has no symlinks");
20826
20842
  return ownerOf2(req) ? h.symlink(req.target, req.path, ownerOf2(req)) : h.symlink(req.target, req.path);
@@ -22062,7 +22078,7 @@ function owned3(node, change) {
22062
22078
  function attr(node) {
22063
22079
  return {
22064
22080
  kind: node.kind,
22065
- size: node.kind === "file" ? node.data.size : node.kind === "symlink" ? node.target.length : 4096,
22081
+ size: node.kind === "file" ? node.data.size : node.kind === "symlink" ? node.target.length : node.kind === "fifo" ? 0 : 4096,
22066
22082
  mtime: node.mtime,
22067
22083
  atime: node.atime,
22068
22084
  mode: node.mode,
@@ -22111,6 +22127,7 @@ function tmpfs() {
22111
22127
  const existing = dir.children.get(name2);
22112
22128
  if (existing && flags2.exclusive) throw fsError2("EEXIST", path);
22113
22129
  if (existing?.kind === "directory" && flags2.write) throw fsError2("EISDIR", path);
22130
+ if (existing?.kind === "fifo") throw fsError2("ENXIO", path);
22114
22131
  if (existing) return existing;
22115
22132
  if (!flags2.create) throw fsError2("ENOENT", path);
22116
22133
  const node = make("file", 33188, dir, flags2.owner);
@@ -22155,6 +22172,11 @@ function tmpfs() {
22155
22172
  handle(fh);
22156
22173
  handles.delete(fh);
22157
22174
  },
22175
+ async mkfifo(path, owner) {
22176
+ const { dir, name: name2 } = parent(path);
22177
+ if (dir.children.has(name2)) throw fsError2("EEXIST", path);
22178
+ place(dir, name2, make("fifo", 4516, dir, owner));
22179
+ },
22158
22180
  async mkdir(path, owner) {
22159
22181
  const { dir, name: name2 } = parent(path);
22160
22182
  if (dir.children.has(name2)) throw fsError2("EEXIST", path);
@@ -24532,6 +24554,7 @@ var Launcher = class {
24532
24554
  {
24533
24555
  symlinks: true,
24534
24556
  links: true,
24557
+ fifos: true,
24535
24558
  chmod: true,
24536
24559
  owners: true,
24537
24560
  linkTimes: true,