summaryrefslogtreecommitdiff
path: root/gl/lib/rand-isaac.c
diff options
context:
space:
mode:
authorPaul R. Eggert <eggert@cs.ucla.edu>2010-07-16 14:02:08 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2010-07-16 15:49:05 -0700
commite7523efb7d73cefcbd76b499f19fb473f8eb2d13 (patch)
tree0f352ee8475d441df799233ccc62c80661b27d33 /gl/lib/rand-isaac.c
parent78e6fb04890aae3937ba3a00d1e0cdd3bca1770e (diff)
downloadcoreutils-e7523efb7d73cefcbd76b499f19fb473f8eb2d13.tar.xz
randread: don't require -lrt
Programs like 'sort' were linking to -lrt in order to get clock_gettime, but this was misguided: it wasted considerable resources while gaining at most 10 bits of entropy. Almost nobody needs the entropy, and there are better ways to get much better entropy for people who do need it. * gl/lib/rand-isaac.c (isaac_seed): Include <sys/time.h> not "gethrxtime.h". (isaac_seed): Use gettimeofday rather than gethrxtime. * gl/modules/randread (Depends-on): Depend on gettimeofday and not gethrxtime. * src/Makefile.am (mktemp_LDADD, shred_LDADD, shuf_LDADD, sort_LDADD): (tac_LDADD): Omit $(LIB_GETHRXTIME); no longer needed.
Diffstat (limited to 'gl/lib/rand-isaac.c')
-rw-r--r--gl/lib/rand-isaac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gl/lib/rand-isaac.c b/gl/lib/rand-isaac.c
index 52d53a393..377caa605 100644
--- a/gl/lib/rand-isaac.c
+++ b/gl/lib/rand-isaac.c
@@ -35,10 +35,9 @@
#include "rand-isaac.h"
#include <string.h>
+#include <sys/time.h>
#include <unistd.h>
-#include "gethrxtime.h"
-
/* This index operation is more efficient on many processors */
#define ind(mm, x) \
@@ -292,7 +291,8 @@ isaac_seed (struct isaac_state *s)
{ gid_t t = getgid (); ISAAC_SEED (s, t); }
{
- xtime_t t = gethrxtime ();
+ struct timeval t;
+ gettimeofday (&t, NULL);
ISAAC_SEED (s, t);
}