GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SRAND (3)

NAME

rand, srand, sranddev, rand_r - bad random number generator

CONTENTS

Library
Synopsis
Description
See Also
Standards

LIBRARY


.Lb libc

SYNOPSIS


.In stdlib.h void srand unsigned seed void sranddev void int rand void int rand_r unsigned *ctx

DESCRIPTION


.Bf -symbolic The functions described in this manual page are not cryptographically secure. Cryptographic applications should use arc4random(3) instead.
.Ef

These interfaces are obsoleted by random(3).

The rand function computes a sequence of pseudo-random integers in the range of 0 to RAND_MAX (as defined by the header file
.In stdlib.h ) .

The srand function sets its argument seed as the seed for a new sequence of pseudo-random numbers to be returned by rand. These sequences are repeatable by calling srand with the same seed value.

If no seed value is provided, the functions are automatically seeded with a value of 1.

The sranddev function initializes a seed using pseudo-random numbers obtained from the kernel.

The rand_r function provides the same functionality as rand. A pointer to the context value ctx must be supplied by the caller.

For better generator quality, use random(3) or lrand48(3).

SEE ALSO

arc4random(3), lrand48(3), random(3), random(4)

STANDARDS

The rand and srand functions conform to -isoC.

The rand_r function is as proposed in the POSIX.4a Draft #6 document.

Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.