From fb76083ae2c2c518374309576a3a0fe4f9d1697c Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 23 Apr 2001 02:29:10 +0000 Subject: Add sranddev() since srand() is not vary much with seed, typical time --- lib/libc/stdlib/rand.3 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdlib/rand.3') 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 .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 -- cgit v1.1