Computes a sequence of pseudo-random integers in the range 0 to RAND_MAX (32767).
#include <stdlib.h> int rand ( void );
#include <stdlib.h> int rand_r ( unsigned long *seed);
(IN/OUT) Points to a seed value (updated with each iteration).
Returns the next pseudo-random number in the sequence.
The rand_r function is the same as rand except that the caller passes storage for the seed, rather than relying on a global variable (which has the potential of being modified by subsequent calls to rand by other threads in the same NLM). The static data for the random number generator is stored for each thread.
The sequence of pseudo-random integers can be started at different values by calling the srand function.