Based on my previous question, what would be the proper yet efficient way to determine the size of stdin if stdin is coming from a pipe or a
stdin
pipe
You can't. Imagine stdin is like a water tap.
What you are asking is the same as "how much water is there in a tap"? :-)