unix: add Getrandom syscall bindings and flags
This CL introduces the Getrandom syscall. Allowing users of
sufficiently new kernels (3.17) to detect when the operating system
lacks enough entropy to generate cryptographic random data. See:
As we have updated the syscall numbers, the Getrandom function can
just be generated normally. The only other change is to mkerrors.sh
to include the GRND_* flags for getrandom from <linux/random.h>.
It is important to note that currently the mkerrors.sh script cannot
actually be run as it has fallen behind the 4.10 kernel. The GRND_*
flags were added manually.
This was originally part of a larger commit that was split up.
See CL: https://go-review.googlesource.com/37570
Reviewed-by: Matt Layher <email@example.com>
Reviewed-by: Ian Lance Taylor <firstname.lastname@example.org>
Run-TryBot: Matt Layher <email@example.com>
Run-TryBot: Ian Lance Taylor <firstname.lastname@example.org>
TryBot-Result: Gobot Gobot <email@example.com>
26 files changed