diff options
| author | Jason A. Donenfeld <Jason@zx2c4.com> | 2024-09-24 03:06:38 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-09-25 23:56:00 +0000 |
| commit | 80143607f06fd6410700e9764cfea9aaac9c311c (patch) | |
| tree | 99ef99e40111c67150513c960eb83ca027fc9478 /src/runtime | |
| parent | 3d6173aa120e64a31438f9fb717afb1b9f6708dd (diff) | |
| download | go-80143607f06fd6410700e9764cfea9aaac9c311c.tar.xz | |
internal/syscall/unix: allow calling getrandom(..., 0, ...)
Calling getrandom() with a zero length is actually valid and useful:
- Calling getrandom(..., 0, 0) will block until the RNG is initialized.
- Calling getrandom(..., 0, GRND_NONBLOCK) will query whether the RNG
is initialized.
So instead of short circuiting execution for these circumstances, pass
this through to the syscall.
Change-Id: I15178f087908a2d8be6c020a1ef800cc0a074742
Reviewed-on: https://go-review.googlesource.com/c/go/+/615315
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Jason Donenfeld <Jason@zx2c4.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions
