@ai-ecoverse/slicc-kernel 1.97.2 → 1.98.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.
@@ -2405,6 +2405,20 @@ var init_dev_removal = __esm({
2405
2405
  }
2406
2406
  });
2407
2407
 
2408
+ // src/version.ts
2409
+ function procVersion() {
2410
+ return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
2411
+ `;
2412
+ }
2413
+ var KERNEL_VERSION, OS_RELEASE;
2414
+ var init_version = __esm({
2415
+ "src/version.ts"() {
2416
+ "use strict";
2417
+ KERNEL_VERSION = true ? "1.98.0" : "0.0.0-dev";
2418
+ OS_RELEASE = "6.0.0-slicc";
2419
+ }
2420
+ });
2421
+
2408
2422
  // src/process/process-locks.ts
2409
2423
  function lockTarget(stream) {
2410
2424
  if (stream.sliccKernelFile && stream.sliccKernelFd !== void 0) {
@@ -3233,6 +3247,26 @@ function kernelLink(imports, fs, memory, glue) {
3233
3247
  true
3234
3248
  );
3235
3249
  }
3250
+ function kernelUname(imports, hostname, memory, glue) {
3251
+ const fields = ["Linux", hostname, OS_RELEASE, "#1 SMP PREEMPT_DYNAMIC", "wasm32", "(none)"];
3252
+ const encoded = fields.map((f) => new TextEncoder().encode(f).subarray(0, UTS_FIELD - 1));
3253
+ wrapImport(
3254
+ imports,
3255
+ "uname",
3256
+ glue,
3257
+ (own) => (buf) => {
3258
+ const heap = memory();
3259
+ if (!buf || !heap) return own(buf);
3260
+ const bytes = new Uint8Array(heap.buffer, buf, UTS_FIELD * fields.length);
3261
+ bytes.fill(0);
3262
+ encoded.forEach((field2, i) => {
3263
+ bytes.set(field2, i * UTS_FIELD);
3264
+ });
3265
+ return 0;
3266
+ },
3267
+ true
3268
+ );
3269
+ }
3236
3270
  function kernelChdir(Fs) {
3237
3271
  const { chdir, lookupPath, ErrnoError } = Fs;
3238
3272
  if (!chdir || !lookupPath || !ErrnoError) return;
@@ -3260,13 +3294,14 @@ function linuxDevices(Fs) {
3260
3294
  }
3261
3295
  }
3262
3296
  }
3263
- var O_CLOEXEC, FD_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, tracked, IMPORT_NAMES, EBADF, AT_SYMLINK_NOFOLLOW, EMSCRIPTEN_EPERM, O_PATH2, LITERALS, UTIME_NOW, UTIME_OMIT, PROT_WRITE, MAP_PRIVATE, MAP_TYPE, O_WRONLY2, MAP_ALIGN, DIR_MODE, LINK_MODE, CHAR_DEVICE, O_ACCMODE3, O_CREAT, field, pinnedRoot, rootKind, NAME, AT_FDCWD, AT_EACCESS, W_ACCESS, X_ACCESS, AT_SYMLINK_FOLLOW, DEVICE_MODES;
3297
+ var O_CLOEXEC, FD_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, tracked, IMPORT_NAMES, EBADF, AT_SYMLINK_NOFOLLOW, EMSCRIPTEN_EPERM, O_PATH2, LITERALS, UTIME_NOW, UTIME_OMIT, PROT_WRITE, MAP_PRIVATE, MAP_TYPE, O_WRONLY2, MAP_ALIGN, DIR_MODE, LINK_MODE, CHAR_DEVICE, O_ACCMODE3, O_CREAT, field, pinnedRoot, rootKind, NAME, AT_FDCWD, AT_EACCESS, W_ACCESS, X_ACCESS, AT_SYMLINK_FOLLOW, UTS_FIELD, DEVICE_MODES;
3264
3298
  var init_process_fds = __esm({
3265
3299
  "src/process/process-fds.ts"() {
3266
3300
  "use strict";
3267
3301
  init_dev_removal();
3268
3302
  init_loopback_names();
3269
3303
  init_live_vfs_fs();
3304
+ init_version();
3270
3305
  init_process_locks();
3271
3306
  init_process_pty();
3272
3307
  init_wasi_errno();
@@ -3298,6 +3333,7 @@ var init_process_fds = __esm({
3298
3333
  umask: "__syscall_umask",
3299
3334
  faccessat: "__syscall_faccessat",
3300
3335
  linkat: "__syscall_linkat",
3336
+ uname: "__syscall_uname",
3301
3337
  utimensat: "__syscall_utimensat",
3302
3338
  getppid: "slicc_getppid_js",
3303
3339
  resizeHeap: "emscripten_resize_heap",
@@ -3325,6 +3361,7 @@ var init_process_fds = __esm({
3325
3361
  W_ACCESS = 2;
3326
3362
  X_ACCESS = 1;
3327
3363
  AT_SYMLINK_FOLLOW = 1024;
3364
+ UTS_FIELD = 65;
3328
3365
  DEVICE_MODES = [
3329
3366
  ["/", 493],
3330
3367
  ["/dev", 493],
@@ -4835,20 +4872,6 @@ var init_cred = __esm({
4835
4872
  }
4836
4873
  });
4837
4874
 
4838
- // src/version.ts
4839
- function procVersion() {
4840
- return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
4841
- `;
4842
- }
4843
- var KERNEL_VERSION, OS_RELEASE;
4844
- var init_version = __esm({
4845
- "src/version.ts"() {
4846
- "use strict";
4847
- KERNEL_VERSION = true ? "1.97.2" : "0.0.0-dev";
4848
- OS_RELEASE = "6.0.0-slicc";
4849
- }
4850
- });
4851
-
4852
4875
  // src/process/procfs.ts
4853
4876
  function sysEntry(parts) {
4854
4877
  let at = SYS_TREE;
@@ -5543,6 +5566,7 @@ function kernelWrappers(imports, module, deps) {
5543
5566
  noFollowUtimes(imports, fsOf, kernelGlue?.utimensat ?? utimensatOf(module), memory);
5544
5567
  kernelAccess(imports, fsOf, memory, kernelGlue);
5545
5568
  kernelLink(imports, fsOf, memory, kernelGlue);
5569
+ kernelUname(imports, hostnameOf(init.env), memory, kernelGlue);
5546
5570
  const glue = ownValue(module, "sliccFdImports");
5547
5571
  syncFsync(imports, fsOf, glue);
5548
5572
  positionalIo(imports, { glue, fs: fsOf, sys, memory });
@@ -5861,6 +5885,7 @@ var init_process_runtime = __esm({
5861
5885
  " umask: typeof ___syscall_umask === 'function' ? ___syscall_umask : undefined,",
5862
5886
  " faccessat: typeof ___syscall_faccessat === 'function' ? ___syscall_faccessat : undefined,",
5863
5887
  " linkat: typeof ___syscall_linkat === 'function' ? ___syscall_linkat : undefined,",
5888
+ " uname: typeof ___syscall_uname === 'function' ? ___syscall_uname : undefined,",
5864
5889
  " utimensat: typeof ___syscall_utimensat === 'function' ? ___syscall_utimensat : undefined,",
5865
5890
  " getppid: typeof _slicc_getppid_js === 'function' ? _slicc_getppid_js : undefined,",
5866
5891
  " resizeHeap: typeof _emscripten_resize_heap === 'function' ? _emscripten_resize_heap : undefined,",