* NEWS: Mention the bug fix.
* gl/lib/randread.c (get_nonce): Limit getrandom() <= 1024 bytes.
'pr --length=1 --double-space' no longer enters an infinite loop.
[This bug was present in "the beginning".]
+ shred again operates on Solaris when built for 64 bits.
+ Previously it would have exited with a "getrandom: Invalid argument" error.
+ [bug introduced in coreutils-9.0]
+
tac now handles short reads on its input. Previously it may have exited
erroneously, especially with large input files with no separators.
[This bug was present in "the beginning".]
char *buf = buffer, *buflim = buf + bufsize;
while (buf < buflim)
{
- ssize_t nbytes = getrandom (buf, buflim - buf, 0);
+#if defined __sun
+# define MAX_GETRANDOM 1024
+#else
+# define MAX_GETRANDOM SIZE_MAX
+#endif
+ size_t max_bytes = MIN (buflim - buf, MAX_GETRANDOM);
+ ssize_t nbytes = getrandom (buf, max_bytes, 0);
if (0 <= nbytes)
buf += nbytes;
else if (errno != EINTR)