I am writing code that uses sched_setaffinity, which requires a kernel of 2.5.8 or later. I tried to find out if this is possible:
- Systems with older kernels to compile this gracefully, perhaps just completely ignoring this segment of code.
- If I send someone with an older kernel a compiled binary, it will switch to this function or just print a warning.
I assume that my question is, how do you safely use the new kernel functions without breaking the application on the old system?
source share