Fix test_uds link on 64-bit glibc 2.40+

ST
7d ago
+222-3

Problem

test_uds no longer links on 64-bit glibc 2.40 and later (and 2.39 builds with the stable-branch backport): undefined reference to '__sendmsg64'.
The __sendmsg64 EINTR wrapper in the test fixture was guarded on __USE_TIME_BITS64, which glibc now also defines on 64-bit targets, where libc has no __sendmsg64.
Since the Linux CI runners moved to Ubuntu 26.04, this fails the Runtime Safety, CodeQL (C/C++ POSIX) and Codacy Coverage jobs on main; the same failure blocks #19.

Change

  • The wrapper is guarded on defined(__GLIBC__) && defined(__USE_TIME_BITS64) && __TIMESIZE == 32, the condition glibc itself uses to redirect sendmsg to __sendmsg64; it also works with headers older than glibc's __USE_TIME64_REDIRECTS macro.
  • Test fixture only; no library code changes. SOW-0074 records the analysis.

Compatibility

  • 64-bit glibc builds no longer compile the wrapper; they never reference __sendmsg64.
  • 32-bit builds with legacy 32-bit time_t already omitted it and are unchanged.
  • glibc ABIs with a default 32-bit time_t built with _TIME_BITS=64 still compile it and still intercept the redirected call.

Testing

  • x86_64 glibc 2.41: test_uds failed to link before; it links and passes after, and CTest passes 32/32.
  • i386 glibc with _FILE_OFFSET_BITS=64 _TIME_BITS=64: the library references __sendmsg64, the wrapper intercepts it, the EINTR injection checks pass, and CTest passes 14/14.
  • i386 glibc with legacy time_t: CTest passes 14/14.
  • armv7-gnu-time64 and aarch64-gnu are covered by the PR's Linux target CI jobs.

Summary by cubic

Fixes the test_uds link failure on 64-bit glibc 2.40+, where the __sendmsg64 EINTR wrapper was built even though libc exports no such symbol.

  • The wrapper was guarded on __USE_TIME_BITS64, which glibc 2.40+ also sets on 64-bit targets; the guard now matches glibc's own redirect condition (__TIMESIZE == 32).
  • Test fixture only, no library changes; 32-bit _TIME_BITS=64 builds still intercept the redirected call.
  • Adds the SOW-0074 record documenting the analysis and validation.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a test link failure on newer glibc versions while preserving the expected behavior for 32-bit time64 and legacy builds.
  • Documentation
    • Added notes on the issue, expected behavior, and validation across supported configurations.