getrandom(2 should be more portable on Linux and is non-blocking, unlike getentropy(3).
I think the ENOSYS scenario is always possible if you run it on a system too old to even have getrandom(2).
I faced exactly the same challenge in one project that is expected to run on weirdest of unices (old Linux, BSD, Solaris etc) and ended up with rather ugly sequence of fallbacks from getrandom -> OpenSSL -> urandom -> random()