Date: Tue, 23 Sep 2008 09:02:03 +0200 (CEST) From: Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl> To: Robert Huff <roberthuff@rcn.com> Cc: questions@freebsd.org Subject: Re: using /dev/random Message-ID: <20080923090135.B35746@wojtek.tensor.gdynia.pl> In-Reply-To: <18648.30321.369520.631459@jerusalem.litteratus.org> References: <18648.30321.369520.631459@jerusalem.litteratus.org>
index | next in thread | previous in thread | raw e-mail
>
> What is the canonical way to get data from /dev/random?
> Specifically: having opened the file, how do I read the stream?
> I'm currently using
>
>
> union {
> float f;
> char c[4];
> } foo;
>
> foo.f = 0.0;
>
> fscanf(rand_fp,"%4c",foo.c);
>
simply read 4 bytes into foo
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080923090135.B35746>
