GNU bug report logs - #9734
[solaris] `dd if=/dev/urandom of=file bs=1024k count=1' gets a file of 133120 bytes

Previous Next

Package: coreutils;

Reported by: "Clark J. Wang" <dearvoid <at> gmail.com>

Date: Wed, 12 Oct 2011 12:34:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: John Reiser <jreiser <at> bitwagon.com>
To: 9734 <at> debbugs.gnu.org
Subject: bug#9734: [solaris] `dd if=/dev/urandom of=file bs=1024k count=1' gets a file of 133120 bytes
Date: Wed, 12 Oct 2011 08:10:18 -0700
> I found this in the man page of /dev/urandom on Solaris: "The limitation per
> read for /dev/random is 1040 bytes. The limit for /dev/urandom is (128 *
> 1040 = 133120)." That seems to be the reason but I think dd should handle
> that and check the return value of the read() system call and make sure
> 1024k bytes have really been read from /dev/urandom.

"bs=N" means "write(,,read(,,N))" [error checking has been elided for
presentation here] so if the read is short then the write will be also.
Check the manual page.  Consider ibs=, obs=, iflag=fullblock.

-- 




This bug report was last modified 13 years and 227 days ago.

Previous Next


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