LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Random seed (https://www.linuxquestions.org/questions/linux-kernel-70/random-seed-4175546996/)

Amidm 07-02-2015 02:21 AM

Random seed
 
Hi
I should use "get_random_int()" function in my driver, but I dont know how to create new seed for that.(the random should be an int)
does anyone have solution for that?

Thx in advance

JaseP 07-02-2015 02:33 AM

You're programming in C???

Look to this stack overflow answer for seeding the random number generator:
http://stackoverflow.com/questions/8...om-number-in-c

Amidm 07-02-2015 02:42 AM

Quote:

Originally Posted by JaseP (Post 5385996)
You're programming in C???

Look to this stack overflow answer for seeding the random number generator:
http://stackoverflow.com/questions/8...om-number-in-c

Yes,I'm using C but as it is a driver and I can't use the user space libs and I must use Kernel Functions so I can't use "srand(time(NULL));" :(
thx for reply ;)

JaseP 07-02-2015 01:28 PM

Look here:
http://man7.org/linux/man-pages/man4/random.4.html


All times are GMT -5. The time now is 07:39 AM.