16 /* This module implements a wrapper for the portable, pseudo-random
17 /* number generator. The wrapper adds automatic initialization.
19 /* mysrand() performs initialization. This call may be skipped.
21 /* myrand() returns a pseudo-random number in the range [0, RAND_MAX].
22 /* If mysrand() was not called, it is invoked with the process ID
23 /* ex-or-ed with the time of day in seconds.
27 /* The Secure Mailer license must be distributed with this software.
29 /* Do not use this code for generating unpredictable numbers.
32 /* IBM T.J. Watson Research
34 /* Yorktown Heights, NY 10598, USA
44 /* Utility library. */
48 static int myrand_initdone
= 0;
50 /* mysrand - initialize */
52 void mysrand(int seed
)
58 /* myrand - pseudo-random number */
62 if (myrand_initdone
== 0)
63 mysrand(getpid() ^ time((time_t *) 0));