|
|
Subscribe / Log in / New account

If this threatens a userspace (meaning glibc in particular) change ...

If this threatens a userspace (meaning glibc in particular) change ...

Posted Aug 23, 2025 1:42 UTC (Sat) by comex (subscriber, #71521)
In reply to: If this threatens a userspace (meaning glibc in particular) change ... by quotemstr
Parent article: Bringing restartable sequences out of the niche

macOS does do runtime checks based on compatibility versions, but it also does something more sophisticated.

There's a compiler flag to specify the minimum OS version you need to run on. Meanwhile, every declaration in every system header is marked with a minimum OS version, so you get an error if you accidentally use a newer function (this can be disabled for functionality you want to use conditionally). In more subtle cases, header files can manually check the target version with #if and change their behavior, though this is rarely done.

The goal is that you can always use the latest SDK, even if you are targeting an old OS version (though there is a limit to how far back you can go).

I think glibc would be well-served if it adopted a similar scheme.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds