rust/library/std
Matthias Krüger 8223831942
Rollup merge of #146937 - joboet:gethostname, r=Mark-Simulacrum
std: implement `hostname`

Resolves https://github.com/rust-lang/libs-team/issues/330
Tracking issue: https://github.com/rust-lang/rust/issues/135142

This is based on rust-lang/rust#135141, but I've reimplemented the UNIX version, which now:
* uses `sysconf(_SC_HOST_NAME_MAX)` as an initial buffer length
* returns `OutOfMemory` if the `Vec` allocation fails
* retries the operation if it detects that the name returned by `gethostname` was truncated

Additionally, as part of the rebase, I had to move some WinSock abstractions (initialisation and error access) to `sys::pal` so that they can be accessed from `sys::net::hostname`.

CC ``@orowith2os`` (and thank you for your work!)
2025-09-29 21:42:41 +02:00
..
benches Fix import in bench for wasm 2025-02-12 14:44:30 -08:00
src Rollup merge of #146937 - joboet:gethostname, r=Mark-Simulacrum 2025-09-29 21:42:41 +02:00
tests Rollup merge of #146958 - el-ev:fix_path_string_eq_recurse, r=joboet 2025-09-24 23:33:28 +02:00
build.rs std: add support for armv7a-vex-v5 target 2025-09-24 12:10:15 -05:00
Cargo.toml Rollup merge of #145973 - vexide:vex-std, r=tgross35 2025-09-25 20:31:53 +10:00