rand() function performs poorly
Matthew Dillon
dillon at apollo.backplane.com
Wed May 12 00:06:10 PDT 2004
: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 at xxxxxxxxxxxxx>
More information about the Kernel
mailing list