NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | STANDARDS | ATTRIBUTES | SEE ALSO
#include <stdlib.h>int rand_r(unsigned int *seed);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The rand_r() function computes a sequence of pseudo-random integers in the range of 0 to RAND_MAX (as defined by the header file stdlib.h).
The status is stored in the application space, and its address is given to rand_r() via the seed parameter. It is not mandatory to initialize *seed but it can be reset to an arbitrary value at any time. Each particular value will lead to a particular suite of rand_r() results. This suite is the same as that produced by calling srand(3STDC) once with the initial *seed value, and then calling rand(3STDC) repeatedly. By allocating *seed in its stack, each thread can have its own repeatable suite of numbers.
The rand_r() function conforms to POSIX.1c standards.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | STANDARDS | ATTRIBUTES | SEE ALSO