mirror of
https://github.com/golang/sys.git
synced 2026-02-09 04:06:04 +03:00
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: http://man7.org/linux/man-pages/man2/getrandom.2.html 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 Change-Id: I464088a9c9f7224abdcdae476b30a4f2f412d9f5 Reviewed-on: https://go-review.googlesource.com/37589 Reviewed-by: Matt Layher <mdlayher@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Matt Layher <mdlayher@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
42 KiB
42 KiB