4 static unsigned int random_seed
;
7 #error this rand implementation is for RAND_MAX < 32678 only.
10 unsigned int rand(void)
12 random_seed
= random_seed
* 1103515245 + 12345;
13 return (random_seed
/ 65536) % (RAND_MAX
+ 1);
16 void srand(unsigned int seed
)
21 void get_random_bytes(char *buf
, int len
)
24 *buf
++ = rand() % 256;