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
..
2025-09-28 00:51:57 +02:00
2025-09-21 13:12:20 -04:00
2025-09-21 13:12:20 -04:00
2025-09-26 18:41:32 -04:00
2025-09-21 13:12:20 -04:00
2025-09-12 17:16:38 +02:00