How do I find out Linux kernel version for an API change?
2
votes
2
answers
140
views
How do I find out, since which Linux version a kernel API function/macro is availible, or have undergone breaking changes (was removed, change of the type or number of arguments).
For example while looking through recent version of
scatterlist.h
I stumbled upon sg_alloc_table_from_pages_segment
, which has exactly required functionality for my kernel module (driver). However, the function, to my disappointment, is not yet availible in version in 5.10 that the kernel module is developed for, and I will have to find a workaround. Still I wish to support future kernel versions in case we perform an upgrade.
Usually, such cases are dealt with preprocessor fences
#if LINUX_VERSION_CODE >= KERNEL_VERSION(...)
/*Version-specific implementation*/
#endif
But in order to apply this pattern, I need to find kernel version in which the function was added. Manually scanning through all intermediate versions of the header file would be a sisyphean task.
Asked by Andrey Pro
(179 rep)
Mar 8, 2025, 09:52 PM
Last activity: Mar 9, 2025, 05:33 PM
Last activity: Mar 9, 2025, 05:33 PM