Subject: Re: bug#9734: [solaris] `dd if=/dev/urandom of=file bs=1024k count=1' gets a file of 133120 bytes

From: John Reiser <[email-masked]>
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.

--