Reputation: 3949
Is there a rand() equivalent function in Linux that I can call in kernel space i.e. say from inside a kernel module ?
Upvotes: 10
Views: 25261
Reputation: 9474
The get_random_bytes()
routine returns the requested number of random bytes and stores them in a buffer. This routine is for kernel modules that cannot be in a wait state.
http://www.linuxquestions.org/questions/programming-9/random-numbers-kernel-642087/
http://www.spinics.net/lists/newbies/msg00062.html
Upvotes: 16