rand(3): Fix up sranddev(3) a bit better.
authorSascha Wildner <saw@online.de>
Tue, 25 Feb 2014 22:50:13 +0000 (23:50 +0100)
committerSascha Wildner <saw@online.de>
Tue, 25 Feb 2014 23:09:08 +0000 (00:09 +0100)
commit7918d779d8aeb069b5be1d6901d96574ed6dd83c
tree3e967a0ee6a3c065becc613ae95024ca9f80f950
parent72e717d2f52974f0e09d1762a491cdfde3fcd899
rand(3): Fix up sranddev(3) a bit better.

In case we can't read /dev/random for the seed, try kern.random. If that
fails, use the getpid()/gettimeofday() xor. For the latter, remove the
usage of an uninitialized variable.

We should probably just abort() when kern.random can't be read.

Discussed-with: dillon
lib/libc/stdlib/rand.c