Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/rand_r.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/rand_r.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/rand_r.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/rand_r.html on line 8

rand_r()

Generate a pseudo-random integer in a thread-safe manner

Synopsis:

#include <stdlib.h>

int rand_r( unsigned int* seed );

Arguments:

seed
A pointer to the seed for the sequence of pseudo-random numbers. If you call rand_r() with the same initial value for the seed, the same sequence is generated.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The rand_r() function computes, in a thread-safe manner, a sequence of pseudo-random integers in the range 0 through RAND_MAX.

Returns:

A pseudo-random integer.

Classification:

POSIX 1003.1 TSF

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

See also:

rand(), srand()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/rand_r.html on line 112

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/rand_r.html on line 112