@ai-ecoverse/slicc-kernel 1.133.0 → 1.133.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/dist/node.js CHANGED
@@ -7403,7 +7403,7 @@ function satisfies(version, range2) {
7403
7403
  }
7404
7404
 
7405
7405
  // src/version.ts
7406
- var KERNEL_VERSION = true ? "1.133.0" : "0.0.0-dev";
7406
+ var KERNEL_VERSION = true ? "1.133.1" : "0.0.0-dev";
7407
7407
  var OS_RELEASE = "6.0.0-slicc";
7408
7408
  function procVersion() {
7409
7409
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -2664,7 +2664,7 @@ var KERNEL_VERSION, OS_RELEASE;
2664
2664
  var init_version = __esm({
2665
2665
  "src/version.ts"() {
2666
2666
  "use strict";
2667
- KERNEL_VERSION = true ? "1.133.0" : "0.0.0-dev";
2667
+ KERNEL_VERSION = true ? "1.133.1" : "0.0.0-dev";
2668
2668
  OS_RELEASE = "6.0.0-slicc";
2669
2669
  }
2670
2670
  });
@@ -8413,6 +8413,10 @@ function stdioAlias(path) {
8413
8413
  function deviceOf(path) {
8414
8414
  return deviceAt(path);
8415
8415
  }
8416
+ function namedDevice(path) {
8417
+ if (deviceOf(path) || stdioAlias(path) !== void 0) return true;
8418
+ return path === SEALED_PATH2 || path === CLIPBOARD_PATH2 || path === "/dev/tty";
8419
+ }
8416
8420
  function within(path, root) {
8417
8421
  return path === root || path.startsWith(root === "/" ? "/" : `${root}/`);
8418
8422
  }
@@ -9069,8 +9073,19 @@ var init_wasi_fds = __esm({
9069
9073
  fd = this.openCharDevice(openClipboard, oflags, rights);
9070
9074
  kind = "clipboard";
9071
9075
  } else if (path === "/dev/tty" || /^\/dev\/tty\d+$/.test(path)) {
9072
- fd = openTty?.call(this.kernel.sys, path === "/dev/tty" ? void 0 : path);
9076
+ const exclusive = (oflags & OFLAGS.CREAT) !== 0 && (oflags & OFLAGS.EXCL) !== 0;
9077
+ try {
9078
+ fd = openTty?.call(this.kernel.sys, path === "/dev/tty" ? void 0 : path);
9079
+ } catch (err) {
9080
+ if (exclusive && err.code === "EACCES")
9081
+ throw new WasiError("EEXIST");
9082
+ throw err;
9083
+ }
9073
9084
  if (fd === void 0) throw new WasiError("ENXIO");
9085
+ if (exclusive) {
9086
+ this.kernel.sys.close(fd);
9087
+ throw new WasiError("EEXIST");
9088
+ }
9074
9089
  kind = "tty";
9075
9090
  } else return void 0;
9076
9091
  this.adopt(fd, kind, nonblock);
@@ -9086,13 +9101,14 @@ var init_wasi_fds = __esm({
9086
9101
  open(path, oflags, rights, fdflags, mode) {
9087
9102
  this.made = void 0;
9088
9103
  this.created = false;
9104
+ const exclusive = (oflags & OFLAGS.CREAT) !== 0 && (oflags & OFLAGS.EXCL) !== 0;
9105
+ if (exclusive && namedDevice(path)) throw new WasiError("EEXIST");
9089
9106
  const device2 = deviceOf(path);
9090
9107
  if (device2) return this.install({ type: "device", device: device2 });
9091
9108
  const kernelDevice = this.openKernelDevice(path, oflags, fdflags, rights);
9092
9109
  if (kernelDevice !== void 0) return kernelDevice;
9093
9110
  const alias = stdioAlias(path);
9094
9111
  if (alias !== void 0) return this.reopen(alias);
9095
- const exclusive = (oflags & OFLAGS.CREAT) !== 0 && (oflags & OFLAGS.EXCL) !== 0;
9096
9112
  if (exclusive && !(oflags & OFLAGS.DIRECTORY) && this.madeAtOnce(path, mode)) {
9097
9113
  return this.regular(path, void 0, oflags, rights, fdflags, mode, true);
9098
9114
  }