<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sys, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-10-02T08:27:48+00:00</updated>
<entry>
<title>Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, r=Mark-Simulacrum</title>
<updated>2025-10-02T08:27:48+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-10-02T08:27:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=92aac1bdf61642cfc99498ca86e663cf53d2039e'/>
<id>urn:sha1:92aac1bdf61642cfc99498ca86e663cf53d2039e</id>
<content type='text'>
Support `#[rustc_align_static]` inside `thread_local!`

Tracking issue: rust-lang/rust#146177

```rust
thread_local! {
    #[rustc_align_static(64)]
    static SO_ALIGNED: u64 = const { 0 };
}
```

This increases the amount of recursion the macro performs (once per attribute in addition to the previous once per item), making it easier to hit the recursion limit. I’ve added workarounds to limit the impact in the case of long doc comments, but this still needs a crater run just in case.

r? libs

``@rustbot`` label A-attributes A-macros A-thread-locals F-static_align T-libs
</content>
</entry>
<entry>
<title>Fix memory leak in `os` impl</title>
<updated>2025-10-01T16:28:18+00:00</updated>
<author>
<name>Jules Bertholet</name>
<email>julesbertholet@quoi.xyz</email>
</author>
<published>2025-10-01T15:32:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94f00f4e4a0240bc7b8284c78482e37af252309a'/>
<id>urn:sha1:94f00f4e4a0240bc7b8284c78482e37af252309a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix broken STD build for ESP-IDF</title>
<updated>2025-10-01T08:12:44+00:00</updated>
<author>
<name>ivmarkov</name>
<email>ivan.markov@gmail.com</email>
</author>
<published>2025-10-01T08:12:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b1c212f8502e8e7fcb66da0e8da98db770cb7c02'/>
<id>urn:sha1:b1c212f8502e8e7fcb66da0e8da98db770cb7c02</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #146937 - joboet:gethostname, r=Mark-Simulacrum</title>
<updated>2025-09-29T19:42:41+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-29T19:42:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8223831942e7668d890955a1a67a69e49c286e3d'/>
<id>urn:sha1:8223831942e7668d890955a1a67a69e49c286e3d</id>
<content type='text'>
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!)
</content>
</entry>
<entry>
<title>std: implement `hostname`</title>
<updated>2025-09-29T08:24:54+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-09-23T15:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=97333f8c9a0f774cc8d0025bbc51848e1f60427d'/>
<id>urn:sha1:97333f8c9a0f774cc8d0025bbc51848e1f60427d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #147090 - Noratrieb:immediate-abort-stack-overflow, r=joboet</title>
<updated>2025-09-29T01:32:14+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-09-29T01:32:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=772f380092b30680313b70a622cafc17f03e6bff'/>
<id>urn:sha1:772f380092b30680313b70a622cafc17f03e6bff</id>
<content type='text'>
Skip stack overflow handler for panic=immediate-abort

std installs guard pages and a signal handler to ensure that stackoverflows 1) terminate abruptly and 2) print an nice message. Even for panic=immediate-abort, 1) is desirable, we don't want silent data corruption there. But 2) is completely unnecessary, as users deliberately *don't* want nice messages, they want minimum binary size.

Therefore, skip the entire guard signal handler setup, which saves a lot of bytes.

I tested this with a hello world binary using fat LTO, build-std, panic=immediate-abort, opt-level=s, strip=debuginfo.

`size` reports significant savings:

```
   text	   data	    bss	    dec	    hex	filename
  15252	   1032	    104	  16388	   4004	tiny-before
   6881	    964	     48	   7893	   1ed5	tiny-after2
```

`nm -U` goes from 71 to 56, getting rid of a bunch of stack overflow related symbols. The disk size goes from `31k` to `24k`.

The impact on the error message is minimal, as the message was already
missing.

before:
```
fish: Job 1, './tiny-so-before' terminated by signal SIGABRT (Abort)
```

after:
```
fish: Job 1, './tiny-so-after' terminated by signal SIGSEGV (Address boundary error)
```

I didn't test the Windows part, but it likely also has savings.
</content>
</entry>
<entry>
<title>Rollup merge of #140482 - devnexen:tcp_deferaccept_toduration, r=joboet</title>
<updated>2025-09-28T16:13:10+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-28T16:13:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=322dca8551ba2e395268ddff9bcf58e0d0479813'/>
<id>urn:sha1:322dca8551ba2e395268ddff9bcf58e0d0479813</id>
<content type='text'>
std::net: update tcp deferaccept delay type to Duration.

See comment [here](https://github.com/rust-lang/rust/issues/119639#issuecomment-2839330337).
</content>
</entry>
<entry>
<title>Hoist non-platform-specific code out of `thread_local_inner!`</title>
<updated>2025-09-27T21:05:39+00:00</updated>
<author>
<name>Jules Bertholet</name>
<email>julesbertholet@quoi.xyz</email>
</author>
<published>2025-09-27T19:47:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d32b9a1783343d42a9864fe3d2115daa2cb425e'/>
<id>urn:sha1:4d32b9a1783343d42a9864fe3d2115daa2cb425e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>redox: switch to colon as path separator</title>
<updated>2025-09-27T14:25:47+00:00</updated>
<author>
<name>Jeremy Soller</name>
<email>jackpot51@gmail.com</email>
</author>
<published>2025-09-27T14:25:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=760ed37769c4902c97c874d324978472ce02f9ba'/>
<id>urn:sha1:760ed37769c4902c97c874d324978472ce02f9ba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Skip stack overflow handler for panic=immediate-abort</title>
<updated>2025-09-27T12:16:06+00:00</updated>
<author>
<name>Noratrieb</name>
<email>48135649+Noratrieb@users.noreply.github.com</email>
</author>
<published>2025-09-27T11:37:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=660a3486fc6da2c3599a167d73d849178f98bc17'/>
<id>urn:sha1:660a3486fc6da2c3599a167d73d849178f98bc17</id>
<content type='text'>
std installs guard pages and a signal handler to ensure that stackoverflows 1) terminate abruptly and 2) print an nice message. Even for panic=immediate-abort, 1) is desirable, we don't want silent data corruption there. But 2) is completely unnecessary, as users deliberately *don't* want nice messages, they want minimum binary size.

Therefore, skip the entire guard signal handler setup, which saves a lot of bytes.

I tested this with a hello world binary using fat LTO, build-std, panic=immediate-abort, opt-level=s, strip=debuginfo.

`size` reports significant savings:

```
   text	   data	    bss	    dec	    hex	filename
  15252	   1032	    104	  16388	   4004	tiny-before
   6881	    964	     48	   7893	   1ed5	tiny-after2
```

`nm -U` goes from 71 to 56, getting rid of a bunch of stack overflow related symbols. The disk size goes from `31k` to `24k`.

The impact on the error message is minimal, as the message was already
missing.

before:
```
fish: Job 1, './tiny-so-before' terminated by signal SIGABRT (Abort)
```

after:
```
fish: Job 1, './tiny-so-after' terminated by signal SIGSEGV (Address boundary error)
```
</content>
</entry>
</feed>
