summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/random.c
blob: 02d1e10049a1fd181c75a48f9250d08ecd9eaf00 (plain)
1
2
3
4
5
6
7
8
9
#include <stdlib.h>

static unsigned int seed=1;

int random() {
  return ((seed = seed * 1103515245 + 12345) % ((unsigned int)RAND_MAX + 1));
}

void srandom(unsigned int i) { seed=i; }