aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/crand.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-01-22 09:55:44 +0100
committerKim Alvefur <zash@zash.se>2017-01-22 09:55:44 +0100
commit6adfe1e74325f9545fc4032b8d3fdecc92386983 (patch)
tree3a56b34572b29c54edee4bee2538dcdea009c377 /util-src/crand.c
parent3a33321db7be83ef5aab718a8271c4bd81569e50 (diff)
downloadprosody-6adfe1e74325f9545fc4032b8d3fdecc92386983.tar.gz
prosody-6adfe1e74325f9545fc4032b8d3fdecc92386983.zip
util.crand: Comment about getrandom
Diffstat (limited to 'util-src/crand.c')
-rw-r--r--util-src/crand.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util-src/crand.c b/util-src/crand.c
index aa3379c2..7dd71a92 100644
--- a/util-src/crand.c
+++ b/util-src/crand.c
@@ -34,7 +34,10 @@
#error getrandom() requires Linux 3.17 or later
#endif
-/* Was this not supposed to be a function? */
+/*
+ * This acts like a read from /dev/urandom with the exception that it
+ * *does* block if the entropy pool is not yet initialized.
+ */
int getrandom(void *buf, size_t len, int flags) {
return syscall(SYS_getrandom, buf, len, flags);
}