Skip to content

Does WASI stdio work? #15

Description

@konsumer

I am using this to route WASI calls to web49_api_wasi

web49_env_func_t web49_main_import_func(void* state, const char* mod, const char* func) {
  printf("called: %s.%s\n", mod, func);

  if (strcmp(mod, "null0") == 0) {
    return web49_api_null0(state, mod, func);
  } else if (strcmp(mod, "wasi_snapshot_preview1") == 0) {
    return web49_api_wasi(state, mod, func);
  }
  fprintf(stderr, "Unhandled import: %s.%s\n", mod, func);
  return NULL;
}

and for a printf from the wasm, it seems to just output huge chunks of memory. Do I need to put more in state?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions