DragonFly BSD
DragonFly submit List (threaded) for 2004-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [PATCH] rand.c updates from FreeBSD RELENG_5


From: "William M. Grim" <wgrim@xxxxxxxx>
Date: Sun, 16 May 2004 20:08:54 -0500

Matthew Dillon wrote:
:I have redone the rand.3 patch and attached it. I tested it against :what is currently in DFly's CVS and did not witness any problems. Let :me know how it goes.
:
:Thanks again,
:Mike


    Whoop, I was all ready to commit this but then noticed that, in fact,
    you attached rand.c rather then rand.3.

    If you could repost your cleaned up rand.3 I'll be able to finally get
    this in the tree.

Note to self: lack of sleep == bad.


I have attached the appropriate patch now.

I hope everything is golden now :-)

--Mike
--- rand.3	2004-05-13 16:29:35.000000000 -0500
+++ rand.3.new	2004-05-12 15:51:53.000000000 -0500
@@ -34,7 +34,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)rand.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdlib/rand.3,v 1.4.2.5 2001/12/14 18:33:58 ru Exp $
+.\" $FreeBSD: src/lib/libc/stdlib/rand.3,v 1.14 2003/09/08 19:57:15 ru Exp $
 .\" $DragonFly: src/lib/libc/stdlib/rand.3,v 1.2 2003/06/17 04:26:46 dillon Exp $
 .\"
 .Dd May 25, 1999
@@ -43,6 +43,7 @@
 .Sh NAME
 .Nm rand ,
 .Nm srand ,
+.Nm sranddev ,
 .Nm rand_r
 .Nd bad random number generator
 .Sh LIBRARY
@@ -51,6 +52,8 @@
 .In stdlib.h
 .Ft void
 .Fn srand "unsigned seed"
+.Ft void
+.Fn sranddev void
 .Ft int
 .Fn rand void
 .Ft int
@@ -67,7 +70,7 @@
 of 0 to
 .Dv RAND_MAX
 (as defined by the header file
-.Aq Pa stdlib.h ) .
+.In stdlib.h ) .
 .Pp
 The
 .Fn srand
@@ -85,14 +88,24 @@
 value is provided, the functions are automatically
 seeded with a value of 1.
 .Pp
+The
+.Fn sranddev
+function initializes a seed using the
+.Xr random 4
+random number device which returns good random numbers,
+suitable for cryptographic use.
+.Pp
+The
 .Fn rand_r
+function
 provides the same functionality as
 .Fn rand .
 A pointer to the context value
 .Fa ctx
 must be supplied by the caller.
 .Sh SEE ALSO
-.Xr random 3
+.Xr random 3 ,
+.Xr random 4
 .Sh STANDARDS
 The
 .Fn rand


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]