Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 5 tasks
orowith2os opened this issue Jan 6, 2025 · 0 comments
Open
1 of 5 tasks

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

orowith2os opened this issue Jan 6, 2025 · 0 comments
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@orowith2os
Copy link

orowith2os commented Jan 6, 2025

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

@orowith2os orowith2os added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jan 6, 2025
@fmease fmease added the A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants