1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#if defined (hpux) || defined (__alpha__) /* HPUX lacks random(). DEC Alpha's random() returns a double. */ static inline unsigned long urandom () { return mrand48 (); } #else long random (); static inline unsigned long urandom () { /* random() returns 31 bits, we want 32. */ return random() ^ (random() << 1); } #endif