File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / bird / sysdep / unix / random.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Aug 22 12:33:54 2017 UTC (7 years ago) by misho
Branches: bird, MAIN
CVS tags: v1_6_8p3, v1_6_3p0, v1_6_3, HEAD
bird 1.6.3

    1: /*
    2:  *	BIRD Internet Routing Daemon -- Random Numbers
    3:  *
    4:  *	(c) 2000 Martin Mares <mj@ucw.cz>
    5:  *
    6:  *	Can be freely distributed and used under the terms of the GNU GPL.
    7:  */
    8: 
    9: #include <stdlib.h>
   10: 
   11: #include "nest/bird.h"
   12: 
   13: u32
   14: random_u32(void)
   15: {
   16:   long int rand_low, rand_high;
   17: 
   18:   rand_low = random();
   19:   rand_high = random();
   20:   return (rand_low & 0xffff) | ((rand_high & 0xffff) << 16);
   21: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>