Subject: Re: bug#61300: wc -c doesn't advance stdin position when it's a regular file

From: Paul Eggert <[email-masked]>
Date: Mon, 6 Feb 2023 11:50:37 -0800

On 2/6/23 11:38, Pádraig Brady wrote:
> Note also if you really want to read, you can always `cat | wc -c`
> rather than just `wc -c`

Even that's not guaranteed, as 'cat' is not required to use the 'read' 
system call if it can determine that the standard input contains only 
NULs without calling 'read'. (GNU 'cat' doesn't do this, but POSIX 
allows it.)

We shouldn't complicate 'wc' (thus slowing it down and worse, possibly 
introducing a bug) if the only goal is to make 'wc' fail more often in 
implausible scenarios.