using /dev/random

Wojciech Puchar wojtek at wojtek.tensor.gdynia.pl
Tue Sep 23 07:02:14 UTC 2008


>
> 	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


More information about the freebsd-questions mailing list