File: arc4random.c

package info (click to toggle)
libdnsres 0.1a-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze
  • size: 1,696 kB
  • ctags: 789
  • sloc: sh: 8,139; ansic: 6,864; makefile: 80
file content (22 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <sys/types.h>
#include <stdlib.h>

#include "config.h"

/*
 * For those poor operating systems, that do not have a PRNG in their
 * libc.  We do not require cryptographic random numbers for this
 * application anyway.  Screw you, hippy!
 */

u_int32_t
arc4random(void)
{
	static int init;

	if (!init) {
		init = 1;
		srandom(time(NULL));
	}
	return (random());
}