projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
make pthread_create return EAGAIN on resource failure, as required by POSIX
[oweals/musl.git]
/
src
/
prng
/
rand.c
1
#include <stdlib.h>
2
3
static unsigned seed;
4
5
void srand(unsigned s)
6
{
7
seed = s-1;
8
}
9
10
int rand(void)
11
{
12
return (seed = (seed+1) * 1103515245 + 12345 - 1)+1 & 0x7fffffff;
13
}