Sometimes, backwards compatibility gets really ugly.
Today I got a mail from someone who failed to compile x86info on some old system, because it had an old glibc.
x86info uses the affinity system calls to bind processes to specific CPUs. I had forgotten all about it, but earlier versions of the interface in glibc were a little unstable.
Quoting the sched_getaffinity manpage:
VERSIONS
The CPU affinity system calls were introduced in Linux kernel 2.5.8. The library interfaces were introduced in glibc 2.3. Initially, the glibc interfaces included a cpusetsize argument, typed as unsigned int. In glibc 2.3.3, the cpusetsize argument was removed, but was then restored in glibc 2.3.4, with type size_t.
The email I got was kind enough to include a patch that made it work on all possible combinations of the glibc, by using plpa. It’s neat that this rube goldberg machine can make it work with anything, but damn is it ever ugly.
I settled for a simpler “fix”
It’s a controversial answer, but sometimes, compatibility just isn’t worth it.
Related posts:
- x86info processor topology parsing. Today was my last working day of the year, as...
Related posts brought to you by Yet Another Related Posts Plugin.