summaryrefslogtreecommitdiffstats
path: root/usr/klibc/tests/testrand48.c
blob: 26868c7f12ddf2fb0d047162aaf0fdd6b7426674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
	unsigned short seed1[] = { 0x1234, 0x5678, 0x9abc };
	unsigned short *oldseed;

	oldseed = seed48(seed1);
	printf("Initial seed: %#06x %#06x %#06x\n",
	       oldseed[0], oldseed[1], oldseed[2]);

	printf("lrand48() = %ld\n", lrand48());

	seed48(seed1);
	printf("mrand48() = %ld\n", mrand48());

	return 1;
}