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

static unsigned int seed=1;

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

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