@ai-ecoverse/slicc-kernel 1.143.3 → 1.143.5

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.
@@ -4976,6 +4976,7 @@ var init_wasi_host = __esm({
4976
4976
  startCwd;
4977
4977
  interruptWakes = false;
4978
4978
  strictEpoll = false;
4979
+ cwdFd = false;
4979
4980
  entered = false;
4980
4981
  enteredSignals = 0;
4981
4982
  raisedOnEntry;
@@ -6725,7 +6726,7 @@ var KERNEL_VERSION, OS_RELEASE;
6725
6726
  var init_version = __esm({
6726
6727
  "src/version.ts"() {
6727
6728
  "use strict";
6728
- KERNEL_VERSION = true ? "1.143.3" : "0.0.0-dev";
6729
+ KERNEL_VERSION = true ? "1.143.5" : "0.0.0-dev";
6729
6730
  OS_RELEASE = "6.0.0-slicc";
6730
6731
  }
6731
6732
  });
@@ -17317,7 +17318,7 @@ function posixSignal(sig) {
17317
17318
  function nsToMs(ns) {
17318
17319
  return Math.ceil(Number(ns) / 1e6);
17319
17320
  }
17320
- var FDFLAGSEXT_CLOEXEC, SPAWN_OP_SIZE, SPAWN_OPS, RIGHTS_FD_WRITE, ICANON2, ECHO2, FUTEX_SLICE_MS, EINTR_LIBC, STRICT_EPOLL_LIBC, MAIN_HANDLE, WasixHost;
17321
+ var FDFLAGSEXT_CLOEXEC, SPAWN_OP_SIZE, SPAWN_OPS, RIGHTS_FD_WRITE, ICANON2, ECHO2, FUTEX_SLICE_MS, EINTR_LIBC, STRICT_EPOLL_LIBC, CWD_FD_LIBC, MAIN_HANDLE, WasixHost;
17321
17322
  var init_wasix_host = __esm({
17322
17323
  "src/process/wasi/wasix-host.ts"() {
17323
17324
  "use strict";
@@ -17342,6 +17343,7 @@ var init_wasix_host = __esm({
17342
17343
  FUTEX_SLICE_MS = 50;
17343
17344
  EINTR_LIBC = 22;
17344
17345
  STRICT_EPOLL_LIBC = 29;
17346
+ CWD_FD_LIBC = 41;
17345
17347
  MAIN_HANDLE = 2147483647;
17346
17348
  WasixHost = class _WasixHost {
17347
17349
  process;
@@ -17360,7 +17362,9 @@ var init_wasix_host = __esm({
17360
17362
  driver,
17361
17363
  () => (this.threads?.tid ?? MAIN_TID) !== MAIN_TID
17362
17364
  );
17363
- if (module) host.strictEpoll = (libcVersion(module) ?? 0) >= STRICT_EPOLL_LIBC;
17365
+ const libc = module ? libcVersion(module) ?? 0 : void 0;
17366
+ if (libc !== void 0) host.strictEpoll = libc >= STRICT_EPOLL_LIBC;
17367
+ if (libc !== void 0) host.cwdFd = libc >= CWD_FD_LIBC;
17364
17368
  if (module && !WebAssembly.Module.imports(module).some((i) => i.name === "fd_fdflags_set")) {
17365
17369
  host.fds.implicitCloexec = true;
17366
17370
  host.interruptWakes = (libcVersion(module) ?? 0) < EINTR_LIBC;
@@ -17500,6 +17504,7 @@ var init_wasix_host = __esm({
17500
17504
  mem.view().setUint32(out, host.o.parent?.() ?? host.o.ppid ?? 1, true);
17501
17505
  },
17502
17506
  getcwd: (buf, lenPtr) => {
17507
+ if (host.cwdFd && host.fds.held && !host.fds.held.alive()) return E.NOENT;
17503
17508
  const bytes = new TextEncoder().encode(host.cwd);
17504
17509
  const max = mem.view().getUint32(lenPtr, true);
17505
17510
  mem.view().setUint32(lenPtr, bytes.length, true);