Oh, that's one big advantage of free software: you can read the source
code, and change it if it doesn't meet your needs.
Indeed, that's the reason we all love Free Software.

Thank you very much for directing me to that piece of code. I was struggling a bit to understand it.

Thanks,
Tanmay

On Fri, 19 Apr 2024 at 23:58, Paul Eggert <eggert@cs.ucla.edu> wrote:
On 4/19/24 11:17, Tanmay wrote:
> I've grown more curious about how this feature is implemented to handle
> stdin.

Oh, that's one big advantage of free software: you can read the source
code, and change it if it doesn't meet your needs. GNU diff implements
this feature by using openat. See:

https://git.savannah.gnu.org/cgit/diffutils.git/tree/src/diff.c#n1541