I think you may be confusing /dev/zero and /dev/null. /dev/null (as
its name suggests) returns NULL values, not zeroes.
On Fri, Nov 15, 2019 at 7:26 AM Juha Nikkanen <nikkej(a)gmail.com> wrote:
>
> Ladies and gentlemen,
>
> I have curious problem after booting into 5.3.11. I can't read a stream of
> zeroes from /dev/null anymore:
> $ dd if=/dev/null of=zero.dat bs=2048 count=1
> 0+0 records in
> 0+0 records out
> 0 bytes copied, 0.00036764 s, 0.0 kB/s
>
> and:
> $ file /dev/null
> /dev/null: character special (1/3)
> $ ls -l /dev/null
> crw-rw-rw-. 1 root root 1, 3 Nov 14 20:28 /dev/null
> No matter if I try this as a root or as a ordinary user. Results are
> exactly same. I did not test this with kernels 5.3.7 and 5.3.8, I jumped to
> 5.3.11 from 5.3.6 and I think 5.3.6 did provide a stream of zero data. No
> strace gives anything special, just ordinary read() after dup2() and read
> returns zero length for 2048 requested. Now is this a problem of kernel or
> is it within dd and how it opens a /dev/null or how it flags read()
> function?
>
> Sincerely,
> Juha
> _______________________________________________
> kernel mailing list -- kernel(a)lists.fedoraproject.org
> To unsubscribe send an email to kernel-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org