Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
92d5270a
Commit
92d5270a
authored
Dec 16, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use get_random_seed() in set_taus_seed(), used by taus()
parent
2ec0b4b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
openair1/SIMULATION/TOOLS/taus.c
openair1/SIMULATION/TOOLS/taus.c
+4
-15
No files found.
openair1/SIMULATION/TOOLS/taus.c
View file @
92d5270a
...
...
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
//#include "SIMULATION/TOOLS/
sim.h"
#include "
sim.h"
static
unsigned
int
s0
,
s1
,
s2
;
...
...
@@ -52,20 +52,9 @@ void set_taus_seed(unsigned int seed_init)
unsigned
long
result
=
0
;
if
(
seed_init
==
0
)
{
unsigned
int
data
[
3
];
int
fd
=
open
(
"/dev/urandom"
,
O_RDONLY
);
if
(
fd
==
-
1
)
{
abort
();
}
if
(
read
(
fd
,
data
,
sizeof
(
data
))
!=
sizeof
(
data
))
{
abort
();
}
close
(
fd
);
s0
=
data
[
0
];
s1
=
data
[
1
];
s2
=
data
[
2
];
s0
=
(
unsigned
int
)
get_random_seed
();
s1
=
(
unsigned
int
)
get_random_seed
();
s2
=
(
unsigned
int
)
get_random_seed
();
}
else
{
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
srand48_r
((
long
int
)
seed_init
,
&
buffer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment