]> mj.ucw.cz Git - libucw.git/blobdiff - lib/random.c
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / lib / random.c
index 211986b722d00ae7bc41f7bf9a73e3935f152302..a771c97ae624a2dd83bda57c95c062e316b77108 100644 (file)
 /* We expect the random generator in libc to give at least 30 bits of randomness */
 COMPILE_ASSERT(RAND_MAX_RANGE_TEST, RAND_MAX >= (1 << 30)-1);
 
 /* We expect the random generator in libc to give at least 30 bits of randomness */
 COMPILE_ASSERT(RAND_MAX_RANGE_TEST, RAND_MAX >= (1 << 30)-1);
 
+uns
+random_u32(void)
+{
+  return (random() & 0xffff) | ((random() & 0xffff) << 16);
+}
+
 uns
 random_max(uns max)
 {
 uns
 random_max(uns max)
 {