diff options
Diffstat (limited to 'lib/libc/stdlib/rand.3')
-rw-r--r-- | lib/libc/stdlib/rand.3 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libc/stdlib/rand.3 b/lib/libc/stdlib/rand.3 index b47ff67..67955d9 100644 --- a/lib/libc/stdlib/rand.3 +++ b/lib/libc/stdlib/rand.3 @@ -42,6 +42,7 @@ .Sh NAME .Nm rand , .Nm srand , +.Nm sranddev , .Nm rand_r .Nd bad random number generator .Sh LIBRARY @@ -50,6 +51,8 @@ .Fd #include <stdlib.h> .Ft void .Fn srand "unsigned seed" +.Ft void +.Fn sranddev void .Ft int .Fn rand void .Ft int @@ -83,6 +86,13 @@ If no value is provided, the functions are automatically seeded with a value of 1. .Pp +The +.Fn sranddev +routine initialize a seed using +.Xr urandom 4 +random number device which returns good random numbers, +suitable for cryptographic use. +.Pp .Fn rand_r provides the same functionality as .Fn rand . @@ -90,7 +100,8 @@ A pointer to the context value .Fa ctx must be supplied by the caller. .Sh SEE ALSO -.Xr random 3 +.Xr random 3 , +.Xr urandom 4 .Sh STANDARDS The .Fn rand |