From 10304bed435034cf8432b1c6262f7e7f0d84d49c Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 5 Jun 2000 11:46:40 +0000 Subject: Split random number functions off io.c, so that they can be documented separately. --- sysdep/unix/random.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sysdep/unix/random.c (limited to 'sysdep/unix/random.c') diff --git a/sysdep/unix/random.c b/sysdep/unix/random.c new file mode 100644 index 00000000..b1f5086f --- /dev/null +++ b/sysdep/unix/random.c @@ -0,0 +1,21 @@ +/* + * BIRD Internet Routing Daemon -- Random Numbers + * + * (c) 2000 Martin Mares + * + * Can be freely distributed and used under the terms of the GNU GPL. + */ + +#include + +#include "nest/bird.h" + +u32 +random_u32(void) +{ + long int rand_low, rand_high; + + rand_low = random(); + rand_high = random(); + return (rand_low & 0xffff) | ((rand_high & 0xffff) << 16); +} -- cgit v1.2.3