Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jan 1999 15:04:57 -0500 (EST)
From:      zhihuizhang <bf20761@binghamton.edu>
To:        Thierry Herbelot <herbelot@cybercable.fr>
Cc:        current@FreeBSD.ORG
Subject:   Re: Is my /dev/random broken ?
Message-ID:  <Pine.SOL.L3.93.990103150042.18600A-100000@bingsun2>
In-Reply-To: <368FC908.1D728596@cybercable.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
  
On Sun, 3 Jan 1999, Thierry Herbelot wrote:

> Hello,
> 
> This is a follow-on to a post by Kris Kennaway (Re pgcc-1.1.1).
> 
> I have a recent -Current (cvsupped on Dec 19 13:01) with an a.out kernel
> and an elf userland and I have tried to duplicate Kris' test :
> 
> # dd if=/dev/random of=/usr2/bigfile bs=1024k count=30
> # cp /usr2/bigfile /usr2/bigfile2
> # /usr/bin/time gzip-486 -9 /usr2/bigfile
>        26.06 real        20.46 user         1.17 sys
> # /usr/bin/time gzip-pent -9 /usr2/bigfile2
>        23.12 real        18.58 user         1.20 sys
> 
> But the first line gives the following :
> 
> #dd if=/dev/random of=bigfile bs=1024k count=30
> 0+2 records in
> 0+2 records out
> 6 bytes transferred in 0.000387 secs (15506 bytes/sec)
> #
> repeated executions give **random** numbers of "bytes transferred" (but
> never the right number)
> 
> dd seems to work (I have used it to copy parts of the Generic kernel),
> so /dev/random must be broken ???
> 
> I could live without /dev/random, but what next ?
> 
I guess that you should use /dev/urandom instead of /dev/random.
/dev/random only return a maximum of the number of bits of random
contained in the entropy pool. /dev/urandom returns as many bytes as
you requested.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.L3.93.990103150042.18600A-100000>