wasm-posix-host
    Preparing search index...

    Class NodeKernelHost

    Index

    Constructors

    Methods

    • Append data to a process's stdin buffer (process sees more data, no EOF)

      Parameters

      • pid: number
      • data: Uint8Array

      Returns void

    • Destroy the kernel and release all resources

      Returns Promise<void>

    • Send an HTTP request to a server running inside the kernel and return the parsed response. Bypasses real TCP by using the kernel's injected connection path directly. Prototype API.

      The in-kernel server must already be listening on port. Each call opens a fresh injected connection.

      Parameters

      • port: number
      • request: HttpRequest
      • Optionaloptions: { timeoutMs?: number }

      Returns Promise<HttpResponse>

    • Read the kernel's per-process fork counter. Used by the spawn regression tests to assert a SYS_SPAWN call didn't fall back to fork — getForkCount(parent) should return the same value before and after a posix_spawn.

      Returns u64::MAX (as bigint) if the pid does not exist; callers should compare against an explicit before-value.

      Parameters

      • pid: number

      Returns Promise<bigint>

    • Initialize the kernel by spawning a dedicated worker_thread

      Parameters

      • OptionalkernelWasmBytes: ArrayBuffer

      Returns Promise<void>

    • Resize the PTY for a process

      Parameters

      • pid: number
      • rows: number
      • cols: number

      Returns void

    • Write data to the PTY master for a process

      Parameters

      • pid: number
      • data: Uint8Array

      Returns void

    • Read /proc/[pid]/maps for a foreign process. Returns the raw text (one line per mapping), "" if the process has no mappings, or null if the pid is gone.

      Parameters

      • pid: number

      Returns Promise<string | null>

    • Set a process's stdin data (complete buffer with implicit EOF)

      Parameters

      • pid: number
      • data: Uint8Array

      Returns void

    • Spawn a new process. Returns a promise that resolves with the exit code.

      Parameters

      • programBytes: ArrayBuffer
      • argv: string[]
      • Optionaloptions: SpawnOptions

      Returns Promise<number>

    • Subscribe to the kernel-worker's syscall trace. Returns an unsubscribe function. Mirrors BrowserKernel.subscribeSyscalls.

      Parameters

      Returns () => void

    • Terminate a specific process

      Parameters

      • pid: number
      • status: number = -1

      Returns Promise<void>