diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2019-06-22 15:18:17 +0200 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2019-09-18 08:09:14 +0200 |
commit | 4ed2a78f0eb1c9d2a0c98ea4a88c6824e5958dc6 (patch) | |
tree | ce6b8b3282f3ac65d6bbeba5cec36463b68f06e5 /src/threadpool.c | |
parent | fd1502f5630591bf8ce79502df9b5d76868dfd3b (diff) | |
download | libuv-4ed2a78f0eb1c9d2a0c98ea4a88c6824e5958dc6.tar.gz libuv-4ed2a78f0eb1c9d2a0c98ea4a88c6824e5958dc6.zip |
unix,win: add uv_random()
Add an API for obtaining cryptographically strong random data from the
system PRNG.
Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
Refs: https://github.com/libuv/libuv/pull/1055
PR-URL: https://github.com/libuv/libuv/pull/2347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'src/threadpool.c')
-rw-r--r-- | src/threadpool.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/threadpool.c b/src/threadpool.c index 7aa57550..a8f433f0 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -372,6 +372,10 @@ int uv_cancel(uv_req_t* req) { loop = ((uv_getnameinfo_t*) req)->loop; wreq = &((uv_getnameinfo_t*) req)->work_req; break; + case UV_RANDOM: + loop = ((uv_random_t*) req)->loop; + wreq = &((uv_random_t*) req)->work_req; + break; case UV_WORK: loop = ((uv_work_t*) req)->loop; wreq = &((uv_work_t*) req)->work_req; |