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

Re: rand() function performs poorly


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 May 2004 00:05:30 -0700 (PDT)

:When you run that code, it will print "OoOoOoOo..." without any change; 
:it's very predictable.
:
:I'm certainly up for bringing the later 4.x rand() code down into 
:DragonFly.  Where do you think they keep it?
:
:And don't one of you other peeps go and do it for me. :-D  I want to try 
:this one on my own!  >:-)
:
:Thanks,
:Mike

    I think you are talking about /usr/src/lib/libc/stdlib/rand.c, but
    I don't think FreeBSD-4 or FreeBSD-5 has fixed that.  They committed
    something but it looks like they backed it out.

    Most people use the random()/srandom() facility rather then the old
    rand() facility, or use /dev/urandom.  The old rand() facility 
    is severely limited due to API requirements and constraints.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



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