Files
systemd/src/basic
Zbigniew Jędrzejewski-Szmek 0c927c98a7 basic/socket-util: reserve more space for timeval/timespec messages
As reported in https://github.com/systemd/systemd/issues/38222, we get the
buffer size calculation wrong on 32-bit arm. The reporter suggested checking if
__TIMESIZE == 64, but I think it's better to just use the bigger size in all
cases. The code to guesstimate the buffer size was already tweaked a few times
and apparently it's not easy to get it right. Systemd and glibc might be
compiled with different combinations of __TIMESIZE, so the compile-time check
is not super reliable, and by using the bigger size, we don't depend on the
details of how glibc decided whether to duplicate the struct or not. The cost
is negligible, 16 bytes on stack, so let's do the easy and robust thing.

Solution based on the suggestion by UZver24.

While at it, drop the mock struct definitions. They are only used to calculate
the size, but since the types involved are 8-bit values, there are no alignment
issues and we can just calculate the size directly.

Fixes https://github.com/systemd/systemd/issues/38222.
2025-07-18 02:06:37 +09:00
..
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-06-02 17:39:43 +02:00
2025-06-02 17:39:43 +02:00
2025-06-23 23:11:44 +09:00
2025-05-07 22:04:46 +09:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-06-02 18:05:45 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-06-17 11:44:50 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00
2025-05-25 10:06:07 +02:00