Skip to content

[wasm] unify Interop.GetHostName #107741

Closed
Closed

Description

@pavelsavara

From comment

nit: it feels slightly wrong doing this special case in the Interop.GetHostName.cs managed binding layer, but calling into native code just for getting a constant string feels wrong too.

Btw. after looking at it some more I think we have an issue on Browser: we do use emscripten's gethostname() which returns the string emscripten and we just paper over it here:

// In the mono runtime, this maps to gethostname, which returns 'emscripten'.
// Returning the value here allows us to exclude more of the runtime.
public static string MachineName => "localhost";

But Interop.Sys.GetHostName() is used in more places and those would get the "wrong" hostname on Browser. I think I'd be in favor of unifying this and adding the special case for Browser here too.

Activity

  1. added this to the 10.0.0 milestone on Sep 12, 2024
  2. self-assigned this
    on Sep 12, 2024
  3. dotnet-policy-service commented on Sep 12, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing
    See info in area-owners.md if you want to be subscribed.

  4. dotnet-policy-service commented on Sep 12, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  5. pavelsavara commented on Sep 12, 2024

    @pavelsavara
    MemberAuthor
  6. modified the milestones: 10.0.0, Future on Dec 12, 2024
  7. modified the milestones: Future, 11.0.0 on Sep 17, 2025
  8. locked and limited conversation to collaborators on Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmWebAssembly architecturearea-System.Netos-browserBrowser variant of arch-wasmos-wasiRelated to WASI variant of arch-wasm

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions