LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-02-2015, 02:21 AM   #1
Amidm
LQ Newbie
 
Registered: Jun 2015
Distribution: Ubuntu 14, Kali , CentOS
Posts: 2

Rep: Reputation: Disabled
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
 
Old 07-02-2015, 02:33 AM   #2
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
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
 
Old 07-02-2015, 02:42 AM   #3
Amidm
LQ Newbie
 
Registered: Jun 2015
Distribution: Ubuntu 14, Kali , CentOS
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JaseP View Post
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
 
Old 07-02-2015, 01:28 PM   #4
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Seed. What is it? cwizardone Slackware 6 03-24-2007 05:39 AM
Creating random seed different for different processors tsakunthala Programming 1 01-05-2007 11:33 AM
system hanging on 'Saving random seed' PennyroyalFrog Linux - Newbie 9 10-01-2005 02:45 PM
Kernel panic while saving random seed SAnton Linux - Software 1 09-27-2005 03:01 AM
using /dev/(u)random for seed ? PTBmilo Programming 2 04-15-2003 01:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration