GNU bug report logs - #6658
[PATCH] randread: don't require -lrt

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> CS.UCLA.EDU>

Date: Fri, 16 Jul 2010 21:18:01 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> CS.UCLA.EDU>
Cc: Jim Meyering <jim <at> meyering.net>, 6658 <at> debbugs.gnu.org
Subject: bug#6658: [PATCH] randread: use /dev/urandom to seed,	not just getpid etc
Date: Wed, 21 Jul 2010 00:18:39 +0100
On 20/07/10 17:59, Paul Eggert wrote:
> OK, I installed part (2) of the patch: it uses /dev/urandom
> rather than the getpid()/gettimeofday() yucky stuff,
> when /dev/urandom is available.

/dev/urandom is very widely available,
so this should work for most systems.

> One downside to this patch is that on hosts where mkstemp
> doesn't work and we're using our substitute, each invocation
> of mkstemp opens /dev/urandom, reads a few bytes, and closes it.
> I don't view this as a big problem, because (a) it's only for
> hosts with broken mkstemp and they should fix their mkstemp and
> (b) creating a temp file is a big-deal operation anyway and
> the extra overhead of opening /dev/urandom doesn't add much.

I agree. Running a million iterations of each seeder:
  orig				3s
  new (1 byte from urandom)	8s
  new (16 bytes from urandom)	11s

The patch looks good.

cheers,
Pádraig.




This bug report was last modified 15 years and 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.