rand_r()

generate random number (reentrant) 

Function


SYNOPSIS

#include <stdlib.h>

int rand_r(unsigned int * seedptr);


DESCRIPTION

This function is the reentrant version of the rand() function, for use with multithreaded applications. It generates pseudo-random numbers with period 2^32 in the range from 0 to RAND_MAX. The rand_r() function places the seed value at the address pointed by seedptr, and returns the random number.


PARAMETERS

seedptr 

Is the address of the seed value.


RETURN VALUES

rand_r() returns a pseudo-random number between 0 and RAND_MAX.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
rand(), random(), srand(), srandom()


PTC MKS Toolkit 10.4 Documentation Build 39.