int rand_r(unsigned *seed);
void srand(unsigned seed);
IEEE Std 1003.1-2017
rand() function shall compute a sequence of pseudo-random integers in the range
[0, RAND_MA] with a
period of at least
rand() function need not be thread-safe.
rand_r() function shall compute a sequence of pseudo-random integers in the range
[0, RAND_MA]. (The value of
RAND_MA macro shall be at least
rand_r() is called with the same initial value for the object pointed to by seed and that object is not
modified between successive returns and calls to
rand_r(), the same sequence shall be generated.
srand() function uses the argument as a seed for a new sequence of pseudo-random numbers to be returned by subsequent
srand() is then called with the same seed value, the sequence of pseudo-random numbers shall be
rand() is called before any calls to
srand() are made, the same sequence shall be generated as when
srand() is first called with a seed value of
The implementation shall behave as if no function defined in this volume of POSIX.1-2017 calls
rand() function shall return the next pseudo-random number in the sequence.
rand_r() function shall return a pseudo-random integer.
srand() function shall not return a value.
No errors are defined.