From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261552AbVAGT10 (ORCPT ); Fri, 7 Jan 2005 14:27:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261541AbVAGT0P (ORCPT ); Fri, 7 Jan 2005 14:26:15 -0500 Received: from zcars04e.nortelnetworks.com ([47.129.242.56]:8912 "EHLO zcars04e.nortelnetworks.com") by vger.kernel.org with ESMTP id S261545AbVAGTYi (ORCPT ); Fri, 7 Jan 2005 14:24:38 -0500 Message-ID: <41DEE1E8.3080708@nortelnetworks.com> Date: Fri, 07 Jan 2005 13:24:24 -0600 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ron Peterson CC: linux-kernel@vger.kernel.org Subject: Re: /dev/random vs. /dev/urandom References: <20050107190536.GA14205@mtholyoke.edu> In-Reply-To: <20050107190536.GA14205@mtholyoke.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Ron Peterson wrote: > When I compile and run the code below, the string of octal characters > generated by reading /dev/random contains long strings of zeroes. I was > under the impression that /dev/random is "more random" than > /dev/urandom, and will block when it runs out of entropy until it > gathers more. It's only when RAND_LEN is on the largish side that these > strings of zeroes appear. Just a shot in the dark--could you check the return value of read()? Maybe it's not filling up your entire buffer. Chris