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
commit2b7fcfdb1365400e634dc4d41a4bcdc1eb29c4d8 (patch)
tree3a56b34572b29c54edee4bee2538dcdea009c377 /util-src/crand.c
parentd5a53255260e621fa6cbd3b3277aa12b41486e0f (diff)
downloadprosody-2b7fcfdb1365400e634dc4d41a4bcdc1eb29c4d8.tar.gz
prosody-2b7fcfdb1365400e634dc4d41a4bcdc1eb29c4d8.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);
}