aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/rand.3
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-04-23 02:29:10 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-04-23 02:29:10 +0000
commit7708205cb774243dfe96540ebbd20970ac48acdd (patch)
treee8894b6d6337659ffd0ead70a9731840e66eff79 /lib/libc/stdlib/rand.3
parentb8ff2fec46f03ff6032de2cad19929ef3665251d (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/rand.3')
-rw-r--r--lib/libc/stdlib/rand.313
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libc/stdlib/rand.3 b/lib/libc/stdlib/rand.3
index b47ff67b8809..67955d9ea0f0 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