[Previous] [Contents] [Next]

rand_r()

Generate a pseudo-random integer

Synopsis:

#include <stdlib.h>

int rand_r( unsigned int* seed );

Library:

libc

Description:

If _POSIX_THREAD_SAFE_FUNCTIONS is defined, rand_r() computes a sequence of pseudo-random integers in the range 0 to RAND_MAX.

If rand_r() is called with the same initial value for the seed, the same sequence will be generated.

Returns:

A pseudo-random integer.

Classification:

POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

rand(), srand()


[Previous] [Contents] [Next]