[llvm] [Support] Report EISDIR when opening a directory (PR #79880)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 11:40:27 PST 2024


MaskRay wrote:

On Linux, `MemoryBuffer::getFile` on a directory returns an error `EISDIR`. `fstat` is called `getOpenFileImpl<MB>` after a file descriptor is obtained.

I am concerned that this change would cause two `fstat` syscalls for operations like `MemoryBuffer::getFile`. This perhaps needs `#ifdef` like MVS below.

https://github.com/llvm/llvm-project/pull/79880


More information about the llvm-commits mailing list