PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
#include <stddef.h>
Go to the source code of this file.
Functions | |
void | random_init (unsigned seed) |
Initializes or reinitializes the PRNG with the given SEED. More... | |
void | random_bytes (void *, size_t) |
Writes SIZE random bytes into BUF. More... | |
unsigned long | random_ulong (void) |
lib/random.h More... | |
void random_bytes | ( | void * | buf_, |
size_t | size | ||
) |
Writes SIZE random bytes into BUF.
Definition at line 54 of file random.c.
References buf, inited, random_init(), s, s_i, s_j, and swap_byte().
Referenced by main(), random_ulong(), seq_test(), and test_main().
void random_init | ( | unsigned | seed | ) |
Initializes or reinitializes the PRNG with the given SEED.
Definition at line 34 of file random.c.
References inited, s, s_i, s_j, and swap_byte().
Referenced by consume_some_resources_and_die(), main(), parse_options(), random_bytes(), and test_main().
unsigned long random_ulong | ( | void | ) |
Use random_ulong() % n to obtain a random number in the range 0...n (exclusive).
Definition at line 78 of file random.c.
References random_bytes().
Referenced by consume_some_resources_and_die(), expand(), pick_pivot(), shuffle(), test(), and write_some_bytes().