This requires a linux kernel of 3.17+, which seems entirely
reasonable. 3.17 went EOL in 2015, and the last supported 3.x kernel
(3.16) went EOL > 4 years ago, in 2020. For reference, the current
oldest maintained kernel is 4.14 (released 2017, going EOL Jan 2024).
Support for getrandom() (and getentropy()) was added to
glibc 2.25 https://sourceware.org/legacy-ml/libc-alpha/2017-02/msg00079.html:
- The getentropy and getrandom functions, and the <sys/random.h> header file have been added.
and we already require 2.27 or later.
All that being said, I don't think you would encounter a current day (+~6 months from now) system, running with kernel headers older than 3.17 (released 2014) but also having a glibc of 2.27+ (released 2018)?
Removing this (our only) use of syscall() also means we can drop a workaround in our MSAN jobs.
If this is merged, I'll drop the same workaround in oss-fuzz.