Skip to content

Tracking Issue for std::net::hostname #135142

Open
@orowith2os

Description

@orowith2os

Feature gate: #![feature(gethostname)]

This is a tracking issue for retrieving the device's hostname.

rust-lang/libs-team#330 goes into far more detail; basically, "it seems to be a small but useful addition to std::net"

Public API

// std::net

pub fn hostname() -> std::io::Result<OsString>

Steps / History

Unresolved Questions

  • Will using netc be fine for all targets that support std, or do we need to do more here? I think so, since any new targets without a libc can just expose the same function signature under netc (gethostname(ptr, len))
  • Is the structure of this (with functions being directly under std::net) fine, with things like gethostbyname in mind?

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions