fishinabarrel / linux-kernel-module-rust

Framework for writing Linux kernel modules in safe Rust
GNU General Public License v2.0
1.33k stars 120 forks source link

Add backwards compatbility down to kernel 4.4 (fixes #199) #238

Closed geofft closed 4 years ago

geofft commented 4 years ago

4.5 added

4.7 added iterate_shared (torvalds/linux@6192269444ebfbfb42e23c7a6a93c76ffe4b5e51), a variant of iterate that takes a non-exclusive lock. It sounds like it'd be safe to provide an implementation of iterate_shared as iterate.

4.9 removed aio_fsync (torvalds/linux@723c038475b78edc9327eb952f95f9881cc9d79d), which was never actually used, so we can set it to None in older kernels and not think about it.

4.13 added wait_for_random_bytes (torvalds/linux@e297a783e41560b44e3c14f38e420cba518113b8). For now, conditionalize the entire random module on it.

All test cases other than random pass on Ubuntu 16.04's kernel.

Update the README to say we expect 4.4 onwards to work, possibly with newer Clang for really new kernels (refs #219).