From owner-freebsd-current Sun Jan 3 12:05:47 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA01829 for freebsd-current-outgoing; Sun, 3 Jan 1999 12:05:47 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from bingsun2.cc.binghamton.edu (bingsun2.cc.binghamton.edu [128.226.1.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA01824 for ; Sun, 3 Jan 1999 12:05:45 -0800 (PST) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun2.cc.binghamton.edu (8.8.7/8.6.9) with SMTP id PAA23462; Sun, 3 Jan 1999 15:04:57 -0500 (EST) Date: Sun, 3 Jan 1999 15:04:57 -0500 (EST) From: zhihuizhang X-Sender: bf20761@bingsun2 To: Thierry Herbelot cc: current@FreeBSD.ORG Subject: Re: Is my /dev/random broken ? In-Reply-To: <368FC908.1D728596@cybercable.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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