On Thu, Nov 18, 2021 at 8:40 AM Michael Paquier <michael@paquier.xyz> wrote:
On Wed, Nov 17, 2021 at 01:29:02PM +0300, Dmitry Koval wrote: > Attachments: patch + screenshot with error.
I think that we had better never call GetFileInformationByHandle() if we use a fileno that maps to stdin, stdout or stderr. The 10000$ question is what to use though. One option is to let our emulation code fill in the gap for those three cases with at least st_mode filled with S_IFIFO, then return 0 as error code :/
When the file descriptor is coming from a stream I don't think we have to use GetFileInformationByHandle() or stat() to get any information, but we can directly return the stat information. Please find attached a patch for so.